BE/src/oracle/param-table/param-table.dto.ts
2025-04-30 12:57:29 +05:30

148 lines
3.2 KiB
TypeScript

import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import {
IsDefined,
IsInt,
IsNumber,
IsOptional,
IsString,
Min,
} from 'class-validator';
export class CreateTableRecordDTO {
@ApiProperty({ required: true })
@IsString({ message: 'Property P_USERID must be a string' })
@IsDefined({ message: 'Property P_USERID is required' })
P_USERID: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property P_TABLEFULLDESC must be a string' })
@IsDefined({ message: 'Property P_TABLEFULLDESC is required' })
P_TABLEFULLDESC: string;
}
export class CreateParamRecordDTO {
@ApiProperty({ required: false })
@IsOptional()
@IsNumber()
P_SPID?: number;
@ApiProperty({ required: true })
@IsString()
P_PARAMTYPE: string;
@ApiProperty({ required: true })
@IsString()
P_PARAMDESC: string;
@ApiProperty({ required: true })
@IsString()
P_PARAMVALUE: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
P_ADDLPARAMVALUE1?: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
P_ADDLPARAMVALUE2?: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
P_ADDLPARAMVALUE3?: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
P_ADDLPARAMVALUE4?: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
P_ADDLPARAMVALUE5?: string;
@ApiProperty({ required: true })
@IsNumber()
P_SORTSEQ: number;
@ApiProperty({ required: true })
@IsString()
P_USERID: string;
}
export class UpdateParamRecordDTO {
@ApiProperty({ required: false })
@IsOptional()
@IsNumber()
P_SPID?: number;
@ApiProperty({ required: true })
@IsNumber()
P_PARAMID: number;
@ApiProperty({ required: true })
@IsString()
P_PARAMDESC: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
P_ADDLPARAMVALUE1?: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
P_ADDLPARAMVALUE2?: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
P_ADDLPARAMVALUE3?: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
P_ADDLPARAMVALUE4?: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
P_ADDLPARAMVALUE5?: string;
@ApiProperty({ required: true })
@IsNumber()
P_SORTSEQ: number;
@ApiProperty({ required: true })
@IsString()
P_USERID: string;
}
export class getParamValuesDTO {
@Min(0, { message: 'Property P_SPID must be at least 0' })
@IsInt({ message: 'Property P_SPID must be a whole number' })
@IsNumber({}, { message: 'Property P_SPID must be a number' })
@Transform(({ value }) => Number(value))
@IsOptional()
P_SPID?: number;
@IsString({ message: 'Property P_PARAMTYPE must be a string' })
@IsOptional()
P_PARAMTYPE?: string;
}
export class ActivateOrInactivateParamRecordDTO {
@ApiProperty({ required: true })
@IsNumber({}, { message: 'Property P_PARAMID must be a number' })
@IsDefined({ message: 'Property P_PARAMID is required' })
P_PARAMID: number;
@ApiProperty({ required: true })
@IsString({ message: 'Property P_USERID must be a string' })
@IsDefined({ message: 'Property P_USERID is required' })
P_USERID: string;
}