mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 21:08:12 +00:00
add quantity cap for GENERAL contracts and implement capacity tracking
- Updated ContractClearanceService and ContractsController to remove region parameter from queue method. - Enhanced ContractsRepository to attach contract files for download and added attachContractFiles method. - Modified ContractsService to persist cargo scope with quantity cap based on contract kind. - Introduced quantityCap field in CreateContractCargoScopeDto and ContractCargoScope entity. - Implemented capacity tracking in the frontend with ContractCapacityNotice component to display remaining bookable quantities. - Updated various components and services to support new capacity features, including hooks and API calls. - Added migration to include quantity_cap column in contract_cargo_scope table.
This commit is contained in:
@@ -31,4 +31,14 @@ export class ContractCargoScope extends BaseEntity {
|
||||
|
||||
@Column({ name: 'cargo_free_text', type: 'varchar', length: 200, nullable: true })
|
||||
cargoFreeText?: string | null;
|
||||
|
||||
/**
|
||||
* GENERAL contracts: total cargo quantity allowed across ALL shipments on this
|
||||
* scope line over the validity window. Container → number of containers of
|
||||
* this size; bulk → tons (or items for per-item commodities). Bookings draw
|
||||
* down against it until the cap is reached. NULL = uncapped (always NULL for
|
||||
* ONE_TIME, which allows a single booking).
|
||||
*/
|
||||
@Column({ name: 'quantity_cap', type: 'numeric', precision: 12, scale: 2, nullable: true })
|
||||
quantityCap?: number | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user