Files
edr-platform/apps/edr-freight-api/src
Hagernesh a26fa61d66 feat(warehouse): require a GRN before export cargo can be loaded onto a train
The export chain is: paid -> received into the warehouse -> GRN raised on arrival
-> loaded onto the allocated wagon. Receipt was already structural (the inventory
row only exists once receive() runs) and the wagon was already required, but the
GRN was merely displayed, never enforced — so cargo could be loaded and
dispatched without one.

- loadable now also requires a GRN, so the queue won't offer un-GRN'd cargo.
- loadItemsOntoTrain skips items with no GRN, so the rule holds server-side and
  a hand-made API call can't bypass it.
- Read the GRN from inv.grn_number (what receive() stamps) and fall back to the
  note only for legacy/seeded rows; it previously read the note alone, which the
  real receive path merely mirrors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 08:01:57 +00:00
..
2026-07-15 13:29:01 +00:00
2026-07-16 07:43:54 +00:00
2026-07-14 13:11:38 +00:00
2026-07-03 17:21:26 +03:00
2026-07-03 09:32:41 +00:00