mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 10:58:14 +00:00
feat: Refactor general contract handling and introduce drawdown orders
- Updated ContractRouteLineView to clarify that routes carry no quantity and are pure origin-destination lanes. - Modified GeneralContractService to reflect changes in route handling, removing quantity-related logic. - Adjusted BookingsService to persist contracted routes without quantities, aligning with the new contract structure. - Revised CreateBookingDto and CreateContractRouteDto to remove quantity fields, emphasizing shared pool usage. - Added ContractOrdersPanel component to display drawdown orders and their associated pool. - Implemented useContractOrders and useContractPool hooks for fetching order and pool data. - Created booking-orders.service.ts to manage API interactions for drawdown orders and pool data. - Updated BookingRequestDetailPage and PlaceOrderDialog to accommodate new order handling logic.
This commit is contained in:
@@ -631,11 +631,15 @@ export interface CreateBookingContainerDto {
|
||||
}
|
||||
|
||||
/** A contracted route+quantity line for a GENERAL contract. */
|
||||
/**
|
||||
* A contracted route (lane) of a general contract — a pure origin→destination
|
||||
* pair. Routes carry NO quantity; the contract draws from a single shared pool.
|
||||
*/
|
||||
export interface CreateContractRouteDto {
|
||||
originYardId: string;
|
||||
destinationYardId: string;
|
||||
containerTypeId?: string | undefined;
|
||||
quantity: number;
|
||||
/** Road distance (km) for this route; used to bill road orders. */
|
||||
km?: number | undefined;
|
||||
}
|
||||
|
||||
export interface CreateBookingDto {
|
||||
@@ -728,17 +732,18 @@ export interface CreateBookingOrderLineDto {
|
||||
}
|
||||
|
||||
/** Per-route contracted / ordered / remaining pool line (multi-route contracts). */
|
||||
/**
|
||||
* A contracted route (lane) of a general contract — a pure origin→destination
|
||||
* pair the contract covers. Routes carry NO quantity; the contract draws from a
|
||||
* single shared pool ({@link ContractQuantityLine}). An order picks one lane (for
|
||||
* scheduling + road billing) and draws from that shared pool.
|
||||
*/
|
||||
export interface ContractRouteLine {
|
||||
routeLineId: string;
|
||||
originYardId: string;
|
||||
originYardName?: string | null;
|
||||
destinationYardId: string;
|
||||
destinationYardName?: string | null;
|
||||
containerTypeId?: string | null;
|
||||
containerTypeName?: string | null;
|
||||
contractedQuantity: number;
|
||||
orderedQuantity: number;
|
||||
remainingQuantity: number;
|
||||
/** Road distance (km) for this route; used to bill road orders. Null for rail-only. */
|
||||
km?: number | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user