251206:1710 specs: frontend plan P1,P3 wait Verification
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
admin
2025-12-06 17:10:56 +07:00
parent be3b71007a
commit 5c49bac772
40 changed files with 977 additions and 244 deletions
@@ -1,4 +1,3 @@
// File: src/modules/correspondence/dto/create-correspondence.dto.ts
import {
IsInt,
IsString,
@@ -7,42 +6,64 @@ import {
IsBoolean,
IsObject,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
export class CreateCorrespondenceDto {
@ApiProperty({ description: 'Project ID', example: 1 })
@IsInt()
@IsNotEmpty()
projectId!: number;
@ApiProperty({ description: 'Document Type ID', example: 1 })
@IsInt()
@IsNotEmpty()
typeId!: number; // ID ของประเภทเอกสาร (เช่น RFA, LETTER)
@ApiPropertyOptional({ description: 'Discipline ID', example: 2 })
@IsInt()
@IsOptional()
disciplineId?: number; // [Req 6B] สาขางาน (เช่น GEN, STR)
@ApiPropertyOptional({ description: 'Sub Type ID', example: 3 })
@IsInt()
@IsOptional()
subTypeId?: number; // [Req 6B] ประเภทย่อย (เช่น MAT, SHP สำหรับ Transmittal/RFA)
@ApiProperty({
description: 'Correspondence Title',
example: 'Monthly Progress Report',
})
@IsString()
@IsNotEmpty()
title!: string;
@ApiPropertyOptional({
description: 'Correspondence Description',
example: 'Detailed report...',
})
@IsString()
@IsOptional()
description?: string;
@ApiPropertyOptional({
description: 'Additional details (JSON)',
example: { key: 'value' },
})
@IsObject()
@IsOptional()
details?: Record<string, any>; // ข้อมูล JSON (เช่น RFI question)
@ApiPropertyOptional({ description: 'Is internal document?', default: false })
@IsBoolean()
@IsOptional()
isInternal?: boolean;
// ✅ เพิ่ม Field สำหรับ Impersonation (เลือกองค์กรผู้ส่ง)
@ApiPropertyOptional({
description: 'Originator Organization ID (for impersonation)',
example: 1,
})
@IsInt()
@IsOptional()
originatorId?: number;
}
}
@@ -1,6 +1,6 @@
import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
import { BaseEntity } from '../../../common/entities/base.entity.js'; // ถ้าไม่ได้ใช้ BaseEntity ก็ลบออกแล้วใส่ createdAt เอง
import { RoutingTemplateStep } from './routing-template-step.entity.js'; // เดี๋ยวสร้าง
import { BaseEntity } from '../../../common/entities/base.entity'; // ถ้าไม่ได้ใช้ BaseEntity ก็ลบออกแล้วใส่ createdAt เอง
import { RoutingTemplateStep } from './routing-template-step.entity'; // เดี๋ยวสร้าง
@Entity('correspondence_routing_templates')
export class RoutingTemplate {