690328:1106 Fixing Refactor uuid by Kimi #01
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
export interface ContractProjectReference {
|
||||
publicId?: string;
|
||||
id?: string;
|
||||
projectCode: string;
|
||||
projectName: string;
|
||||
}
|
||||
|
||||
export interface Contract {
|
||||
publicId?: string;
|
||||
id?: string;
|
||||
contractCode: string;
|
||||
contractName: string;
|
||||
projectId?: number | string;
|
||||
@@ -16,10 +14,3 @@ export interface Contract {
|
||||
endDate?: string;
|
||||
project?: ContractProjectReference;
|
||||
}
|
||||
|
||||
export const getContractPublicId = (contract?: Pick<Contract, 'publicId' | 'id'>): string =>
|
||||
String(contract?.publicId ?? contract?.id ?? '');
|
||||
|
||||
export const getProjectPublicId = (
|
||||
project?: Pick<ContractProjectReference, 'publicId' | 'id'>
|
||||
): string => String(project?.publicId ?? project?.id ?? '');
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
export interface Organization {
|
||||
publicId: string; // ADR-019: exposed as 'id' in API responses
|
||||
id?: number; // Excluded from API responses (ADR-019)
|
||||
publicId: string; // ADR-019: public identifier
|
||||
organizationName: string;
|
||||
organizationCode: string;
|
||||
}
|
||||
|
||||
export interface Attachment {
|
||||
publicId: string; // ADR-019: exposed as 'id' in API responses
|
||||
id?: number; // Excluded from API responses (ADR-019)
|
||||
publicId: string; // ADR-019: public identifier
|
||||
name: string;
|
||||
url: string;
|
||||
size?: number;
|
||||
@@ -17,8 +15,7 @@ export interface Attachment {
|
||||
|
||||
// Used in List View mainly
|
||||
export interface CorrespondenceRevision {
|
||||
publicId: string; // ADR-019: exposed as 'id' in API responses
|
||||
id?: number; // Excluded from API responses (ADR-019)
|
||||
publicId: string; // ADR-019: public identifier
|
||||
revisionNumber: number;
|
||||
revisionLabel?: string; // e.g. "A", "00"
|
||||
subject: string;
|
||||
@@ -42,22 +39,20 @@ export interface CorrespondenceRevision {
|
||||
|
||||
// Nested Relation from Backend Refactor
|
||||
correspondence: {
|
||||
publicId: string;
|
||||
id?: number; // Excluded from API responses (ADR-019)
|
||||
publicId: string; // ADR-019: public identifier
|
||||
correspondenceNumber: string;
|
||||
projectId: number;
|
||||
originatorId?: number;
|
||||
isInternal: boolean;
|
||||
originator?: Organization;
|
||||
project?: { publicId: string; id?: number; projectName: string; projectCode: string };
|
||||
project?: { publicId: string; projectName: string; projectCode: string };
|
||||
type?: { id: number; typeName: string; typeCode: string };
|
||||
};
|
||||
}
|
||||
|
||||
// Keep explicit Correspondence for Detail View if needed, or merge concepts
|
||||
export interface Correspondence {
|
||||
publicId: string; // ADR-019: exposed as 'id' in API responses
|
||||
id?: number; // Excluded from API responses (ADR-019)
|
||||
publicId: string; // ADR-019: public identifier
|
||||
correspondenceNumber: string;
|
||||
projectId: number;
|
||||
originatorId?: number;
|
||||
@@ -67,7 +62,7 @@ export interface Correspondence {
|
||||
|
||||
// Relations
|
||||
originator?: Organization;
|
||||
project?: { publicId: string; id?: number; projectName: string; projectCode: string };
|
||||
project?: { publicId: string; projectName: string; projectCode: string };
|
||||
type?: { id: number; typeName: string; typeCode: string };
|
||||
revisions?: CorrespondenceRevision[]; // Nested revisions
|
||||
recipients?: {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Entity Interfaces
|
||||
export interface DrawingRevision {
|
||||
publicId: string; // ADR-019: exposed as 'id' in API responses
|
||||
revisionId?: number; // Excluded from API responses (ADR-019)
|
||||
publicId: string; // ADR-019: public identifier
|
||||
revisionNumber: string;
|
||||
title?: string; // Added
|
||||
legacyDrawingNumber?: string; // Added
|
||||
@@ -15,8 +14,7 @@ export interface DrawingRevision {
|
||||
}
|
||||
|
||||
export interface ContractDrawing {
|
||||
publicId: string; // ADR-019: exposed as 'id' in API responses
|
||||
id?: number; // Excluded from API responses (ADR-019)
|
||||
publicId: string; // ADR-019: public identifier
|
||||
contractDrawingNo: string;
|
||||
title: string;
|
||||
projectId: number;
|
||||
@@ -28,8 +26,7 @@ export interface ContractDrawing {
|
||||
}
|
||||
|
||||
export interface ShopDrawing {
|
||||
publicId: string; // ADR-019: exposed as 'id' in API responses
|
||||
id?: number; // Excluded from API responses (ADR-019)
|
||||
publicId: string; // ADR-019: public identifier
|
||||
drawingNumber: string;
|
||||
projectId: number;
|
||||
mainCategoryId: number;
|
||||
@@ -41,8 +38,7 @@ export interface ShopDrawing {
|
||||
}
|
||||
|
||||
export interface AsBuiltDrawing {
|
||||
publicId: string; // ADR-019: exposed as 'id' in API responses
|
||||
id?: number; // Excluded from API responses (ADR-019)
|
||||
publicId: string; // ADR-019: public identifier
|
||||
drawingNumber: string;
|
||||
projectId: number;
|
||||
mainCategoryId: number;
|
||||
@@ -54,8 +50,7 @@ export interface AsBuiltDrawing {
|
||||
|
||||
// Unified Type for List
|
||||
export interface Drawing {
|
||||
publicId?: string; // ADR-019: exposed as 'id' in API responses
|
||||
drawingId?: number; // Excluded from API responses (ADR-019)
|
||||
publicId?: string; // ADR-019: public identifier
|
||||
drawingNumber: string;
|
||||
title: string; // Display title (from current revision for Shop/AsBuilt)
|
||||
discipline?: string | { disciplineCode: string; disciplineName: string };
|
||||
|
||||
@@ -17,7 +17,6 @@ export interface Discipline {
|
||||
codeNameTh?: string;
|
||||
isActive: boolean;
|
||||
contract?: {
|
||||
id?: number;
|
||||
publicId?: string;
|
||||
contractCode: string;
|
||||
contractName: string;
|
||||
@@ -33,7 +32,6 @@ export interface RfaType {
|
||||
remark?: string;
|
||||
isActive: boolean;
|
||||
contract?: {
|
||||
id?: number;
|
||||
publicId?: string;
|
||||
contractCode: string;
|
||||
contractName: string;
|
||||
|
||||
@@ -28,8 +28,7 @@ export interface RFAItem {
|
||||
}
|
||||
|
||||
export interface RFA {
|
||||
publicId: string; // ADR-019: from correspondence.publicId
|
||||
id?: number; // Excluded from API responses (ADR-019)
|
||||
publicId: string; // ADR-019: public identifier (from correspondence.publicId)
|
||||
rfaTypeId: number;
|
||||
createdBy: number;
|
||||
disciplineId?: number;
|
||||
@@ -56,8 +55,7 @@ export interface RFA {
|
||||
};
|
||||
// Shared Correspondence Relation
|
||||
correspondence?: {
|
||||
publicId: string;
|
||||
id?: number; // Excluded from API responses (ADR-019)
|
||||
publicId: string; // ADR-019: public identifier
|
||||
correspondenceNumber: string;
|
||||
projectId: number;
|
||||
originatorId?: number;
|
||||
|
||||
Reference in New Issue
Block a user