feat(warehouse): Receive Import/Export tabs with bulk receive + load-passed-export

- Backend: GET eligible-bookings?direction, POST receive-bulk, POST load-passed-export
  (reuse autoUnload/autoLoad patterns; no train-schedule/wagon logic changed)
- Frontend: ReceiveInventoryModal split into Import/Export tabs with eligible PAID
  bookings table, select-all/bulk receive, and Load Passed Export Items button
- Single-booking receive and all existing inventory row actions preserved

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hagernesh
2026-06-20 08:29:59 +00:00
parent d7352ba4e8
commit 0005b2edb3
8 changed files with 632 additions and 88 deletions

View File

@@ -14,6 +14,7 @@ import type {
ReceiveInventoryPayload,
ReleaseOrderPayload,
DeliverInventoryPayload,
BulkReceivePayload,
ReserveInventoryPayload,
SaveWarehousePayload,
SaveYardPayload,
@@ -186,6 +187,19 @@ export const useDeliverInventory = () =>
warehouseService.deliver(args.id, args.payload),
);
// ── Receive (Import/Export bulk) ───────────────────────────────────────────
export function useEligibleBookings(direction: 'IMPORT' | 'EXPORT', enabled = true) {
return useQuery({
queryKey: ['warehouse-inventory', 'eligible-bookings', direction],
queryFn: () => warehouseService.eligibleBookings(direction).then((r) => r.data),
enabled,
});
}
export const useBulkReceive = () =>
useInventoryMutation((payload: BulkReceivePayload) => warehouseService.receiveBulk(payload));
export const useLoadPassedExport = () =>
useInventoryMutation(() => warehouseService.loadPassedExport());
// ── Loading (Batch 3) ────────────────────────────────────────────────────────
export function useLoadableWagons(enabled = true) {