Commit Graph

3134 Commits

Author SHA1 Message Date
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
marshal
be75a9e867 Merge pull request #1048 from Tria-plc/freight_feature/usermanagement
fix issue
2026-07-31 16:06:43 +03:00
Marshal
66062ac1a2 fix issue 2026-07-31 13:05:04 +00:00
Abubeker Yasin
327f3b140c Merge pull request #1047 from Tria-plc/cbe-integration
feat: ( payment ) specific CBE query descriptions + Payment_Reason
2026-07-31 16:04:44 +03: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
Abubeker Yasin
5ebab56908 Merge pull request #1044 from Tria-plc/cbe-integration
Cbe integration
2026-07-31 14:50:21 +03:00
Nathnael
3952e8bbdf feat(freight): add download for the TIN business registration record
Ticket #181 — eTrade auto-fetch already existed; adds a client-side
download of the fetched record (eTrade returns data, not a document)
on the portal onboarding step and the backoffice customer detail page.
2026-07-31 11:45:24 +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
83d3fc3b78 feat(freight-portal): show account-status banner on every login
Ticket #422 — surface Pending/Suspended/Approved company status as a
banner, branching AccountReviewBanner on companyStatus instead of only
per-profile review state.
2026-07-31 11:43:07 +00:00
Marshal
091d655baa added ewti landing pae 2026-07-31 11:23:00 +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
Nathnael
a975aa7547 fix(payment-providers): stop halving every non-DJF CAC Bank amount
Both callers already hand the provider a major-currency amount before this
call — freight sends invoice.balanceAmount (e.g. 700 for $700), passenger
sends CurrencyService's converted charge amount — with the target currency's
own decimal precision already applied (0dp DJF, 2dp USD/ETB). CAC's
toMajorAmount then divided anything that wasn't DJF by 100 on top of that,
so a USD 700 charge reached the bank as 7.00. This never surfaced because
CAC has only ever been wired for DJF (passenger) until now.

Also scoped the bank's documented 10-100,000 bound to DJF — it's the only
currency the spec states bounds for, so a USD amount outside that DJF-shaped
range is no longer rejected locally; an amount genuinely out of range still
comes back as a bank rejection.

Passenger is unaffected: its CAC currency has always been DJF, and the DJF
branch's behavior (amount unchanged, bounds enforced) is untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 10:33:46 +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
9afc3d4059 Empty container enhancement 2026-07-31 07:34:02 +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
08e0fe2db2 feat: auto-populate yard and zone from selected warehouse
When warehouse is selected in standalone return modal, yard and zone
fields are automatically populated from warehouse data (yard from
warehouse.yard or warehouse.code, zone from warehouse.zone). Fields are
read-only/disabled to prevent manual editing.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-31 06:57:15 +00:00
Hagernesh
1bae13aec4 feat: add yard/zone fields and returned containers table 2026-07-31 06:46:03 +00:00
Hagernesh
74cf80106e feat: add yard/zone fields and returned containers table
Add Yard and Zone input fields to standalone return modal. Add table
showing all returned containers with: container number, booking ref,
returned date, facility, yard, condition, status. Table appears at top
of Container Returns page when returns exist.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-31 06:45:03 +00:00
marshal
378b9b6b21 Merge pull request #1035 from Tria-plc/freight_feature/usermanagement
add goverment booking
2026-07-31 04:26:31 +03:00
Marshal
d07a2e239e add goverment booking 2026-07-31 01:25:47 +00:00
marshal
a7f44c1d16 Merge pull request #1034 from Tria-plc/freight_feature/usermanagement
add goverment booking
2026-07-31 04:08:39 +03:00
Marshal
7a72245229 add goverment booking 2026-07-31 01:07:48 +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
marshal
e6b16feb25 Merge pull request #1032 from Tria-plc/freight_feature/usermanagement
leg-aware capacity and wagon sharing
2026-07-31 01:07:55 +03:00
Marshal
34e4a7d13f leg-aware capacity and wagon sharing 2026-07-30 22:07:23 +00:00
marshal
143cbebb18 Merge pull request #1031 from Tria-plc/freight_feature/usermanagement
leg-aware capacity and wagon sharing
2026-07-30 22:08:50 +03:00
Marshal
f891f6abe2 leg-aware capacity and wagon sharing 2026-07-30 19:08:06 +00:00
marshal
52eda90642 Merge pull request #1030 from Tria-plc/freight_feature/usermanagement
leg-aware capacity and wagon sharing
2026-07-30 20:22:44 +03:00
Marshal
acef6870e9 leg-aware capacity and wagon sharing 2026-07-30 17:21:44 +00:00
Hagernesh
c74b9320a2 feat: add standalone container return modal
Add "Record Return" button at top of Container Returns page for
standalone/unboooked returns. Modal accepts container number, return
date, warehouse, condition, handover notes. No booking association
required — supports returns that arrive without clear booking context.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-30 14:35:59 +00:00
Hagernesh
63aa2c7920 docs: clarify container returns are last-mile only (not first-mile)
Update labels and comments to reflect that container returns are for
last-mile trucks only: either EDR last-mile or customer self-haul. Same
truck that delivered will return with empty containers. Changed labels
from "EDR Returns" → "EDR Last Mile" and "Customer Returns" →
"Customer Self-Haul".

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-30 14:35:59 +00:00