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:
Marshal
2026-06-28 17:32:18 +00:00
parent e1d54746c2
commit 11c7f1bb74
27 changed files with 512 additions and 74 deletions

View File

@@ -51,6 +51,17 @@ export class CreateContractCargoScopeDto {
@IsString()
@MaxLength(200)
cargoFreeText?: string | null;
@ApiPropertyOptional({
description:
'GENERAL only: total bookable quantity for this line (containers per size, or tons/items for bulk). Omit for uncapped.',
minimum: 1,
})
@IsOptional()
@IsNumber()
@Min(1)
@Transform(({ value }) => (value == null || value === '' ? null : Number(value)))
quantityCap?: number | null;
}
/** A contracted lane (origin → destination). Routes carry NO quantity. */