This commit is contained in:
Marshal
2026-07-07 12:28:47 +00:00
parent 1c18fdbd52
commit f300600bfa
63 changed files with 2587 additions and 428 deletions

View File

@@ -87,6 +87,8 @@ export enum BookingStatus {
Expired = "EXPIRED",
Paid = "PAID",
InTransit = "IN_TRANSIT",
/** Unloaded at the booking's own destination yard (may precede the train's final arrival). */
Arrived = "ARRIVED",
Completed = "COMPLETED",
Delivered = "DELIVERED",
Rejected = "REJECTED",
@@ -255,6 +257,28 @@ export interface ITrainCheckpointEvent extends BaseEntity {
recordedByUserId?: string | null;
}
/** Why a physical wagon moved between yards — the wagon_movements ledger kind. */
export enum WagonMovementKind {
/** Carried a booking's cargo for its leg (board yard → alight yard). */
Loaded = "LOADED",
/** Rode a train empty to reposition for later use. */
EmptyReposition = "EMPTY_REPOSITION",
/** Staff manually corrected/updated the wagon's yard. */
Manual = "MANUAL",
}
export interface IWagonMovement extends BaseEntity {
wagonId: string;
fromYardId?: string | null;
toYardId: string;
trainScheduleId?: string | null;
bookingId?: string | null;
kind: WagonMovementKind;
movedByUserId?: string | null;
occurredAt: string;
note?: string | null;
}
export enum BulkPricingUnit {
PerWagon = "PER_WAGON",
PerTon = "PER_TON",
@@ -393,12 +417,22 @@ export interface IBookingTracking {
/** Planned departure/arrival from the schedule, used as ETA hints. */
scheduledDepartureAt: string | null;
scheduledArrivalAt: string | null;
// ── Per-booking journey (segment corridor bookings) ─────────────────────
/** The booking's own status — the journey is per booking, not per train. */
bookingStatus?: string | null;
/** The leg this booking rides: its own origin/destination yards. */
bookingOriginYardId?: string | null;
bookingDestinationYardId?: string | null;
/** Operator-confirmed load at the booking's origin yard (per-booking dispatch). */
loadedAt?: string | null;
/** Operator-confirmed unload at the booking's destination yard (per-booking arrival). */
arrivedAt?: string | null;
}
export interface IYard extends BaseEntity {
code: string;
label: string;
country: string;
country: `${YardCountry}`;
isActive: boolean;
displayOrder: number;
}