Files
lcbp3/backend/src/modules/rfa/dto/create-rfa.dto.ts
admin ec35521258
Some checks failed
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled
251213:1509 Docunment Number Businee Rule not correct
2025-12-13 15:09:01 +07:00

82 lines
2.0 KiB
TypeScript

// File: src/modules/rfa/dto/create-rfa.dto.ts
import { ApiProperty } from '@nestjs/swagger';
import {
IsArray,
IsDateString,
IsInt,
IsNotEmpty,
IsObject,
IsOptional,
IsString,
} from 'class-validator';
export class CreateRfaDto {
@ApiProperty({ description: 'ID ของโครงการ', example: 1 })
@IsInt()
@IsNotEmpty()
projectId!: number;
@ApiProperty({ description: 'ID ของประเภท RFA', example: 1 })
@IsInt()
@IsNotEmpty()
rfaTypeId!: number;
@ApiProperty({
description: 'ID ของสาขางาน (Discipline) ตาม Req 6B',
example: 1,
})
@IsInt()
@IsOptional() // Optional ไว้ก่อนเผื่อบางโครงการไม่บังคับ
disciplineId?: number;
@ApiProperty({
description: 'หัวข้อเอกสาร',
example: 'Submission of Shop Drawing for Building A',
})
@IsString()
@IsNotEmpty()
subject!: string;
@ApiProperty({ description: 'Body', required: false })
@IsString()
@IsOptional()
body?: string;
@ApiProperty({ description: 'Remarks', required: false })
@IsString()
@IsOptional()
remarks?: string;
@ApiProperty({ description: 'Due Date', required: false })
@IsDateString()
@IsOptional()
dueDate?: string;
@ApiProperty({ description: 'รายละเอียดเพิ่มเติม', required: false })
@IsString()
@IsOptional()
description?: string;
@ApiProperty({ description: 'วันที่ในเอกสาร', required: false })
@IsDateString()
@IsOptional()
documentDate?: string;
@ApiProperty({
description: 'ข้อมูล Dynamic Details (JSON)',
required: false,
})
@IsObject()
@IsOptional()
details?: Record<string, any>;
@ApiProperty({
description: 'รายการ Shop Drawing Revisions ที่แนบมาด้วย',
required: false,
type: [Number],
})
@IsArray()
@IsOptional()
shopDrawingRevisionIds?: number[];
}