Commit Graph

2125 Commits

Author SHA1 Message Date
Marshal
a4ccdb1173 add wagon allocation snapshot to train schedules 2026-07-13 08:56:06 +00:00
Marshal
95b17b2729 enhance booking and contract management features
- Added support for comma-separated ops-clearance lifecycle statuses in contracts service.
- Display reference number in Upcoming Windows section if available.
- Updated badge label for document requirements in constants.
- Improved logic for identifying phased bookings in BookingClearanceWorkflowBanner.
- Introduced tabs in ReadonlyBookingView for better organization of booking details.
- Enhanced KeyFactsStrip to reflect the general nature of drawdown bookings.
- Updated status titles and descriptions for clarity in StatusHero and constants.
- Added contractKind field to IBooking interface for better identification of booking types.
- Created DocumentsTab component to manage and display all relevant documents for bookings.
2026-07-13 06:43:17 +00:00
Marshal
e7e5b93ffc add customs clearing filter and enhance clearance documents page for non-customs contracts 2026-07-12 14:14:21 +00:00
Marshal
84ba56f7d0 implement batch board notification system for schedule changes and updates 2026-07-12 12:01:05 +00:00
Marshal
4b7f6d2548 enhance contract and booking services with server-side search and validation improvements
- Added  parameter to  and  for server-side free-text search on contract reference, company name, and booking details.
- Introduced new validation errors in  for container clashes and space issues when creating bookings.
- Implemented paginated dropdown settings retrieval in .
- Updated  to fetch active yards using a new method that handles pagination.
- Enhanced  with a  method to fetch all records by walking through pages.
- Refactored  to support filtering and pagination in schedule listings.
- Improved  to return a paginated list of facilities.
- Updated UI components in  and  to utilize debounced search inputs for better performance.
- Added alerts in  to inform users about booking constraints related to splits and capacity.
- Enhanced  to display notifications for split bookings and capacity usage.
2026-07-12 10:51:31 +00:00
Marshal
eb3fc40f42 wagon work space, container validation 2026-07-11 04:28:22 +00:00
Marshal
3f03581d8c wagon work space, container validation 2026-07-10 23:50:35 +00:00
Marshal
dd87c2a722 wagon work space, container validation 2026-07-10 23:29:28 +00:00
Marshal
5d8658b5d6 fix contrat,wagon allocation wehn a booking is split 2026-07-10 22:27:58 +00:00
Marshal
1121e9ce82 Implement clearance-first booking flow and completion process for customs contracts 2026-07-10 21:51:59 +00:00
Marshal
9ed473c309 Implement clearance-first booking flow and completion process for customs contracts 2026-07-10 18:56:39 +00:00
Marshal
b50075dc83 general contrat 2026-07-10 17:57:27 +00:00
Marshal
a58650bdfb update booking logic for train schedules and customs contracts 2026-07-10 12:13:08 +00:00
Marshal
10111c9e01 merge 2026-07-10 11:08:30 +00:00
Marshal
45629e436e merge 2026-07-10 11:08:14 +00:00
Abubeker Yasin
7f841ea583 Merge pull request #597 from Tria-plc/alpha
feat( auth ): make email optional in signup/login
2026-07-10 14:04:34 +03:00
Abubeker Yasin
8321c697ec feat( auth ): make email optional in signup/login 2026-07-10 13:38:53 +03:00
marshal
4fe31614cf Merge pull request #596 from Tria-plc/freight_feature/usermanagement
enhance shipment requests page with filtering and sorting options
2026-07-10 13:33:40 +03:00
Marshal
1abef3ce34 enhance shipment requests page with filtering and sorting options
- Added status and cargo filters to the ShipmentRequestsPage.
- Implemented date range filtering for preferred dates.
- Introduced sorting options for shipment requests based on submission date and reference.
- Enhanced the display of shipment request details, including status badges and customer information.
- Updated the UI to include a search input with clear functionality and improved layout for filters.

feat: add equipment return option in new shipment form

- Introduced a toggle for equipment return in the NewShipmentPage.
- Updated form schema to include  field for container contracts.
- Enhanced user experience with visual feedback on the equipment return selection.

fix: update booking DTO to include equipment return option

- Added  field to CreateBookingUnderContractDto for per-shipment override.
- Updated related types and schemas to accommodate the new field for better contract handling.
2026-07-10 10:32:41 +00:00
Hagernesh Tadesse
b4ab89de46 Merge pull request #595 from Tria-plc/Truckdetantion
Truckdetantion
2026-07-10 12:09:12 +03:00
Nathnael
151d9c48c3 Merge branch 'dev' into freight/feat/fixes-v1 2026-07-10 08:54:34 +00:00
Nathnael
e5fce529fe feat: add poa to the changes approval 2026-07-10 08:45:39 +00:00
Hagernesh
9ef390ef1e fix(warehouses): truck weighing modal resolves bookingId without the relation
The modal read the booking id only from item.booking?.id, but inventory-
workbench rows carry bookingId without the booking relation. Result: the
container-weights and assigned-trucks queries never ran, so "Recorded net
weight (system)" fell back to the inventory row's weight (often 0), the
container MultiSelect never appeared, and the truck dropdown showed
"not assigned" even when trucks existed - while the server correctly computed
the cargo weight and rejected the mismatch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 08:34:14 +00:00
Hagernesh
9eb10bb4ce feat(warehouses): auto-load targets a selected train, never loads trainless
"Auto Load Ready Items" now opens a train picker (pre-dispatch trains with
these bookings assigned, via the existing loadable-trains flow). No train
available -> no auto-loading, with a clear notice. Loading goes through the
existing per-wagon load path, so items without an allocated wagon are skipped
with a reason.

The train association is stored on the existing warehouse_loadings table
(no new table needed): new train_schedule_id column + a note recording train
number, origin -> destination, and departure time; wagon_id becomes nullable.
The trainless load-passed-export endpoint, its frontend wiring, and the unused
useLoadPassedExport hook are removed.

Migration 2100000000000 (idempotent) also applied to the dev database.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 08:34:14 +00:00
Nathnael
ea0f264d72 fea: add poa section to backoffice customer detail page 2026-07-10 08:19:12 +00:00
Nathnael
78cb1ac5d3 feat: add poa and poa delegation file to onboarding 2026-07-10 08:18:37 +00:00
Hagernesh Tadesse
583846a185 Merge pull request #591 from Tria-plc/Truckdetantion
Truckdetantion

Receive to warehouse form cleanup and trimming
Wiring GRN with bookings
Fixed Slow GRN
plus fixed Freight order genration and rendering
2026-07-10 10:35:56 +03:00
Stephanos A.
85dec2b044 Merge pull request #592 from Tria-plc/alpha
Alpha
2026-07-10 10:35:46 +03:00
Stephanos A
4705f5c478 Merge branch 'alpha' of github.com:Tria-plc/edr-platform into alpha 2026-07-10 10:34:49 +03:00
Stephanos A
acc93aeffc UAT fixes and enhancements 2026-07-10 10:33:36 +03:00
Hagernesh
140c5a6469 fix(bookings): freight order renders styled on Chromium-less servers
The customer-truck freight order went through ContractPdfService, whose only
fallback is a crude text dump - so on servers without Chromium the document
rendered as unstyled text.

- render via the shared PdfRenderService with the styled tabular fallback
  (same path as marshalling / release documents)
- rebuild the freight-order HTML in the standard document shape: brand header,
  booking summary tiles, one trucks table (plate / driver / type / containers /
  arrival), gate notice, signature lines - which is also what the fallback
  parser reads
- keep the two watermarked copies (Port Operations, Gate Security & Carrier)
  for the Chromium path; drop the now-unused ContractPdfService injection

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 07:11:20 +00:00
Hagernesh
a7b429544b fix(warehouses): trim receive form to fields with a real source
- remove Incoterms, HS codes, and Item code from the truck-entrance form:
  nothing in the booking captures them, so they were always hand-typed noise
- remove the hand-typed "Warehouse code and location" input: the backend now
  stamps it from the warehouse/yard/zone the operator actually selected
  (WH / YARD / ZONE codes), so the GRN and notes always match reality
- Declaration number and Item description widen to full rows

Backend DTO keeps the optional fields for compatibility.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 07:11:20 +00:00
Hagernesh
fc2366f9e0 feat(warehouses): prefill receive-to-warehouse from existing booking data
The receive form now arrives filled with everything the booking already knows,
instead of the operator re-typing it:

- container numbers come from the per-unit records (booking_container_units)
  entered at booking time, falling back to the line-level aggregate
- customs seal number prefilled from the units' seal numbers
- net weight prefilled from the booking's declared cargo weight (tonnes)
- driver signatory defaults to the arriving driver's name

Existing prefills (owner, TIN, phone, booking ref, cargo, packaging, unit
count, first-mile / customer truck + driver) unchanged; all fields stay
editable where they were editable before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 07:11:20 +00:00
Marshal
2fb1917956 merge 2026-07-09 21:15:07 +00:00
Marshal
30f809b999 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight_feature/usermanagement 2026-07-09 21:14:09 +00:00
Marshal
3443b79644 make a contrat template 2026-07-09 21:13:07 +00:00
marshal
516dfd4032 Merge pull request #588 from Tria-plc/freight_feature/usermanagement
fix issues
2026-07-09 23:27:02 +03:00
Marshal
e4429592d3 fix issues 2026-07-09 20:26:14 +00:00
marshal
0a73d968b8 Merge pull request #587 from Tria-plc/freight_feature/usermanagement
add Excel import functionality for container bookings
2026-07-09 21:12:19 +03:00
Marshal
1d77cc9219 add Excel import functionality for container bookings 2026-07-09 18:10:58 +00:00
marshal
ae9c6b820a Merge pull request #586 from Tria-plc/freight_feature/usermanagement
test batch system
2026-07-09 20:15:39 +03:00
Marshal
a7d05fba34 test batch system 2026-07-09 17:04:25 +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
7ab5e9edd5 feat(warehouses): handover-driven approve delivery, weigh-skip, 5-min sign reminders
Approve delivery now tracks the handover lifecycle exactly: the button appears
(detail page + portal dashboard) the moment a handover is generated and
disappears when the customer signs. The bookings list attaches the
handoverAwaitingSignature flag via one batched query per page; status
heuristics (COMPLETED / TRUCK_ASSIGNED+arrived) are gone.

- generate the arrival handover for ANY self-haul truck: portal-assigned OR
  walk-in registered at the gate (isSelfHaulBooking: assigned_at set, or no
  EDR last-mile leg). Same rule now guards the exit paper.
- remind every 5 minutes (in-app + SMS + email) until the handover is signed
  (@Cron in HandoverService; one reminder per booking per tick)
- Truck Leaving no longer opens blank: the import queue mapper now carries
  inv.notes, so the saved arrival renders read-only with only gate-out time
  and gross weight editable
- container bookings get "Weigh truck? Yes/No": No skips tare/gross and the
  container weight match (weighingSkipped on ReleaseOrderDto, decision made at
  arrival sticks for the exit via the Weighing: SKIPPED note). Bulk always
  weighs, unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 15:37:06 +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
ca774267cd 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>
2026-07-09 15:37:06 +00:00
Hagernesh
001babbd2d fix(warehouses): repair missing warehouse_inventory.grn_number column
AddGrnNumberToWarehouseInventory1828000000000 is recorded in the migrations
table but the column is absent - it was added, then dropped out-of-band. Because
TypeORM has the original recorded it will never re-run, so every GRN read/write
fails with "column grn_number does not exist":

  - bulkReceive()             INSERT names grn_number   (receive to warehouse)
  - importQueueByStatuses()   Unloaded + Dispatch queues
  - exportInventoryByStatus() Received / Ready-To-Load / Loaded tabs
  - grnDocument()             GRN PDF

Re-adds the column, backfills from the "GRN Number:" receive note, recreates the
partial index. Idempotent, and down() is a deliberate no-op so reverting the
repair cannot re-introduce the outage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 15:37:06 +00:00
marshal
3ff84d687a Merge pull request #584 from Tria-plc/freight_feature/usermanagement
Enhance bulk booking handling and wagon capacity calculations across …
2026-07-09 18:31:00 +03:00
Marshal
1690f9e498 Enhance bulk booking handling and wagon capacity calculations across services 2026-07-09 15:30:00 +00:00
Roba Boru
f201b6e1fb Merge branch 'dev' of https://github.com/Tria-plc/edr-platform into alpha 2026-07-09 17:20:22 +03:00