mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
End-to-end testing of the direct truck-to-train flow surfaced two defects in the carriage acceptance sheet's no-wagon fallback. Container numbers were read from freight.containers, which only gains rows at allocation, so a direct booking's declared containers never appeared; they are read from booking_container_units now, seal numbers included. The weight used bulkTotalWeightTons alone, which is null for CONTAINER and PER_TON bulk bookings, printing 0.00 — cargoTotalWeightVgm is the real weight there and only holds an item count for PER_ITEM break-bulk. Separately, warehouse cargo can be loaded from the Load-to-Train queue or from the schedule, but loading from the schedule never advanced warehouse_inventory. The booking went IN_TRANSIT while its cargo still read as sitting in the warehouse — the same inconsistency that produced the spurious dispatch block. loadBooking now moves the inventory to LOADED in the same transaction, and no-ops for direct bookings.