Merge pull request #642 from Tria-plc/freight_feature/usermanagement

add wagon allocation snapshot to train schedules
This commit is contained in:
marshal
2026-07-13 11:57:24 +03:00
committed by GitHub
12 changed files with 733 additions and 171 deletions

View File

@@ -237,6 +237,42 @@ export enum WagonReadiness {
ExportReady = "EXPORT_READY",
}
/**
* Frozen record of one wagon slot's allocation at the moment a schedule leaves
* DRAFT/SCHEDULED (dispatch / arrive / cancel). Captured once into
* `train_schedules.wagon_allocation_snapshot` so the historical wagon plan
* survives later re-pinning of the same physical wagons onto other trains.
*/
export interface WagonAllocationSnapshotSlot {
sequenceNo: number;
trainSetWagonId: string;
physicalWagonId: string | null;
physicalWagonNumber: string | null;
wagonTypeId: string | null;
wagonTypeCode: string | null;
/** Wagon slot status (RESERVED/LOADED/…) at capture time. */
slotStatus: string | null;
boardYardId: string | null;
alightYardId: string | null;
allocations: WagonAllocationSnapshotAllocation[];
}
export interface WagonAllocationSnapshotAllocation {
bookingId: string;
bookingReference: string | null;
allocatedWeightTons: number;
loadType: string | null;
containerNumbers: string[];
}
/** Whole-schedule frozen wagon plan written at a terminal/transit transition. */
export interface WagonAllocationSnapshot {
/** Schedule status the snapshot was captured at (DISPATCHED/ARRIVED/CANCELLED). */
capturedStatus: string;
capturedAt: string;
slots: WagonAllocationSnapshotSlot[];
}
export type ScheduleTradeDirection = "IMPORT" | "EXPORT" | "DOMESTIC";
/**