Commit Graph

31 Commits

Author SHA1 Message Date
Hagernesh
1fae0752a0 Ticket: Warehouse dashboard Needs Attention cards — fix trucks-on-site aging counters (EDR trucks, UNLOADED status) and make each card open the exact list behind its count via new inventory drill-down filters. 2026-07-21 11:03:40 +00:00
Hagernesh
7b777792e3 feat(warehouse): expand an inventory row to see which containers ride which truck
The inventory table has one row per inventory item, so on a self-haul booking
with several trucks there was no way to tell which container sat on which
truck without opening a document. The plate column now lists every plate, but
not the mapping.

Each row with a customer truck gets a chevron that opens a per-truck
breakdown: plate, driver, type, the containers it carries, and whether it has
arrived. Bulk trucks show "Bulk" — they haul loose tonnage, not containers.

The breakdown fetches only when opened, so a table nobody expands costs no
extra requests, and it reuses the existing per-booking trucks endpoint rather
than widening the inventory query.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 12:54:10 +00:00
Hagernesh
b71a53c4a9 fix(warehouse): show booking reference instead of UUID in inventory table
The inventory table's Booking column rendered a truncated bookingId UUID; use
the bookingReference already attached to each row (fall back to the short UUID
only when absent). Keep the UUID in the tooltip.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 07:54:23 +00:00
Hagernesh
d9fe79e160 accrual dashboard for port and terminal or warehouse related documents 2026-07-14 12:54:40 +00:00
Hagernesh
58a66b3a23 fix(warehouses): retire per-booking Load and Dispatch buttons
Wagon loading happens in the train flow and dispatch at the train level, which
already advances inventory - the per-row buttons duplicated that and confused
operators.

- WarehouseInventoryTable (import dispatch queue + warehouse pages): suppress
  the 'load'/'dispatch' next-action buttons and drop the extra per-row Dispatch
  on READY_FOR_PICKUP rows (Store stays)
- Export Dispatch Queue: drop the per-row Dispatch button and its Actions
  column; the bulk Dispatch All / Dispatch Selected controls remain

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 15:37:07 +00:00
Hagernesh
7bf407b503 fix(warehouses): surface the real reason when a PDF download fails
Blob downloads set responseType: 'blob', so axios delivers the JSON error body
as a Blob. extractErrorMessage() reads `.message` off it, finds nothing, and
falls back to "Request failed with status code 400" - hiding every real reason
("Handover must be signed...", "...must be fully paid before terminal release").

Only ContainerItemsModal used the async Blob decoder. Switch the remaining nine
blob-download catches to extractDownloadErrorMessage():

  InventoryWorkbench      release paper, handover
  WarehouseInventoryTable GRN
  ReceiveInventoryModal   GRN (x2), handover, exit paper
  FeePreviewModal         release paper
  TruckDispatchModal      truck exit paper

Mutation-error catches are untouched - their bodies are already parsed JSON.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 15:37:06 +00:00
Hagernesh
80904eeeb2 Handover SIGN notification, resending until signed no exit before sign 2026-07-08 09:33:19 +00:00
hagiye
9f5c22c1ee Goods recieved notes and Booking delivery 2026-06-30 07:19:12 +03:00
hagiye
d55f9312bf Marshaling document Receive Export and import handover to customer 2026-06-29 12:24:14 +03:00
hagiye
d726927453 Notification for demurrage and invoice fee 2026-06-27 05:33:58 +03:00
hagiye
f4a90755c2 api 2026-06-25 11:00:40 +03:00
hagiye
8ee31789c6 merge conflict fix 2026-06-24 12:31:59 +03:00
hagiye
0255adffe6 changes 2026-06-24 09:56:12 +03:00
Nathnael
cbbad02b29 fix: type error and other fixes 2026-06-23 13:14:06 +00:00
ghost2023
cdfe7c1f5b fix: type errors 2026-06-23 15:02:25 +03:00
Nathnael Wondisha
fff679369d Merge branch 'freight/develop' into freight/style/ui-sync 2026-06-22 11:58:18 +03:00
Nathnael
feddce8a0c style: use the proper primary color 2026-06-22 08:11:11 +00:00
Hagernesh
41d21edae5 feat(warehouse): Batch 10 — import post-inspection actions (pickup / last-mile / store / dispatch)
- READY_FOR_PICKUP transitions now → DELIVERED (customer pickup) OR DISPATCHED (dispatch out) OR
  STORED (operator-chosen storage) — pickup and dispatch kept separate. No auto-storage.
- GET /warehouse-inventory/import/pickup-ready-queue: READY_FOR_PICKUP import items (shared query
  with the unloaded queue, route-derived import filter)
- WarehouseInventoryTable: PICKUP_READY rows now show explicit Store + Dispatch buttons alongside
  the customer-pickup (release/deliver) next action; reuses the existing advance() dispatcher
- Import → Dispatch Queue tab renders pickup-ready items via InventoryWorkbench (all existing
  actions + modals intact) with Last Mile shown only when door delivery was requested
- Verified: pickup-ready item → Store → STORED; → Dispatch → DISPATCHED

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 14:38:23 +00:00
Hagernesh
8b28a7c430 feat(warehouse): Batch 8 — Import Auto Unload Arrived Bookings (→ UNLOADED)
- New UNLOADED inventory status (train-arrival landing state) + transitions + unloaded_at column
  (idempotent migration 1791000000003) + INVENTORY_UNLOADED activity type
- POST /warehouse-inventory/import/auto-unload-arrived-bookings { scheduleId }: validates ARRIVED
  IMPORT train, unloads all eligible assigned bookings (IN_TRANSIT/ARRIVED_AT_*) into UNLOADED,
  records unloadedAt + activity. Does NOT store and does NOT inspect. Reuses allocation + inventory
  plumbing. Returns { unloadedCount, skippedCount, failedCount, results }.
- Arrive Queue "Auto Unload Arrived Bookings" button now calls the new endpoint (was per-booking loop)
- Import → Unloaded Queue tab: lists UNLOADED items via InventoryWorkbench (existing actions preserved:
  Inspect/Store/Move/History) + a Last Mile action shown ONLY when booking requested door delivery
- Batch8TestDataSeeder: sets seed import train bookings to IN_TRANSIT (unload-eligible)
- Verified: auto-unload → 1 UNLOADED (unloadedAt set, not stored, not inspected); ineligible skipped;
  idempotent re-run skips already-unloaded

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 12:57:29 +00:00
Hagernesh
50c6381341 feat(warehouse): Batch 3+4 — export receive-selected label + bulk-mark-inspected workflow
- BulkReceiveModal: Receive Selected shows "received at facility" for EXPORT
- Export inspection: POST /warehouse-inventory/bulk-mark-inspected reuses WarehouseInspectionService.create
- EXPORT items advance to READY_FOR_LOADING after inspection PASSED
- InventoryWorkbench: selection state + "Mark Selected as Inspected" bulk button
- WarehouseInventoryTable: optional Checkbox column for bulk selection
- Route-based direction in eligibleBookings, bulkReceive, getBookingDirection
- New BulkInspectDto; service + controller wired

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 17:52:01 +00:00
Nathnael
3dfb8d99ba style: finish revamp of the warehouse page 2026-06-20 10:45:22 +00:00
hagiye
a8cdbdf386 Warehouse Enhancemendt 2026-06-20 11:49:22 +03:00
hagiye
484ac187a9 warehouse 2026-06-19 17:13:17 +03:00
Hagernesh
e40318c847 Dashboard enhancement 2026-06-19 11:29:05 +00:00
natib21
b4ed7d492d fix vehicle 2026-06-19 06:56:07 +00:00
Hagernesh
01aec12ee9 feat(warehouse): Batch 5 — config-driven allocation + storage/demurrage fee rules
- Allocation rules engine: cargo/container/trade criteria -> deterministic yard/warehouse/zone by code; wired into auto-unload (fallback to default)
- Storage/demurrage fee rules: configurable freeDays + ratePerDay; most-specific match; fee preview per inventory item
- Inventory demurrage timestamps: inspectionStartedAt, inspectionCompletedAt, readyForPickupAt, releaseDate, gateClearedAt
- Migration 1790000000000 (allocation_rules + fee_rules tables + inventory date columns)
- Frontend: Allocation & Fees config page, automatic Fee Preview modal, plumbing/hooks
- No invoice/payment (Batch 6)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 23:53:04 +00:00
Hagernesh
5b8cb16c1a automation 2026-06-17 22:00:53 +00:00
Hagernesh
f528b75737 Warehouse 2026-06-17 12:44:57 +00:00
hagiye
63f177e6d0 Move within warehouses 2026-06-16 12:46:02 +03:00
Hagernesh
72e2e3c985 Recieved invontory detals 2026-06-12 06:58:21 +00:00
Hagernesh
c86118cd8d feat(warehouse): add warehouse management module (batch 1)
Backend (edr-freight-api):
- Warehouse, WarehouseYard, WarehouseZone, WarehouseInventory entities
- CRUD for warehouses/yards/zones with scoped code uniqueness
- Inventory receive with location-hierarchy + capacity validation and
  transactional capacity-counter updates
- inspect / ready-for-loading status transitions
- inventory inquiry (booking/customer/container/cargo-type joins)
- migration creating freight.warehouse* tables

Frontend (freight backoffice):
- types, service, react-query hooks, URL constants
- reusable components: badges, filters, table/card views, inventory and
  inquiry tables, create/receive modals
- pages: Warehouse list, detail (overview/yards/zones/inventory tabs),
  inventory, inventory inquiry
- Warehouse Information card + Receive At Warehouse on booking detail
- routes + sidebar nav; app-wide ErrorBoundary

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 15:54:56 +00:00