Commit Graph

1652 Commits

Author SHA1 Message Date
Hagernesh
337ff6cfe3 feat(freight): support direct truck-to-train export handover
Export cargo reaches a train two ways, but the platform only modelled
one. Direct truck-to-train cargo loads straight onto the wagon, never
enters a warehouse and so never has a GRN — yet assertExportReceivedWithGrn
required one before the carriage acceptance sheet could be issued or the
booking loaded from inside its schedule.

Adds export_handover_mode to freight.bookings (null = WAREHOUSE, so
existing bookings are unaffected) and teaches the shared gate to skip
DIRECT_TO_TRAIN. Both call sites are fixed by that single early return.

For direct bookings the carriage acceptance sheet builds its lines from
the booking's own containers, falling back to the declared bulk tonnage,
and is issuable as soon as the mode is chosen. Direct bookings are also
removed from the warehouse receive queue, since that cargo is never
coming to the shed.

Staff choose the mode from the booking detail page via a new endpoint
reusing bookings:operations. Switching to direct is refused once
warehouse inventory exists, so the two flows cannot cross.

Warehouse-then-train keeps every gate it had.
2026-08-08 15:16:31 +00:00
Marshal
fb6f8afc0c add usd for import 2026-08-08 15:14:10 +00:00
Marshal
4b8119fd3c chnages 2026-08-08 14:02:58 +00:00
Marshal
1700ae0747 chnages 2026-08-08 14:00:45 +00:00
Marshal
a42d32c27c feat(billing): USD offline bank-transfer payments 2026-08-08 13:37:05 +00:00
Hagernesh
80e1648672 fix 2026-08-08 13:17:43 +00:00
Hagernesh
204bfd2421 fix: let trains dispatch with cargo still in the warehouse
The export-only assertAllocatedCargoLoaded guard threw a
BadRequestException whenever a booking on the schedule had warehouse
inventory in RECEIVED, STORED or READY_FOR_LOADING, making it
impossible to dispatch a train whose cargo had not been inspected and
loaded onto a wagon.

Leaving cargo behind is an operational decision, not an error state.
The dispatch confirm dialog already lists unassigned and unloaded
bookings and offers Dispatch anyway, so the readiness signal is
preserved — only the hard block is gone.

Wagon/locomotive conflicts and the Djibouti gatepass check still block
dispatch: those are physical and legal conflicts, not cargo readiness.
2026-08-08 13:17:43 +00:00
Marshal
83b9e32670 usd remove from the portal 2026-08-08 12:40:07 +00:00
Marshal
7a84826947 usd remove from the portal 2026-08-08 12:39:56 +00:00
marshal
1b0978bc1e Merge pull request #1183 from Tria-plc/freight_feature/usermanagement
feat(freight-web): restrict booking currency to ETB and portal ETB pa…
2026-08-08 13:49:16 +03:00
Marshal
229d9c6651 feat(freight-web): restrict booking currency to ETB and portal ETB payments to CBE bill only 2026-08-08 10:47:48 +00:00
Nathnael Wondisha
a140add64e Merge pull request #1181 from Tria-plc/freight/nati-2
Freight/nati 2
2026-08-08 12:38:32 +03:00
Nathnael
41e8c08ba3 feat: WIP Contnet managemtn 2026-08-08 09:37:28 +00:00
Nathnael
ee25de8817 fix(freight:backoffice): wire dedicated permission keys instead of broad fallbacks
Compliance & Alerts, Procurement, File settings, Dropdown settings,
Trade access, and Exchange rate all fell back to a broad permission
(fleet:view or admin) even though a dedicated key already existed in
FREIGHT_PERMS — meaning granting one of these pages meant granting
several unrelated ones too. Each now checks its own key first, with
the broad permission kept as a fallback for existing role grants.

Incidents left as-is: no dedicated edr_freight_app:incidents:* key
exists yet on the backend.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-08 09:36:51 +00:00
Hagernesh Tadesse
268737cc4f Merge pull request #1180 from Tria-plc/lastmilerequest
Lastmilerequest
2026-08-08 12:30:43 +03:00
Hagernesh
375cf55e5f LM map missing map api fall back fix 2026-08-08 07:51:41 +00:00
Hagernesh
e12cb78e9b feat(portal): pay-later last-mile note, gated by service type
Last-mile toggle explains deferred billing (confirm containers after
Djibouti departure, sign supplementary LM contract on truck approval,
pay advance) — shown only when the service defers mile billing, not
for RAIL_CONTAINER_PAID_MILE where the mile is priced into the booking.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-08 05:24:22 +00:00
Hagernesh
6b1ffa831f feat(eims): surface filing state in backoffice and alert on failures
Two gaps that only bite in production: nobody could see an invoice's filing
state, and a blocked chain was visible only in the logs.

A failed filing now notifies the staff who can act on it. An ambiguous result
is HIGH priority because it blocks every further invoice for the system number
until someone resolves it, and nothing else would surface that -- the sweep
just goes quiet. A deterministic rejection affects one invoice, so it is
normal priority. The alert never throws: it must not mask the filing outcome.

The backoffice invoice detail page gains an EIMS card showing status, IRN,
counter, submitted and acknowledged timestamps, and the gateway's own error
message, with actions gated on invoices:eims_register. FAILED offers "File
again" -- the reservation model already allows re-registering a rejected
invoice, so retry needed no new endpoint. UNKNOWN offers no re-file button at
all, since resubmitting risks a duplicate registration, and instead explains
that a supervisor must record the IRN or discard the attempt.

Also aligns the migration class name with its renamed file. The DDL is
idempotent, so re-applying under the new name is a no-op against the columns;
it leaves one superseded row in freight.migrations.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 04:56:57 +00:00
Marshal
a05753f4a6 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight_feature/usermanagement
# Conflicts:
#	apps/edr-freight-web/backoffice/src/App.tsx
2026-08-07 23:55:30 +00:00
Marshal
cd90ccb0f5 feat(contracts): per-cargo bulk contract templates 2026-08-07 23:50:27 +00:00
marshal
7d8a2847e0 Merge pull request #1172 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-08-08 02:00:59 +03:00
Marshal
d2eb47d14b feat(ui): 2026-08-07 23:00:06 +00:00
Nathnael Wondisha
22e6e550bc Merge pull request #1164 from Tria-plc/freight/nati-2
Freight/nati 2
2026-08-07 15:58:02 +03:00
Nathnael
c9bb105e94 feat: add nationality indicator to the customer 2026-08-07 12:54:00 +00:00
Nathnael Wondisha
116ea97be8 Merge pull request #1163 from Tria-plc/freight/nati-2
Freight/nati 2
2026-08-07 15:26:32 +03:00
Nathnael
1e9149ce00 feat: better navigation in backoffice 2026-08-07 12:24:30 +00:00
Marshal
70215a9f37 feat(wagons): audited maintenance/availability toggle 2026-08-07 12:10:43 +00:00
Marshal
ffdb4c5117 merge 2026-08-07 09:04:11 +00:00
Marshal
64150acdca issue fix 2026-08-07 08:44:03 +00:00
Nathnael
7d2f17d767 Merge branch 'dev' into freight/nati-2 2026-08-07 08:09:34 +00:00
Nathnael
c1fcabcba2 feat(backoffice): guard routes and actions by permission
Mirrors the new keys in lib/permissions.ts, wraps the warehouse,
overview, reports, support and booking-request routes in
RequirePermission, and gates the dispatch, mark-paid, invoice pay/cancel,
export and support-send actions behind their own keys. Removes duplicate
route blocks.
2026-08-07 07:32:25 +00:00
Marshal
fc7f40a373 fix wagon cancellation 2026-08-07 07:18:12 +00:00
Marshal
296878cbde fix wagon cncellation 2026-08-07 06:59:31 +00:00
Nathnael
828392dd04 feat: edr help video 2026-08-07 06:57:55 +00:00
Marshal
3db14bc09a fix wagon cncellation 2026-08-07 06:31:25 +00:00
Marshal
17f6230129 fix wagon cancellation 2026-08-07 05:53:55 +00:00
Marshal
eb1349e846 fix wagon cncellation 2026-08-07 05:48:23 +00:00
Marshal
2321c9b893 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight_feature/usermanagement 2026-08-06 23:49:48 +00:00
Marshal
0f4aa1128f giveme git commit message 50 char 2026-08-06 23:48:06 +00:00
Nathnael Wondisha
eff60885cd Merge pull request #1146 from Tria-plc/freight/nati-2
Freight/nati 2
2026-08-07 01:41:42 +03:00
marshal
4a02eca537 Merge pull request #1145 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-08-07 01:35:39 +03:00
Marshal
96a4dd2e7f exclude self from container clash 2026-08-06 22:34:53 +00:00
Marshal
1b8c7e4296 full change-booking flow for op revisions 2026-08-06 21:57:08 +00:00
Marshal
c61b66fd23 feat(bookings): show allocated wagons in portal 2026-08-06 20:40:28 +00:00
Nathnael
30b0eff603 feat: add faq, help, privacy policy and tos 2026-08-06 20:40:05 +00:00
Marshal
4eb0d56faf feat(bookings): show allocated wagons in portal 2026-08-06 20:25:08 +00:00
Marshal
7db03ea347 customer cancel + revise edit flow 2026-08-06 20:16:48 +00:00
Marshal
9a50df2be3 add cancellation for booking 2026-08-06 20:05:13 +00:00
Nathnael
dd2b624aa6 fix: onboarding validation 2026-08-06 18:54:54 +00:00
Marshal
533de3cc93 fix(cbe): update response code from 3 to 2 for business failures in CBE integration 2026-08-06 17:50:27 +00:00