mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
fix(warehouses): Store no longer strands an import item in STORED
READY_FOR_PICKUP allows STORED (park an import item back into storage), but STORED allowed only RESERVED / READY_FOR_LOADING - so readyForPickup() hit assertTransition(STORED, READY_FOR_PICKUP) and threw. The item could never return to pickup, and getNextInventoryAction returned null for an import STORED item, leaving the row with no action at all. - allow STORED -> READY_FOR_PICKUP - an inspected import STORED item now advances to ready-for-pickup readyForPickup() still rejects non-IMPORT inventory, so the new edge cannot be reached from the export flow. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,9 @@ export const WAREHOUSE_INVENTORY_TRANSITIONS: Record<WarehouseInventoryStatus, W
|
||||
RECEIVED: ['STORED', 'READY_FOR_PICKUP'],
|
||||
// Reserve is retired from the operator flow — a stored export item advances
|
||||
// straight to loading prep. RESERVED kept for any in-flight/legacy items.
|
||||
STORED: ['RESERVED', 'READY_FOR_LOADING'],
|
||||
// READY_FOR_PICKUP is the way back out for an IMPORT item that was parked in
|
||||
// storage from READY_FOR_PICKUP; without it, Store is a one-way door.
|
||||
STORED: ['RESERVED', 'READY_FOR_LOADING', 'READY_FOR_PICKUP'],
|
||||
RESERVED: ['READY_FOR_LOADING'],
|
||||
READY_FOR_LOADING: ['LOADED'],
|
||||
LOADED: ['DISPATCHED'],
|
||||
|
||||
@@ -86,8 +86,9 @@ export function getNextInventoryAction(item: WarehouseInventoryItem): InventoryA
|
||||
return 'store';
|
||||
case 'STORED':
|
||||
// Reserve is retired: a stored export item goes straight to loading prep
|
||||
// once inspection passes. Import STORED is handled via the import queue.
|
||||
if (isImport) return null;
|
||||
// once inspection passes. An import item parked back into storage returns
|
||||
// to pickup — otherwise Store would strand it with no action.
|
||||
if (isImport) return inspected ? 'ready-for-pickup' : null;
|
||||
return inspected ? 'ready-for-loading' : null;
|
||||
case 'RESERVED':
|
||||
// Export loading is gated on a passed inspection.
|
||||
|
||||
Reference in New Issue
Block a user