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:
Marshal
2026-06-23 21:33:34 +00:00
parent 29f6928059
commit 6485cbdd71
24 changed files with 1924 additions and 6 deletions

View File

@@ -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;