251211:1622 Frontend: refactor Dashboard (not finish)
This commit is contained in:
@@ -13,21 +13,51 @@ export interface Attachment {
|
||||
createdAt?: string;
|
||||
}
|
||||
|
||||
export interface Correspondence {
|
||||
correspondenceId: number;
|
||||
documentNumber: string;
|
||||
subject: string;
|
||||
// Used in List View mainly
|
||||
export interface CorrespondenceRevision {
|
||||
id: number;
|
||||
revisionNumber: number;
|
||||
revisionLabel?: string; // e.g. "A", "00"
|
||||
title: string;
|
||||
description?: string;
|
||||
status: "DRAFT" | "PENDING" | "IN_REVIEW" | "APPROVED" | "REJECTED" | "CLOSED";
|
||||
importance: "NORMAL" | "HIGH" | "URGENT";
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
fromOrganizationId: number;
|
||||
toOrganizationId: number;
|
||||
fromOrganization?: Organization;
|
||||
toOrganization?: Organization;
|
||||
documentTypeId: number;
|
||||
isCurrent: boolean;
|
||||
status?: {
|
||||
id: number;
|
||||
statusCode: string;
|
||||
statusName: string;
|
||||
};
|
||||
details?: any;
|
||||
attachments?: Attachment[];
|
||||
createdAt: string;
|
||||
|
||||
// Nested Relation from Backend Refactor
|
||||
correspondence: {
|
||||
id: number;
|
||||
correspondenceNumber: string;
|
||||
projectId: number;
|
||||
originatorId?: number;
|
||||
isInternal: boolean;
|
||||
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
|
||||
export interface Correspondence {
|
||||
id: number;
|
||||
correspondenceNumber: string;
|
||||
projectId: number;
|
||||
originatorId?: number;
|
||||
correspondenceTypeId: number;
|
||||
isInternal: boolean;
|
||||
createdAt: string;
|
||||
|
||||
// Relations
|
||||
originator?: Organization;
|
||||
project?: { id: number; projectName: string; projectCode: string };
|
||||
type?: { id: number; typeName: string; typeCode: string };
|
||||
revisions?: CorrespondenceRevision[]; // Nested revisions
|
||||
}
|
||||
|
||||
export interface CreateCorrespondenceDto {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
export interface DashboardStats {
|
||||
correspondences: number;
|
||||
rfas: number;
|
||||
totalDocuments: number;
|
||||
documentsThisMonth: number;
|
||||
pendingApprovals: number;
|
||||
approved: number;
|
||||
pending: number;
|
||||
totalRfas: number;
|
||||
totalCirculations: number;
|
||||
}
|
||||
|
||||
export interface ActivityLog {
|
||||
|
||||
@@ -5,8 +5,9 @@ export interface SearchCorrespondenceDto {
|
||||
typeId?: number; // กรองตามประเภทเอกสาร
|
||||
projectId?: number; // กรองตามโครงการ
|
||||
statusId?: number; // กรองตามสถานะ (จาก Revision ปัจจุบัน)
|
||||
|
||||
revisionStatus?: 'CURRENT' | 'ALL' | 'OLD'; // กรองตามสถานะ Revision
|
||||
|
||||
// เพิ่มเติมสำหรับการแบ่งหน้า (Pagination)
|
||||
page?: number;
|
||||
limit?: number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,4 +52,7 @@ export interface SearchRfaDto {
|
||||
|
||||
/** จำนวนต่อหน้า (Default: 20) */
|
||||
pageSize?: number;
|
||||
|
||||
/** Revision Status Filter */
|
||||
revisionStatus?: 'CURRENT' | 'ALL' | 'OLD';
|
||||
}
|
||||
|
||||
@@ -8,17 +8,28 @@ export interface RFAItem {
|
||||
}
|
||||
|
||||
export interface RFA {
|
||||
rfaId: number;
|
||||
rfaNumber: string;
|
||||
subject: string;
|
||||
description?: string;
|
||||
contractId: number;
|
||||
disciplineId: number;
|
||||
status: "DRAFT" | "PENDING" | "IN_REVIEW" | "APPROVED" | "REJECTED" | "CLOSED";
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
items: RFAItem[];
|
||||
// Mock fields for display
|
||||
id: number;
|
||||
rfaTypeId: number;
|
||||
createdBy: number;
|
||||
disciplineId?: number;
|
||||
revisions: {
|
||||
items?: {
|
||||
shopDrawingRevision?: {
|
||||
attachments?: { id: number; url: string; name: string }[]
|
||||
}
|
||||
}[];
|
||||
}[];
|
||||
discipline?: {
|
||||
id: number;
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user