251209:1453 Frontend: progress nest = UAT & Bug Fixing
This commit is contained in:
111
frontend/types/circulation.ts
Normal file
111
frontend/types/circulation.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
// File: types/circulation.ts
|
||||
// TypeScript interfaces for Circulation module - aligned with backend entities
|
||||
|
||||
/**
|
||||
* Circulation routing status enum
|
||||
*/
|
||||
export type CirculationRoutingStatus = 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'REJECTED';
|
||||
|
||||
/**
|
||||
* Circulation routing (assignee task within a circulation)
|
||||
*/
|
||||
export interface CirculationRouting {
|
||||
id: number;
|
||||
circulationId: number;
|
||||
stepNumber: number;
|
||||
organizationId: number;
|
||||
assignedTo?: number;
|
||||
status: CirculationRoutingStatus;
|
||||
comments?: string;
|
||||
completedAt?: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
// Joined relations from API
|
||||
assignee?: {
|
||||
user_id: number;
|
||||
username: string;
|
||||
first_name?: string;
|
||||
last_name?: string;
|
||||
};
|
||||
organization?: {
|
||||
id: number;
|
||||
organization_code: string;
|
||||
organization_name: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Circulation entity
|
||||
*/
|
||||
export interface Circulation {
|
||||
id: number;
|
||||
correspondenceId?: number;
|
||||
organizationId: number;
|
||||
circulationNo: string;
|
||||
subject: string;
|
||||
statusCode: string;
|
||||
createdByUserId: number;
|
||||
submittedAt?: string;
|
||||
closedAt?: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
// Joined relations from API
|
||||
routings?: CirculationRouting[];
|
||||
correspondence?: {
|
||||
id: number;
|
||||
correspondence_number: string;
|
||||
};
|
||||
organization?: {
|
||||
id: number;
|
||||
organization_code: string;
|
||||
organization_name: string;
|
||||
};
|
||||
creator?: {
|
||||
user_id: number;
|
||||
username: string;
|
||||
first_name?: string;
|
||||
last_name?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Paginated response for circulation list
|
||||
*/
|
||||
export interface CirculationListResponse {
|
||||
data: Circulation[];
|
||||
meta: {
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
totalPages: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* DTO for creating a circulation
|
||||
*/
|
||||
export interface CreateCirculationDto {
|
||||
correspondenceId: number;
|
||||
projectId?: number;
|
||||
subject: string;
|
||||
assigneeIds: number[];
|
||||
remarks?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* DTO for search/filter params
|
||||
*/
|
||||
export interface SearchCirculationDto {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
status?: string;
|
||||
search?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* DTO for updating routing status
|
||||
*/
|
||||
export interface UpdateCirculationRoutingDto {
|
||||
status: CirculationRoutingStatus;
|
||||
comments?: string;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// File: src/types/dto/correspondence/submit-correspondence.dto.ts
|
||||
|
||||
export interface SubmitCorrespondenceDto {
|
||||
/** ID ของ Routing Template ที่เลือกใช้ในการเดินเอกสาร */
|
||||
templateId: number;
|
||||
}
|
||||
/** Optional note when submitting to workflow */
|
||||
note?: string;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,13 @@ export interface CreateTransmittalDto {
|
||||
remarks?: string;
|
||||
|
||||
/** ID ของเอกสาร (Correspondence IDs) ที่จะแนบไปใน Transmittal นี้ */
|
||||
itemIds: number[];
|
||||
items: CreateTransmittalItemDto[];
|
||||
}
|
||||
|
||||
export interface CreateTransmittalItemDto {
|
||||
itemType: string;
|
||||
itemId: number;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
// --- Update (Partial) ---
|
||||
@@ -40,4 +46,4 @@ export interface SearchTransmittalDto {
|
||||
|
||||
/** จำนวนต่อหน้า (Default: 20) */
|
||||
pageSize?: number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
export interface Organization {
|
||||
organization_id: number;
|
||||
org_code: string;
|
||||
org_name: string;
|
||||
org_name_th: string;
|
||||
id: number;
|
||||
organizationCode: string;
|
||||
organizationName: string;
|
||||
organizationNameTh?: string; // Optional if not present in backend entity
|
||||
description?: string;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
isActive: boolean;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
|
||||
// Keep legacy types optional for backward compatibility if needed, or remove them
|
||||
organization_id?: number;
|
||||
org_code?: string;
|
||||
org_name?: string;
|
||||
org_name_th?: string;
|
||||
}
|
||||
|
||||
88
frontend/types/transmittal.ts
Normal file
88
frontend/types/transmittal.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
// File: types/transmittal.ts
|
||||
// TypeScript interfaces for Transmittal module - aligned with backend entities
|
||||
|
||||
/**
|
||||
* Transmittal purpose enum
|
||||
*/
|
||||
export type TransmittalPurpose = 'FOR_APPROVAL' | 'FOR_INFORMATION' | 'FOR_REVIEW' | 'OTHER';
|
||||
|
||||
/**
|
||||
* Item type in a transmittal
|
||||
*/
|
||||
export type TransmittalItemType = 'DRAWING' | 'RFA' | 'CORRESPONDENCE';
|
||||
|
||||
/**
|
||||
* Transmittal item - document included in a transmittal
|
||||
*/
|
||||
export interface TransmittalItem {
|
||||
transmittalId: number;
|
||||
itemType: TransmittalItemType;
|
||||
itemId: number;
|
||||
description?: string;
|
||||
// Joined data for display
|
||||
documentNumber?: string;
|
||||
documentTitle?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Transmittal entity
|
||||
*/
|
||||
export interface Transmittal {
|
||||
id: number;
|
||||
correspondenceId: number;
|
||||
transmittalNo: string;
|
||||
subject: string;
|
||||
purpose?: TransmittalPurpose;
|
||||
remarks?: string;
|
||||
createdAt: string;
|
||||
// Joined relations from API
|
||||
items?: TransmittalItem[];
|
||||
correspondence?: {
|
||||
id: number;
|
||||
correspondence_number: string;
|
||||
project_id: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Paginated response for transmittal list
|
||||
*/
|
||||
export interface TransmittalListResponse {
|
||||
data: Transmittal[];
|
||||
meta: {
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
totalPages: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Item DTO for creating transmittal
|
||||
*/
|
||||
export interface CreateTransmittalItemDto {
|
||||
itemType: TransmittalItemType;
|
||||
itemId: number;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* DTO for creating a transmittal
|
||||
*/
|
||||
export interface CreateTransmittalDto {
|
||||
correspondenceId: number;
|
||||
subject: string;
|
||||
purpose?: TransmittalPurpose;
|
||||
remarks?: string;
|
||||
items: CreateTransmittalItemDto[];
|
||||
}
|
||||
|
||||
/**
|
||||
* DTO for search/filter params
|
||||
*/
|
||||
export interface SearchTransmittalDto {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
projectId?: number;
|
||||
search?: string;
|
||||
}
|
||||
48
frontend/types/user.ts
Normal file
48
frontend/types/user.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
export interface Role {
|
||||
roleId: number;
|
||||
roleName: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface UserOrganization {
|
||||
organization_id: number;
|
||||
org_code: string;
|
||||
org_name: string;
|
||||
org_name_th?: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
user_id: number;
|
||||
username: string;
|
||||
email: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
is_active: boolean;
|
||||
line_id?: string;
|
||||
primary_organization_id?: number;
|
||||
organization?: UserOrganization;
|
||||
roles?: Role[];
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
export interface CreateUserDto {
|
||||
username: string;
|
||||
email: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
password?: string;
|
||||
is_active: boolean;
|
||||
line_id?: string;
|
||||
primary_organization_id?: number;
|
||||
role_ids: number[];
|
||||
}
|
||||
|
||||
export interface UpdateUserDto extends Partial<CreateUserDto> {}
|
||||
|
||||
export interface SearchUserDto {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
search?: string;
|
||||
role_id?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user