Commit Graph

54 Commits

Author SHA1 Message Date
Nathnael
f0fd15b139 Merge branch 'dev' into fixes 2026-08-04 09:00:52 +00:00
Nathnael
acd2cfbe8c feat: add drain tail to the payments 2026-08-04 08:59:33 +00:00
marshal
c3ba0192a9 Merge pull request #1083 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-08-03 01:40:20 +03:00
Marshal
f4fd469643 per-user trade-direction access scope 2026-08-02 22:29:58 +00:00
Nathnael
ed27170301 chore: comment out the payment service 2026-08-02 18:07:15 +00:00
ghost2023
42e227569b Merge remote-tracking branch 'origin/staging' into freight/fix/pay
# Conflicts:
#	apps/edr-freight-api/src/modules/billing/billing.service.ts
#	apps/edr-freight-web/portal/src/pages/billing/InvoiceDetailPage.tsx
#	apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/components/PaymentMethodModal.tsx
#	pnpm-lock.yaml
2026-08-01 13:09:14 +03:00
Nathnael Wondisha
616269a988 Merge branch 'staging' into dev-to-staging 2026-08-01 10:27:47 +03:00
Abubeker Yasin
aa4ce7fd23 feat: ( payment ) specific CBE query descriptions + Payment_Reason 2026-07-31 16:03:28 +03: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
Marshal
acb6f286d4 fix(payments): reconcile with gateway before expiring unpaid holds
Replace the fixed 5-minute grace with a settlement check at expiry:
expire() calls the payment API's reconcile endpoint — paid intents are
kept and allocated via payment.succeeded, unverifiable results defer
expiry to the next tick, only verifiably unpaid holds expire.
2026-07-30 12:01:59 +00:00
Marshal
2ca04b8f98 changes export flow 2026-07-30 11:30:34 +00:00
Marshal
3a697e12f2 changes 2026-07-17 11:40:25 +00:00
Marshal
5a1e0dba4d Comment out payment event handling for local demos in BillingService 2026-07-17 07:43:17 +00:00
Marshal
71507b27fd changes 2026-07-16 20:09:59 +00:00
Marshal
35c53e3f36 changes 2026-07-16 20:03:35 +00:00
Nathnael
c19e4260c1 fix: revert the testing 2026-07-16 12:04:58 +00:00
Nathnael
6dde17fa4d fix: premature payable invoice 2026-07-16 08:38:49 +00:00
Nathnael
08faf56c4f fix: payment autopay on the payment init added for testing 2026-07-16 06:43:30 +00:00
Marshal
41fe04652f fix issue 2026-07-16 00:33:31 +00:00
Marshal
3349d256b8 ensure pessimistic-lock writes run in a transaction for invoice processing 2026-07-08 10:13:22 +00:00
marshal
ef2e8b6461 Merge pull request #460 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-04 12:04:03 +03:00
Marshal
c4a92c6482 changes 2026-07-04 08:23:08 +00:00
marshal
8fbff3b91b Merge pull request #454 from Tria-plc/freight_feature/usermanagement
changes
2026-07-04 09:22:58 +03:00
Marshal
7058922987 changes 2026-07-04 06:19:35 +00:00
natib21
4ddf03e357 mile 2026-07-03 20:43:26 +00:00
Nathnael
53fed882be feat: setup pagination to find all invoice api 2026-07-03 06:20:05 +00:00
ghost2023
2c5e553d7c Merge branch 'dev' into freight/feat/fixes-v1 2026-07-02 16:43:16 +03:00
hagiye
5af45c2643 Customer Truck Assignment and Portal Delivary Approval 2026-07-02 15:54:16 +03:00
ghost2023
4098b5476f fix(temp): invoice no for the telebirr 2026-07-02 15:37:49 +03:00
Nathnael
787da1ccc0 chore: fix the invoice event 2026-07-02 12:35:43 +00:00
Nathnael Wondisha
e874de25fe Merge pull request #397 from Tria-plc/feight/fix/ui-ux-issues
Feight/fix/UI ux issues
2026-07-02 12:49:07 +03:00
Nathnael
41fc0cabdf fix: duplicate invoice 2026-07-02 09:44:56 +00:00
Nathnael
5aafa436c1 fixes 2026-07-02 09:38:14 +00:00
Nathnael
63937db32b fix: update the updateStatus iss 2026-07-02 09:22:25 +00:00
ghost2023
1c012ce1e2 refactor(payment): centralize invoice processing with detailed tracking and configurable logging 2026-07-02 11:47:35 +03:00
yaschalew
54b2114e7f fix issue 2026-07-02 11:28:56 +03:00
hagiye
14a00af341 train gate pass, Telebirr and Wafi 2026-07-01 16:23:52 +03:00
ghost2023
aef868bc40 fix: the invoice status syncing with booking payment window 2026-07-01 15:46:13 +03:00
Nathnael
94982d3c5a feat: setup pdf on the central billing 2026-07-01 06:25:24 +00:00
Nathnael
8ab27a6721 feat: add expiration to invoice 2026-07-01 06:19:07 +00:00
Nathnael
0056dec924 style: clean up the invoice and setup event for warehouse. 2026-06-30 13:28:14 +00:00
Nathnael
fa3138f2ac refactor: migrate the warehouse invoice to use the central one 2026-06-30 12:54:04 +00:00
Nathnael
5ad4efd7eb feat: add pdf to the central invoice system 2026-06-30 11:58:28 +00:00
Nathnael
21cf24950d feat: add partial payment to match the warehouse invoice before migration 2026-06-30 10:50:43 +00:00
Nathnael
69955bc0e6 feat: setup the invoice backend 2026-06-29 13:53:32 +00:00
Nathnael
2551f76f8a fix: reference type in payment and billing 2026-06-29 09:50:29 +00:00
Nathnael
4be4286fbf feat: rewired up the billing and payment with the booking 2026-06-29 09:25:46 +00:00
Nathnael
36711eace4 chore: type updates on the billing service 2026-06-29 08:28:12 +00:00
Nathnael
1da5af94ab feat: scoped the payables by type 2026-06-29 07:32:42 +00:00