251213:1509 Docunment Number Businee Rule not correct
This commit is contained in:
@@ -18,7 +18,11 @@ export interface CorrespondenceRevision {
|
||||
id: number;
|
||||
revisionNumber: number;
|
||||
revisionLabel?: string; // e.g. "A", "00"
|
||||
title: string;
|
||||
subject: string;
|
||||
body?: string;
|
||||
remarks?: string;
|
||||
dueDate?: string;
|
||||
schemaVersion?: number;
|
||||
description?: string;
|
||||
isCurrent: boolean;
|
||||
status?: {
|
||||
@@ -40,7 +44,7 @@ export interface CorrespondenceRevision {
|
||||
originator?: Organization;
|
||||
project?: { id: number; projectName: string; projectCode: string };
|
||||
type?: { id: number; typeName: string; typeCode: string };
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Keep explicit Correspondence for Detail View if needed, or merge concepts
|
||||
@@ -58,14 +62,27 @@ export interface Correspondence {
|
||||
project?: { id: number; projectName: string; projectCode: string };
|
||||
type?: { id: number; typeName: string; typeCode: string };
|
||||
revisions?: CorrespondenceRevision[]; // Nested revisions
|
||||
recipients?: {
|
||||
correspondenceId: number;
|
||||
recipientOrganizationId: number;
|
||||
recipientType: 'TO' | 'CC';
|
||||
recipientOrganization?: Organization;
|
||||
}[];
|
||||
}
|
||||
|
||||
export interface CreateCorrespondenceDto {
|
||||
projectId: number;
|
||||
typeId: number;
|
||||
subTypeId?: number;
|
||||
disciplineId?: number;
|
||||
subject: string;
|
||||
body?: string;
|
||||
remarks?: string;
|
||||
dueDate?: string;
|
||||
description?: string;
|
||||
documentTypeId: number;
|
||||
fromOrganizationId: number;
|
||||
toOrganizationId: number;
|
||||
importance: "NORMAL" | "HIGH" | "URGENT";
|
||||
details?: Record<string, any>;
|
||||
isInternal?: boolean;
|
||||
originatorId?: number;
|
||||
recipients?: { organizationId: number; type: 'TO' | 'CC' }[];
|
||||
attachments?: File[];
|
||||
}
|
||||
|
||||
@@ -5,20 +5,29 @@ export interface CreateCorrespondenceDto {
|
||||
projectId: number;
|
||||
|
||||
/** ID ของประเภทเอกสาร (เช่น RFA, LETTER) */
|
||||
typeId: number;
|
||||
|
||||
typeId: number;
|
||||
|
||||
/** [Req 6B] สาขางาน (เช่น GEN, STR) */
|
||||
disciplineId?: number;
|
||||
disciplineId?: number;
|
||||
|
||||
/** [Req 6B] ประเภทย่อย (เช่น MAT, SHP สำหรับ Transmittal/RFA) */
|
||||
subTypeId?: number;
|
||||
|
||||
|
||||
/** หัวข้อเอกสาร */
|
||||
title: string;
|
||||
subject: string;
|
||||
|
||||
/** รายละเอียดเพิ่มเติม (Optional) */
|
||||
description?: string;
|
||||
|
||||
/** เนื้อหาเอกสาร (Rich Text) */
|
||||
body?: string;
|
||||
|
||||
/** หมายเหตุ */
|
||||
remarks?: string;
|
||||
|
||||
/** กำหนดวันตอบกลับ (ISO Date String) */
|
||||
dueDate?: string;
|
||||
|
||||
/** ข้อมูล JSON เฉพาะประเภท (เช่น RFI question, RFA details) */
|
||||
details?: Record<string, any>;
|
||||
|
||||
@@ -29,4 +38,7 @@ export interface CreateCorrespondenceDto {
|
||||
* ใช้กรณี Admin สร้างเอกสารแทนผู้อื่น
|
||||
*/
|
||||
originatorId?: number;
|
||||
}
|
||||
|
||||
/** รายชื่อผู้รับ */
|
||||
recipients?: { organizationId: number; type: 'TO' | 'CC' }[];
|
||||
}
|
||||
|
||||
@@ -12,7 +12,13 @@ export interface CreateRfaDto {
|
||||
disciplineId?: number;
|
||||
|
||||
/** หัวข้อเรื่อง */
|
||||
title: string;
|
||||
subject: string;
|
||||
|
||||
/** เนื้อหา (Rich Text) */
|
||||
body?: string;
|
||||
|
||||
/** หมายเหตุ */
|
||||
remarks?: string;
|
||||
|
||||
/** ส่งถึงใคร (สำหรับ Routing Step 1) */
|
||||
toOrganizationId: number;
|
||||
|
||||
@@ -8,13 +8,22 @@ export interface RFAItem {
|
||||
}
|
||||
|
||||
export interface RFA {
|
||||
id: number;
|
||||
id: number; // Shared PK with Correspondence
|
||||
rfaTypeId: number;
|
||||
createdBy: number;
|
||||
disciplineId?: number;
|
||||
revisions: {
|
||||
id: number;
|
||||
revisionNumber: number;
|
||||
subject: string;
|
||||
isCurrent: boolean;
|
||||
createdAt?: string;
|
||||
statusCode?: { statusCode: string; statusName: string };
|
||||
items?: {
|
||||
shopDrawingRevision?: {
|
||||
id: number;
|
||||
revisionLabel: string;
|
||||
shopDrawing?: { drawingType?: { hasNumber: boolean } }; // Mock structure
|
||||
attachments?: { id: number; url: string; name: string }[]
|
||||
}
|
||||
}[];
|
||||
@@ -24,25 +33,33 @@ export interface RFA {
|
||||
name: string;
|
||||
code: string;
|
||||
};
|
||||
// Deprecated/Mapped fields (keep optional if frontend uses them elsewhere)
|
||||
rfaId?: number;
|
||||
rfaNumber?: string;
|
||||
subject?: string;
|
||||
status?: string;
|
||||
createdAt?: string;
|
||||
contractName?: string;
|
||||
disciplineName?: string;
|
||||
// Shared Correspondence Relation
|
||||
correspondence?: {
|
||||
id: number;
|
||||
correspondenceNumber: string;
|
||||
projectId: number;
|
||||
originatorId?: number;
|
||||
createdAt?: string;
|
||||
project?: {
|
||||
projectName: string;
|
||||
projectCode: string;
|
||||
};
|
||||
};
|
||||
|
||||
// Deprecated/Mapped fields
|
||||
correspondenceNumber?: string; // Convenience accessor
|
||||
}
|
||||
|
||||
export interface CreateRFADto {
|
||||
projectId?: number;
|
||||
projectId: number;
|
||||
rfaTypeId: number;
|
||||
title: string;
|
||||
disciplineId?: number;
|
||||
subject: string;
|
||||
body?: string; // [New]
|
||||
remarks?: string; // [New]
|
||||
dueDate?: string; // [New]
|
||||
description?: string;
|
||||
contractId: number;
|
||||
disciplineId: number;
|
||||
toOrganizationId: number;
|
||||
dueDate?: string;
|
||||
documentDate?: string;
|
||||
details?: Record<string, any>;
|
||||
shopDrawingRevisionIds?: number[];
|
||||
items: RFAItem[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user