251205:0000 Just start debug backend/frontend
This commit is contained in:
43
frontend/types/admin.ts
Normal file
43
frontend/types/admin.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
export interface Role {
|
||||
role_id: number;
|
||||
role_name: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
user_id: number;
|
||||
username: string;
|
||||
email: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
is_active: boolean;
|
||||
roles: Role[];
|
||||
}
|
||||
|
||||
export interface CreateUserDto {
|
||||
username: string;
|
||||
email: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
password?: string;
|
||||
is_active: boolean;
|
||||
roles: number[];
|
||||
}
|
||||
|
||||
export interface Organization {
|
||||
org_id: number;
|
||||
org_code: string;
|
||||
org_name: string;
|
||||
org_name_th?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface AuditLog {
|
||||
audit_log_id: number;
|
||||
user_name: string;
|
||||
action: string;
|
||||
entity_type: string;
|
||||
description: string;
|
||||
ip_address?: string;
|
||||
created_at: string;
|
||||
}
|
||||
32
frontend/types/correspondence.ts
Normal file
32
frontend/types/correspondence.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
export interface Organization {
|
||||
id: number;
|
||||
org_name: string;
|
||||
org_code: string;
|
||||
}
|
||||
|
||||
export interface Correspondence {
|
||||
correspondence_id: number;
|
||||
document_number: string;
|
||||
subject: string;
|
||||
description?: string;
|
||||
status: "DRAFT" | "PENDING" | "IN_REVIEW" | "APPROVED" | "REJECTED" | "CLOSED";
|
||||
importance: "NORMAL" | "HIGH" | "URGENT";
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
from_organization_id: number;
|
||||
to_organization_id: number;
|
||||
from_organization?: Organization;
|
||||
to_organization?: Organization;
|
||||
document_type_id: number;
|
||||
attachments?: any[]; // Define Attachment type if needed
|
||||
}
|
||||
|
||||
export interface CreateCorrespondenceDto {
|
||||
subject: string;
|
||||
description?: string;
|
||||
document_type_id: number;
|
||||
from_organization_id: number;
|
||||
to_organization_id: number;
|
||||
importance: "NORMAL" | "HIGH" | "URGENT";
|
||||
attachments?: File[];
|
||||
}
|
||||
28
frontend/types/dashboard.ts
Normal file
28
frontend/types/dashboard.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
export interface DashboardStats {
|
||||
correspondences: number;
|
||||
rfas: number;
|
||||
approved: number;
|
||||
pending: number;
|
||||
}
|
||||
|
||||
export interface ActivityLog {
|
||||
id: number;
|
||||
user: {
|
||||
name: string;
|
||||
initials: string;
|
||||
avatar?: string;
|
||||
};
|
||||
action: string;
|
||||
description: string;
|
||||
createdAt: string;
|
||||
targetUrl: string;
|
||||
}
|
||||
|
||||
export interface PendingTask {
|
||||
id: number;
|
||||
title: string;
|
||||
description: string;
|
||||
daysOverdue: number;
|
||||
url: string;
|
||||
priority: "HIGH" | "MEDIUM" | "LOW";
|
||||
}
|
||||
34
frontend/types/drawing.ts
Normal file
34
frontend/types/drawing.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
export interface DrawingRevision {
|
||||
revision_id: number;
|
||||
revision_number: string;
|
||||
revision_date: string;
|
||||
revision_description?: string;
|
||||
revised_by_name: string;
|
||||
file_url: string;
|
||||
is_current: boolean;
|
||||
}
|
||||
|
||||
export interface Drawing {
|
||||
drawing_id: number;
|
||||
drawing_number: string;
|
||||
title: string;
|
||||
type: "CONTRACT" | "SHOP";
|
||||
discipline_id: number;
|
||||
discipline?: { id: number; discipline_code: string; discipline_name: string };
|
||||
sheet_number: string;
|
||||
scale?: string;
|
||||
current_revision: string;
|
||||
issue_date: string;
|
||||
revision_count: number;
|
||||
revisions?: DrawingRevision[];
|
||||
}
|
||||
|
||||
export interface CreateDrawingDto {
|
||||
drawing_type: "CONTRACT" | "SHOP";
|
||||
drawing_number: string;
|
||||
title: string;
|
||||
discipline_id: number;
|
||||
sheet_number: string;
|
||||
scale?: string;
|
||||
file: File;
|
||||
}
|
||||
14
frontend/types/notification.ts
Normal file
14
frontend/types/notification.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export interface Notification {
|
||||
notification_id: number;
|
||||
title: string;
|
||||
message: string;
|
||||
type: "INFO" | "SUCCESS" | "WARNING" | "ERROR";
|
||||
is_read: boolean;
|
||||
created_at: string;
|
||||
link?: string;
|
||||
}
|
||||
|
||||
export interface NotificationResponse {
|
||||
items: Notification[];
|
||||
unreadCount: number;
|
||||
}
|
||||
37
frontend/types/numbering.ts
Normal file
37
frontend/types/numbering.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
export interface NumberingTemplate {
|
||||
template_id: number;
|
||||
document_type_id: string;
|
||||
document_type_name: string;
|
||||
discipline_code?: string;
|
||||
template_format: string;
|
||||
example_number: string;
|
||||
current_number: number;
|
||||
reset_annually: boolean;
|
||||
padding_length: number;
|
||||
is_active: boolean;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface NumberingSequence {
|
||||
sequence_id: number;
|
||||
template_id: number;
|
||||
year: number;
|
||||
organization_code?: string;
|
||||
discipline_code?: string;
|
||||
current_number: number;
|
||||
last_generated_number: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface CreateTemplateDto {
|
||||
document_type_id: string;
|
||||
discipline_code?: string;
|
||||
template_format: string;
|
||||
reset_annually: boolean;
|
||||
padding_length: number;
|
||||
starting_number: number;
|
||||
}
|
||||
|
||||
export interface TestGenerationResult {
|
||||
number: string;
|
||||
}
|
||||
32
frontend/types/rfa.ts
Normal file
32
frontend/types/rfa.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
export interface RFAItem {
|
||||
id?: number;
|
||||
item_no: string;
|
||||
description: string;
|
||||
quantity: number;
|
||||
unit: string;
|
||||
status?: "PENDING" | "APPROVED" | "REJECTED";
|
||||
}
|
||||
|
||||
export interface RFA {
|
||||
rfa_id: number;
|
||||
rfa_number: string;
|
||||
subject: string;
|
||||
description?: string;
|
||||
contract_id: number;
|
||||
discipline_id: number;
|
||||
status: "DRAFT" | "PENDING" | "IN_REVIEW" | "APPROVED" | "REJECTED" | "CLOSED";
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
items: RFAItem[];
|
||||
// Mock fields for display
|
||||
contract_name?: string;
|
||||
discipline_name?: string;
|
||||
}
|
||||
|
||||
export interface CreateRFADto {
|
||||
subject: string;
|
||||
description?: string;
|
||||
contract_id: number;
|
||||
discipline_id: number;
|
||||
items: RFAItem[];
|
||||
}
|
||||
18
frontend/types/search.ts
Normal file
18
frontend/types/search.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export interface SearchResult {
|
||||
id: number;
|
||||
type: "correspondence" | "rfa" | "drawing";
|
||||
title: string;
|
||||
description?: string;
|
||||
status: string;
|
||||
documentNumber: string;
|
||||
createdAt: string;
|
||||
highlight?: string;
|
||||
}
|
||||
|
||||
export interface SearchFilters {
|
||||
query?: string;
|
||||
types?: string[];
|
||||
statuses?: string[];
|
||||
dateFrom?: Date;
|
||||
dateTo?: Date;
|
||||
}
|
||||
35
frontend/types/workflow.ts
Normal file
35
frontend/types/workflow.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export type WorkflowType = "CORRESPONDENCE" | "RFA" | "DRAWING";
|
||||
|
||||
export interface WorkflowStep {
|
||||
step_id?: string;
|
||||
step_name: string;
|
||||
step_type: "APPROVAL" | "REVIEW" | "ENDORSEMENT";
|
||||
approver_role_id?: number;
|
||||
approver_role_name?: string;
|
||||
next_step_success?: string;
|
||||
next_step_failure?: string;
|
||||
}
|
||||
|
||||
export interface Workflow {
|
||||
workflow_id: number;
|
||||
workflow_name: string;
|
||||
description: string;
|
||||
workflow_type: WorkflowType;
|
||||
version: number;
|
||||
is_active: boolean;
|
||||
dsl_definition: string;
|
||||
step_count: number;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface CreateWorkflowDto {
|
||||
workflow_name: string;
|
||||
description: string;
|
||||
workflow_type: WorkflowType;
|
||||
dsl_definition: string;
|
||||
}
|
||||
|
||||
export interface ValidationResult {
|
||||
valid: boolean;
|
||||
errors: string[];
|
||||
}
|
||||
Reference in New Issue
Block a user