Merge branch 'dev' into freight/feat/fixes-v1

This commit is contained in:
Nathnael
2026-07-20 08:20:34 +00:00
178 changed files with 11076 additions and 3168 deletions

View File

@@ -407,6 +407,8 @@ export interface ContractClearanceView {
/** Customs risk level assigned by GL ET (import; visible to the customer). */
riskLevel?: string | null;
riskAssignedAt?: string | null;
/** Every risk decision, oldest first; the last entry is the current level. */
riskHistory?: RiskAssignmentRecord[];
/** Post-arrival additional duty/tax round (import). */
secondDuty?: ClearanceSecondDuty | null;
importReleaseGranted?: boolean;
@@ -440,9 +442,27 @@ export type MilestoneStatus = "PENDING" | "COMPLETED" | "SKIPPED";
export const CUSTOMS_RISK_LEVELS = ["GREEN", "YELLOW", "RED"] as const;
export type CustomsRiskLevel = (typeof CUSTOMS_RISK_LEVELS)[number];
/**
* One customs risk decision. The level stays correctable until duty is advised
* off it and is customer-visible, so every assignment is kept rather than
* overwritten.
*/
export interface RiskAssignmentRecord {
level: CustomsRiskLevel;
/** The level this replaced; absent on the first assignment. */
previousLevel?: CustomsRiskLevel;
assignedAt: string;
assignedByUserId?: string | null;
/** Display name resolved at assignment time, so the trail never shows a UUID. */
assignedBy?: string | null;
note?: string | null;
}
/** Structured payload carried by RISK_ASSIGNED / DUTY_TAXES_ADVISED milestones. */
export interface MilestoneMetadata {
riskLevel?: CustomsRiskLevel;
/** Every risk decision, oldest first; the last entry matches `riskLevel`. */
riskHistory?: RiskAssignmentRecord[];
dutyAmount?: number;
dutyCurrency?: string;
declarationSerial?: string;
@@ -729,14 +749,22 @@ export interface CreateContainerUnitDto {
containerNumber: string;
sealNumber?: string;
vgmTons: number;
/** Per-container handling opt-ins, entered alongside this container's VGM. */
isHazardous?: boolean;
isReefer?: boolean;
/** This container ships back empty (equipment return). */
isReturn?: boolean;
}
export interface CreateBookingContainerLineDto {
/** "20ft" | "40ft" — must be in the contract's cargo scope. */
containerSize: string;
quantity: number;
/**
* Line totals, derived from the per-unit switches above. The API recomputes
* them from `units` whenever any unit carries a flag, so they are only
* authoritative for callers that don't send per-unit flags.
*/
hazardousQuantity?: number;
reeferQuantity?: number;
/**

View File

@@ -137,6 +137,8 @@ export enum TrainStatus {
InService = "IN_SERVICE",
UnderMaintenance = "UNDER_MAINTENANCE",
OutOfService = "OUT_OF_SERVICE",
/** Parked indefinitely by staff; only allowed with no active schedule. */
Deactivated = "DEACTIVATED",
}
export enum CargoType {
@@ -779,6 +781,8 @@ export interface ClearanceView {
/** Customs risk level assigned by GL ET (import; visible to the customer). */
riskLevel?: string | null;
riskAssignedAt?: string | null;
/** Every risk decision, oldest first; the last entry is the current level. */
riskHistory?: import("./contracts").RiskAssignmentRecord[];
/** Post-arrival additional duty/tax round (import). */
secondDuty?: import("./contracts").ClearanceSecondDuty | null;
importReleaseGranted?: boolean;