mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 03:40:56 +00:00
fix(train-scheduling): marshalling doc 40ft/20ft counts were always 0
findByIdWithFullGraph loaded containerItems but not containerItems.bookingContainer, so item.bookingContainer was always undefined and the 40ft/20ft/total tallies on the Import/Export Marshalling Document silently read as 0. Load containerType on both the item and its bookingContainer, and resolve size from whichever is set.
This commit is contained in:
@@ -39,7 +39,11 @@ export class TrainSchedulesRepository extends BaseRepository<TrainSchedule> {
|
||||
physicalWagon: true,
|
||||
allocations: {
|
||||
booking: { company: true, bookingContainers: { containerType: true } },
|
||||
containerItems: true,
|
||||
// Both size sources loaded: the item's own container_type_id FK
|
||||
// (always set for a manually-entered item) and the booking-line
|
||||
// fallback via bookingContainer.containerType — the marshalling
|
||||
// document's 40ft/20ft tally reads whichever is present.
|
||||
containerItems: { containerType: true, bookingContainer: { containerType: true } },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user