Merge branch 'dev' of https://github.com/Tria-plc/edr-platform into feature/group-booking

This commit is contained in:
Roba Boru
2026-08-27 22:55:42 +03:00
212 changed files with 10522 additions and 1589 deletions

View File

@@ -1018,8 +1018,18 @@ export interface CreateBookingUnderContractDto {
equipmentReturn?: string;
containers?: CreateBookingContainerLineDto[];
bulkLines?: CreateBulkLineDto[];
/**
* NUMBER_OF_WAGONS bulk cargo only: how many wagons the shipment needs. The
* weight spreads evenly across them; a PER_WAGON rate bills this count.
* Required when the cargo type is measured by wagons, ignored otherwise.
*/
requestedWagons?: number;
/** What the containers carry — captured per booking (container freight). */
cargoFreeText?: string;
/** Customer's own clearing agent — required at completion of a without-customs import/export booking. */
customsClearingAgent?: string;
customsClearingAgentEmail?: string;
customsClearingAgentPhone?: string;
notes?: string;
}

View File

@@ -76,9 +76,14 @@ export interface ETradeBusinessOption {
export interface CompanyRegistrationData {
/**
* The registered organization name — `ETradeCompanyInfo.BusinessName`, falling
* back to the licence's `TradeName`. Never the manager/owner's personal name;
* that is {@link managerName}.
* The selected licence's trade name — `ETradeBusinessInfo.TradeName`, falling
* back to the registered organization name (`ETradeCompanyInfo.BusinessName`)
* when eTrade leaves the licence's trade name blank. Never the manager/owner's
* personal name; that is {@link managerName}.
*
* NOT the legal entity name: a TIN often trades under a different name, and
* some hold several licences with different trade names. Anything that needs
* the registered name (tax/EIMS) must read `BusinessName` directly.
*/
companyName: string;
licenceNumber: string;

View File

@@ -73,6 +73,13 @@ export enum BookingType {
export enum CargoUnitOfMeasure {
PerTon = "PER_TON",
PerItem = "PER_ITEM",
/**
* Wagon-request cargo: the customer states the wagon count the shipment
* needs alongside its weight (and an optional item count). Allocation uses
* the requested count verbatim, spreading the weight evenly; a PER_WAGON
* rate bills that count, a PER_TON rate bills the weight.
*/
NumberOfWagons = "NUMBER_OF_WAGONS",
}
export enum BookingStatus {
@@ -215,6 +222,13 @@ export enum SchedulingStatus {
Dispatched = "DISPATCHED",
/** Paid, but no wagon of the required type was free — held in the day pool for manual placement. */
WaitingForWagon = "WAITING_FOR_WAGON",
/**
* Staff removed this paid booking from a train (unchecked at dispatch, or
* unassigned from the schedule). Auto-allocation sweeps must skip it — it
* would silently retake the space it was pulled from. Only a manual staff
* assignment puts it back on a train (which resets it to SCHEDULED).
*/
ManualOnly = "MANUAL_ONLY",
}
export enum TrainScheduleStatus {
@@ -314,12 +328,32 @@ export interface WagonAllocationSnapshotAllocation {
containerNumbers: string[];
}
/**
* Coupled-but-empty consist wagon captured with the frozen plan. The physical
* wagons are released and re-pinned to later trains after dispatch/arrival, so
* this snapshot is the only record of which empties rode THIS departure.
*/
export interface WagonAllocationSnapshotEmptyWagon {
physicalWagonId: string;
physicalWagonNumber: string | null;
/** Real coupling position on the built train at capture time. */
sequenceNo: number;
wagonTypeId: string | null;
wagonTypeCode: string | null;
wagonTypeName: string | null;
capacityTons: number;
tareWeightTons: number | null;
lengthMeters: number;
}
/** 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[];
/** Absent on snapshots captured before empties were recorded. */
emptyConsistWagons?: WagonAllocationSnapshotEmptyWagon[];
}
export type ScheduleTradeDirection = "IMPORT" | "EXPORT" | "DOMESTIC";
@@ -709,6 +743,8 @@ export interface IBooking extends BaseEntity {
// (multi-truck self-haul lives in ICustomerTruck[], fetched via the
// /customer-trucks endpoint; the fields above are the booking-level flag.)
customsClearingAgent?: string | null;
customsClearingAgentEmail?: string | null;
customsClearingAgentPhone?: string | null;
equipmentReturn: "WITH_RETURN" | "WITHOUT_RETURN";
originYard?: IYard | null;