Commit Graph

1249 Commits

Author SHA1 Message Date
Marshal
ea9df9abbe Add a minimal payment mock server for end-to-end testing 2026-08-01 19:58:17 +00:00
Marshal
20bb2f274a resolve merge conflict 2026-08-01 12:16:12 +00:00
Marshal
123f925cc1 add Group 9 delivery scenarios for self-haul and last-mile paths
- Implemented G9·S38 tests for customer self-haul truck assignments, ensuring compliance with container limits and truck assignments.
- Added G9·S39 tests for last-mile delivery, self-haul, and yard pickup, verifying independent paths for multiple bookings on the same train.
- Created seed data for Group 1 and Group 2 scenarios, ensuring proper setup for weight and capacity tests.
- Updated booking interface to deprecate  in favor of  for better clarity in allocations.
2026-08-01 12:14:37 +00:00
Nathnael Wondisha
7ad1b4dff2 Merge branch 'staging' into dev 2026-08-01 14:06:37 +03:00
Nathnael
784f6ac6f2 Merge branch 'dev' into update-freight-migrations 2026-08-01 10:59:41 +00:00
Nathnael
dfdb79301d chore(freight-api): upgrade api-common and iamapi-common packages 2026-08-01 10:50:40 +00:00
marshal
91f3f56e12 Merge pull request #1063 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-08-01 13:04:33 +03:00
Marshal
0d8c63328a add items per wagon map to cargo types and sync bulk rate units
- Implemented  in the  to manage the physical item capacity for each wagon type.
- Added a new migration to create the  column in the  table.
- Introduced  method in  to update rate units when cargo type unit of measure changes.
- Updated booking calculations to consider items per wagon for break-bulk cargo.
- Refactored various components to utilize the new items fit logic and ensure consistent date formatting across the application.
- Added tests for the new display timezone functionality to ensure consistent date/time representation across different user settings.
2026-08-01 09:55:21 +00:00
Hagernesh Tadesse
583e635a60 Merge pull request #1061 from Tria-plc/edrmiles
fix
2026-08-01 11:37:29 +03:00
Hagernesh
af1d64d0bd fix 2026-08-01 08:34:59 +00:00
Nathnael Wondisha
938b34b55c Merge pull request #1060 from Tria-plc/freight/fix/pay
fix: hardcoded payment api url
2026-08-01 11:34:57 +03:00
Nathnael Wondisha
04db67ac64 Merge pull request #1059 from Tria-plc/freight/fix/pay
fix: hardcoded payment api url
2026-08-01 11:34:02 +03:00
ghost2023
1c508d23ae fix: hardcoded payment api url 2026-08-01 11:31:30 +03:00
Nathnael Wondisha
61e3a300a9 Merge pull request #1058 from Tria-plc/dev
syncing
2026-08-01 10:39:41 +03:00
Nathnael Wondisha
93384ed4e8 Merge pull request #1057 from Tria-plc/freight/chore/payment-test
Freight/chore/payment test
2026-08-01 10:34:27 +03:00
Nathnael Wondisha
616269a988 Merge branch 'staging' into dev-to-staging 2026-08-01 10:27:47 +03:00
marshal
71464c6da5 Merge pull request #1055 from Tria-plc/freight_feature/usermanagement
enhance contract and train scheduling features
2026-08-01 08:38:52 +03:00
Marshal
a8788eb549 enhance contract and train scheduling features
- Added pricing service integration to ContractsService for pre-persistence contract pricing.
- Updated LegCapacityPanel to display cargo weight instead of gross weight for better clarity on booked cargo.
- Enhanced train scheduling service to include cargo weight in booking details.
- Modified ClearanceDocumentsPage to include FULLY_EXECUTED status in booking status options.
- Refactored FileUploadSettingsPage to categorize file upload settings into tabs for better organization.
- Removed legacy onboarding fields and settings from file upload settings seeder.
- Improved type definitions for train scheduling to include cargo weight without wagon tare.
2026-08-01 05:37:46 +00:00
marshal
a084a98e84 Merge pull request #1052 from Tria-plc/freight_feature/usermanagement
fix issue
2026-07-31 20:55:41 +03:00
Marshal
6a4067ec42 fix issue 2026-07-31 17:54:10 +00:00
Nathnael
4f81a0bbb8 feat(freight): non-terminal change-request review + unified customer timeline
Backoffice can now "Request changes" on a pending settings change
request without rejecting it outright: a new ChangesRequested status
keeps the row open so the customer's next edit appends into the same
request instead of starting a fresh cycle, and the reviewer's note
persists across that round instead of being cleared on resubmit.

Version History and Review History (previously two separate,
differently-shaped lists) are merged into one chronological timeline
under a new History tab, including document changes shown as a real
previous-vs-current diff (both files openable).

Bug fixes surfaced while wiring this up:
- Replacing a single-file document slot left the old file live
  alongside the new one instead of retiring it (customer settings +
  onboarding uploads).
- The "previous" file in a document diff 404'd once superseded —
  the preview route now also matches soft-deleted records.
- A document replace was recorded twice in the timeline (once at
  upload, once again at change-request approval).
2026-07-31 14:12:30 +00:00
Hagernesh
ec48a8462f fix(freight-api): auto-unload bookings on final-yard bulk arrival
autoArriveAtFinalYard() bulk-updated booking status to ARRIVED/COMPLETED
via raw SQL but never emitted booking.unloadedAtYard, so
WarehouseInventoryService's listener never created the warehouse_inventory
row — bookings caught by this fallback (e.g. KALITY import arrivals)
stayed on awaiting unload indefinitely. Emit the event per row, covering
both intercity (DOMESTIC) and IMPORT as the listener already expects.
2026-07-31 13:34:05 +00:00
marshal
2605184b74 Merge pull request #1050 from Tria-plc/freight_feature/usermanagement
fix issue
2026-07-31 16:29:19 +03:00
Marshal
b74b51dcc1 fix issue 2026-07-31 13:27:44 +00:00
Hagernesh
d229808fd8 Fix 2 — lastmile should only be yes if EDR last mile. 2026-07-31 13:07:18 +00:00
Abubeker Yasin
aa4ce7fd23 feat: ( payment ) specific CBE query descriptions + Payment_Reason 2026-07-31 16:03:28 +03:00
marshal
f03ed7ca53 Merge pull request #1046 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-31 15:30:39 +03:00
Marshal
950d539e37 fix issue 2026-07-31 12:28:37 +00:00
Marshal
7e85c16141 fix issue 2026-07-31 12:23:41 +00:00
marshal
5169558c07 Merge pull request #1045 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-31 15:14:40 +03:00
Marshal
8b9dd76710 fix issue 2026-07-31 12:11:47 +00:00
Nathnael
7c5d96795c feat(freight): track onboarding-phase edit history for companies
Ticket #238 — pre-approval edits and document uploads write straight
to the live company row with no approval gate and, until now, no
trace. Adds an append-only company_revisions log (diffed field
changes, document uploads) recorded from updateProfile and
uploadCompanyDocuments, exposed via GET /companies/:id/revisions and
shown as "Version history" on the backoffice customer detail page.
2026-07-31 11:45:09 +00:00
Hagernesh
2759960d7e generate and send notifcation for Carriage Acceptance sheet 2026-07-31 11:44:02 +00:00
Nathnael
d67297a601 feat(freight): record when a company is approved
Ticket #420 — add approved_at to companies (migration), stamped at
both promotion sites (first-profile auto-approve and manual staff
status change). Surfaced as Submitted on/Approved on in the backoffice
customer list and detail views.
2026-07-31 11:43:36 +00:00
Nathnael Wondisha
7a30fd6aee Merge pull request #1042 from Tria-plc/freight/chore/payment-test
CAC Integration to the freight api, tests fix
2026-07-31 14:10:04 +03:00
Nathnael
93163ac575 Merge branch 'dev' into freight/chore/payment-test 2026-07-31 10:57:07 +00:00
Hagernesh
90fef6856b Container return and Price per KM for Vehcles 2026-07-31 10:52:52 +00:00
marshal
7f87e2d8ca Merge pull request #1040 from Tria-plc/freight_feature/usermanagement
intercity fix
2026-07-31 13:50:50 +03:00
Marshal
a64af98205 intercity fix 2026-07-31 10:50:16 +00:00
marshal
b65a1d8146 Merge pull request #1039 from Tria-plc/freight_feature/usermanagement
intercity fix
2026-07-31 13:27:25 +03:00
Marshal
74b7ee81fc intercity fix 2026-07-31 10:26:17 +00:00
Nathnael
c176b9e7d6 fix(payment): give the payment-service client a 60s budget
CAC Bank's initiate SMSes an OTP before it answers and routinely takes more
than the 10s this client allowed, so every CAC charge came back as a 502
while the bank was still working — and if the bank had answered, the payer
would have been texted a code for an intent the freight side never recorded.
Matches the passenger API, which already budgets 60s and reads the same
PAYMENT_API_HTTP_TIMEOUT_MS override.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 09:02:27 +00:00
Nathnael
6f5f6d7b0a test(payment): cover the CAC Bank OTP confirm path
The confirm flow settles money on a provider with no webhook, so the two
places it can go wrong are worth pinning: that the OTP is forwarded against
the GATEWAY intent id (not the local projection id), and that a rejected
code leaves the intent open instead of failing the payment.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 08:20:35 +00:00
Nathnael
97bfe95ec3 feat(payment): integrate CAC Bank OTP payments into freight flows
CAC Bank is an OTP debit with no redirect and no webhook: initiate SMSes a
code to the payer's mobile, and the charge only settles when that code is
confirmed. The payment service already spoke it (passenger uses it); the
freight side had the enum values but none of the flow.

API:
- PaymentClientService.confirmOtp forwards the code to
  POST /payments/intents/:id/confirm, mapping 400/404 to BadRequest so a
  mistyped code stays retryable instead of surfacing as a gateway failure.
- PaymentService.confirmOtp is keyed by the LOCAL intent id (the invoice's
  paymentId) rather than the domain reference, so the right invoice settles
  when several share a booking. On success billing settles the invoice.
- payInvoice rejects CAC_BANK without payerAccount before calling the
  gateway, and no longer runs the demo auto-settle for a COLLECT_OTP intent
  (it is not paid until the payer confirms).
- POST /billing/my-invoices/:id/confirm — ownership-checked, and since
  warehouse fee invoices are central invoices it covers those too.

Portal:
- useInvoicePayment owns the whole flow (initiate, redirect-or-OTP, confirm)
  and replaces the five near-identical pay mutations at the call sites.
- PaymentMethodModal gains the CAC Bank option, the payer mobile field, and
  the OTP step. Click-outside is disabled there so a stray click cannot drop
  the payer out of a live OTP window.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 08:11:23 +00:00
Abubeker
37855b0a83 feat: ( payment ) implement cbe payment 2026-07-31 07:50:10 +00:00
Nathnael
5a02da91d2 refactor(api): extract self-service attributes for immediate application and poa verification improvement 2026-07-31 07:38:49 +00:00
Hagernesh
341c2b3742 add carriage acceptance sheet PDF per booking
Lists every wagon allocated to a booking with tare, equated length,
capacity, container and seal numbers, plus footer totals and signature
lines. Issued on cargo acceptance (export) and on allocation before
marshalling (import), so the endpoint rejects bookings with no wagon
allocations. Price per wagon splits the booking amount by allocated
weight, with the last row absorbing rounding so the column sums to the
total. Reuses the existing marshalling document renderer and its
Chromium-less tabular fallback.
2026-07-31 07:02:11 +00:00
Hagernesh
1bae13aec4 feat: add yard/zone fields and returned containers table 2026-07-31 06:46:03 +00:00
marshal
5564819b28 Merge pull request #1033 from Tria-plc/freight_feature/usermanagement
add goverment booking
2026-07-31 03:43:36 +03:00
Marshal
65f18b4796 add goverment booking 2026-07-31 00:41:51 +00:00