Enhance clearance milestone management and introduce new contract actions

- Added new milestones for 'Transit Permit Uploaded' and 'Export Transport Document Issued' in the clearance milestone catalog.
- Implemented methods in ClearanceMilestoneService to skip milestones and complete them with metadata.
- Updated ContractBookingService to check boundary conditions before booking creation.
- Introduced new endpoints in ContractsController for uploading customs declarations, advising duty, and handling various document uploads.
- Enhanced the UI to support new clearance actions and display relevant components based on milestone statuses.
This commit is contained in:
marshal
2026-07-01 10:20:16 +03:00
parent ccd5d6de31
commit 612df8daff
36 changed files with 3018 additions and 57 deletions

View File

@@ -259,6 +259,27 @@ export interface ContractClearanceView {
documents: ContractClearanceDocument[];
/** True once every required customer document is APPROVED. */
allApproved: boolean;
/** Current phased clearance step (ONE_TIME customs). */
phase?: ContractDocPhase | null;
/** Pre-booking milestone rows for this contract cycle. */
milestones?: IClearanceMilestone[];
/** What should happen next in the workflow. */
nextAction?: ClearanceNextAction | null;
dutyRequired?: boolean | null;
roHold?: boolean;
roHoldReason?: string | null;
vesselDepartureDate?: string | null;
roAmendmentRequestedAt?: string | null;
bookingReady?: boolean;
}
export type ClearanceActorRole = "CUSTOMER" | "GL_ET" | "GL_DJ" | "OPERATIONS";
export interface ClearanceNextAction {
actor: ClearanceActorRole;
action: string;
milestoneCode?: string | null;
blockedReason?: string | null;
}
/** Phased clearance document upload slots (doc §5.13). */
@@ -334,6 +355,7 @@ export const IMPORT_MILESTONES = [
"DECLARED",
"DUTY_TAXES_ADVISED",
"DUTY_TAX_PAID",
"TRANSIT_PERMIT_UPLOADED",
"DO_COLLECTED",
"WAGON_REQUESTED",
"FREIGHT_PAYMENT_SETTLED",
@@ -366,6 +388,7 @@ export const EXPORT_MILESTONES = [
"FREIGHT_PAYMENT_PENDING",
"FREIGHT_PAYMENT_SETTLED",
"WAGON_ALLOCATED",
"EXPORT_TRANSPORT_ISSUED",
"CARGO_ARRIVED",
"READY_FOR_LOADING",
"LOADED",