Files
edr-platform/apps/edr-freight-api/src/modules/booking-orders/dto/contract-view.dto.ts
Marshal 861b8dc38a 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.
2026-06-25 07:06:48 +00:00

51 lines
1.5 KiB
TypeScript

import { ApiProperty } from '@nestjs/swagger';
import { CargoUnitOfMeasure } from '@edr/types';
/** A single contracted/ordered/remaining pool line for a general contract. */
export class ContractQuantityLineView {
@ApiProperty({ nullable: true, description: 'Container type id (null for bulk/break-bulk)' })
containerTypeId!: string | null;
@ApiProperty({ nullable: true })
containerTypeName!: string | null;
@ApiProperty({ enum: CargoUnitOfMeasure, nullable: true })
unitOfMeasure!: CargoUnitOfMeasure | null;
@ApiProperty()
contractedQuantity!: number;
@ApiProperty()
orderedQuantity!: number;
@ApiProperty()
remainingQuantity!: number;
}
/**
* A contracted route (lane) of a general contract. Routes are pure
* origin→destination lanes the contract covers; they carry NO quantity. The
* contract has a single shared drawdown pool (see {@link ContractQuantityLineView}),
* and an order picks one lane (for scheduling/billing) while drawing from that
* shared pool.
*/
export class ContractRouteLineView {
@ApiProperty({ description: 'Contract route line id' })
routeLineId!: string;
@ApiProperty()
originYardId!: string;
@ApiProperty({ nullable: true })
originYardName!: string | null;
@ApiProperty()
destinationYardId!: string;
@ApiProperty({ nullable: true })
destinationYardName!: string | null;
@ApiProperty({ nullable: true, description: 'Road distance (km); used to bill road orders' })
km!: number | null;
}