690404:1139 Modify ADR
This commit is contained in:
@@ -107,7 +107,7 @@ export function UserDialog({ open, onOpenChange, user }: UserDialogProps) {
|
||||
lastName: user.lastName,
|
||||
isActive: user.isActive,
|
||||
lineId: user.lineId || '',
|
||||
primaryOrganizationId: user.primaryOrganizationId?.toString() || ALL_ORGANIZATIONS_VALUE,
|
||||
primaryOrganizationId: user.primaryOrganizationId || ALL_ORGANIZATIONS_VALUE,
|
||||
roleIds: user.roles?.map((r: { roleId?: number }) => r.roleId).filter((id): id is number => id !== undefined) || [],
|
||||
password: '',
|
||||
confirmPassword: '',
|
||||
|
||||
@@ -77,15 +77,14 @@ interface DisciplineOption {
|
||||
}
|
||||
|
||||
interface InitialCorrespondenceData {
|
||||
projectId?: number | string;
|
||||
projectId?: string;
|
||||
project?: { publicId?: string };
|
||||
contract?: { publicId?: string };
|
||||
correspondenceTypeId?: number;
|
||||
type?: { id?: number; publicId?: string };
|
||||
type?: { id?: number };
|
||||
disciplineId?: number;
|
||||
discipline?: {
|
||||
id?: number;
|
||||
publicId?: string;
|
||||
contract?: { publicId?: string };
|
||||
};
|
||||
revisions?: Array<{
|
||||
@@ -102,11 +101,11 @@ interface InitialCorrespondenceData {
|
||||
receivedDate?: string;
|
||||
details?: { importance: 'NORMAL' | 'HIGH' | 'URGENT' };
|
||||
}>;
|
||||
originatorId?: number;
|
||||
originatorId?: string;
|
||||
originator?: { publicId?: string };
|
||||
recipients?: Array<{
|
||||
recipientType: string;
|
||||
recipientOrganizationId: number;
|
||||
recipientOrganizationId?: string;
|
||||
recipientOrganization?: { publicId?: string };
|
||||
}>;
|
||||
correspondenceNumber?: string;
|
||||
|
||||
@@ -70,6 +70,7 @@ type RfaTypeOption = {
|
||||
};
|
||||
|
||||
type CorrespondenceTypeOption = {
|
||||
id: number; // Master data INT ID
|
||||
publicId: string; // ADR-019: public identifier
|
||||
typeCode?: string;
|
||||
typeName?: string;
|
||||
@@ -272,8 +273,8 @@ export function RFAForm() {
|
||||
try {
|
||||
const res = await correspondenceService.previewNumber({
|
||||
projectId: selectedProjectId,
|
||||
typeId: rfaCorrespondenceType.publicId,
|
||||
disciplineId,
|
||||
typeId: rfaCorrespondenceType.id,
|
||||
disciplineId: Number(disciplineId || 0),
|
||||
recipients: [{ organizationId: toOrganizationId, type: 'TO' }],
|
||||
subject: watch('subject') || 'Preview Subject',
|
||||
});
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
// File: src/types/dto/correspondence/create-correspondence.dto.ts
|
||||
|
||||
export interface CreateCorrespondenceDto {
|
||||
/** ID or UUID ของโครงการ */
|
||||
projectId: number | string;
|
||||
/** UUID ของโครงการ (ADR-019) */
|
||||
projectId: string;
|
||||
|
||||
/** ID ของประเภทเอกสาร (เช่น RFA, LETTER) - ADR-019: Accept UUID */
|
||||
typeId: number | string;
|
||||
/** ID ของประเภทเอกสาร (เช่น RFA, LETTER) - Master data ใช้ INT */
|
||||
typeId: number;
|
||||
|
||||
/** [Req 6B] สาขางาน (เช่น GEN, STR) - ADR-019: Accept UUID */
|
||||
disciplineId?: number | string;
|
||||
/** [Req 6B] สาขางาน (เช่น GEN, STR) - Master data ใช้ INT */
|
||||
disciplineId?: number;
|
||||
|
||||
/** [Req 6B] ประเภทย่อย (เช่น MAT, SHP สำหรับ Transmittal/RFA) - ADR-019: Accept UUID */
|
||||
subTypeId?: number | string;
|
||||
/** [Req 6B] ประเภทย่อย (เช่น MAT, SHP สำหรับ Transmittal/RFA) - Master data ใช้ INT */
|
||||
subTypeId?: number;
|
||||
|
||||
/** หัวข้อเอกสาร */
|
||||
subject: string;
|
||||
@@ -44,13 +44,13 @@ export interface CreateCorrespondenceDto {
|
||||
isInternal?: boolean;
|
||||
|
||||
/** * ✅ Field สำหรับ Impersonation (เลือกองค์กรผู้ส่ง)
|
||||
* ใช้กรณี Admin สร้างเอกสารแทนผู้อื่น
|
||||
* ใช้กรณี Admin สร้างเอกสารแทนผู้อื่น (ADR-019: UUID)
|
||||
*/
|
||||
originatorId?: number | string;
|
||||
originatorId?: string;
|
||||
|
||||
/** Temp IDs from two-phase file upload (POST /files/upload → tempId) */
|
||||
attachmentTempIds?: string[];
|
||||
|
||||
/** รายชื่อผู้รับ */
|
||||
recipients?: { organizationId: number | string; type: 'TO' | 'CC' }[];
|
||||
/** รายชื่อผู้รับ (ADR-019: organizationId เป็น UUID) */
|
||||
recipients?: { organizationId: string; type: 'TO' | 'CC' }[];
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export interface User {
|
||||
lastName: string;
|
||||
isActive: boolean;
|
||||
lineId?: string;
|
||||
primaryOrganizationId?: number | string; // ADR-019: May be INT or UUID
|
||||
primaryOrganizationId?: string; // ADR-019: UUID string only
|
||||
organization?: UserOrganization;
|
||||
roles?: Role[];
|
||||
|
||||
@@ -43,7 +43,7 @@ export interface CreateUserDto {
|
||||
password?: string;
|
||||
isActive: boolean;
|
||||
lineId?: string;
|
||||
primaryOrganizationId?: number | string; // ADR-019: Accept UUID
|
||||
primaryOrganizationId?: string; // ADR-019: UUID string only
|
||||
roleIds: number[];
|
||||
}
|
||||
|
||||
@@ -54,5 +54,5 @@ export interface SearchUserDto {
|
||||
limit?: number;
|
||||
search?: string;
|
||||
roleId?: number;
|
||||
primaryOrganizationId?: number | string; // ADR-019: Accept UUID
|
||||
primaryOrganizationId?: string; // ADR-019: UUID string only
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user