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:
Marshal
2026-06-25 07:06:48 +00:00
parent dd352f0340
commit 861b8dc38a
16 changed files with 582 additions and 295 deletions

View File

@@ -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;
}