mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 14:08:11 +00:00
feat: implement document clearance workflow for bookings
- Added ClearanceCard component to display and manage clearance documents in ReadonlyBookingView. - Introduced new API endpoints for clearance operations: getClearance, submitClearanceDocuments, and proceedToOperation. - Created BookingDocumentReview entity and migration for document review status tracking. - Developed GlClearancePage for Global Logistics to review and manage document submissions. - Implemented utility functions for determining clearance setting codes based on trade direction and freight type. - Added tests for booking transition clearance logic and clearance utility functions.
This commit is contained in:
@@ -448,6 +448,34 @@ export interface PricingBreakdown {
|
||||
totalAmount: number;
|
||||
}
|
||||
|
||||
// ── Document clearance (post counter-sign GL workflow) ──────────────────────
|
||||
|
||||
export type DocumentReviewStatus = "PENDING" | "APPROVED" | "QUERIED";
|
||||
|
||||
/** One row of the clearance document grid (a required doc + its file + review). */
|
||||
export interface ClearanceDocument {
|
||||
fileKey: string;
|
||||
label: string;
|
||||
required: boolean;
|
||||
/** Who supplies this document: the customer, or Global Logistics staff. */
|
||||
uploadedBy: "customer" | "gl";
|
||||
settingCode: string;
|
||||
file: { id: string; name: string; url: string } | null;
|
||||
reviewStatus: DocumentReviewStatus | null;
|
||||
note: string | null;
|
||||
}
|
||||
|
||||
/** The clearance view for a booking, driving both portals' clearance UI. */
|
||||
export interface ClearanceView {
|
||||
status: string;
|
||||
includesCustoms: boolean;
|
||||
inputCode: string | null;
|
||||
outputCode: string | null;
|
||||
documents: ClearanceDocument[];
|
||||
/** True once every required customer document is APPROVED (the 100% gate). */
|
||||
allApproved: boolean;
|
||||
}
|
||||
|
||||
export interface IInvoice extends BaseEntity {
|
||||
bookingId: string;
|
||||
invoiceNumber: string;
|
||||
|
||||
Reference in New Issue
Block a user