mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 14:08:11 +00:00
add items per wagon map to cargo types and sync bulk rate units
- Implemented in the to manage the physical item capacity for each wagon type. - Added a new migration to create the column in the table. - Introduced method in to update rate units when cargo type unit of measure changes. - Updated booking calculations to consider items per wagon for break-bulk cargo. - Refactored various components to utilize the new items fit logic and ensure consistent date formatting across the application. - Added tests for the new display timezone functionality to ensure consistent date/time representation across different user settings.
This commit is contained in:
@@ -50,6 +50,16 @@ export class CargoType extends BaseEntity {
|
||||
})
|
||||
wagonTypes?: WagonType[];
|
||||
|
||||
/**
|
||||
* PER_ITEM (break-bulk) only: how many whole items physically fit each
|
||||
* allowed wagon type, keyed by wagon-type id (e.g. cars → { NW5: 4, NW7: 6 }).
|
||||
* Allocation loads min(this fit, floor(capacityTons / perItemTons)) per
|
||||
* wagon — floor space and rated tonnage bind independently. Keys are kept a
|
||||
* subset of the wagonTypes join rows by the cargo-types service.
|
||||
*/
|
||||
@Column({ name: 'items_per_wagon_map', type: 'jsonb', nullable: true })
|
||||
itemsPerWagonMap?: Record<string, number> | null;
|
||||
|
||||
@Column({ name: 'requires_director_approval', type: 'boolean', default: false })
|
||||
requiresDirectorApproval!: boolean;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user