Commit Graph

149 Commits

Author SHA1 Message Date
Nathnael
41e8c08ba3 feat: WIP Contnet managemtn 2026-08-08 09:37:28 +00:00
Hagernesh
2644d5e52d feat(eims): add invoice mapper and signed EIMS transport
Map EDR invoices onto the MoR EIMS /v1/register document and add the
cryptographic transport needed to talk to core.mor.gov.et.

Mapper: DTOs mirror the supplied Postman collection section by section.
Tax is resolved per line via a caller-supplied resolver and throws when
unresolved -- the app models no tax at all (invoice.taxAmount is always 0,
invoice_lines and the rate catalogue carry no fiscal columns), so a
zero-rated default would assert a tax position the codebase cannot support.
Seller identity, document number, counters and previous IRN are passed in
explicitly; the mapper stays pure.

Transport: config, credential loading, RSA-SHA512 signing and /auth/login
with an in-memory token cache. Signing reproduces the process that produced
a working live token -- compact JSON of the inner request only, exact UTF-8
bytes, base64 signature, and base64 of the certificate file's exact bytes
with no parsing or re-encoding. Concurrent callers share one login via an
in-flight promise. Refresh is deliberately unimplemented: the collection
shows an unsigned refresh body but also ships unsigned examples of calls
that do require signing, so an expired token re-logs in instead.

Errors normalise to EimsApiException carrying only the gateway's own error
fields; secrets, signature, certificate and tokens never reach logs.
Key and certificate file patterns are gitignored.

Nothing calls EIMS automatically and no invoice entity, migration or UI is
touched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 15:08:40 +00:00
Nathnael
116b479bb0 feat: scope notification to permission actions 2026-08-07 12:42:33 +00:00
Nathnael
7d2f17d767 Merge branch 'dev' into freight/nati-2 2026-08-07 08:09:34 +00:00
Nathnael
47ea54df1b fix: register facilities module and booking allocation controller
Neither was wired into the app, so every /facilities route and
POST /bookings/:id/allocate-containers returned 404 and their permission
keys granted nothing.
2026-08-07 07:41:00 +00:00
Nathnael
0114673120 feat(auth): gate and regate freight API controllers
Gates the previously open support-agent, procurement, compliance,
facilities, list-users and trade-access controllers, separates customer
from staff routes across bookings, contracts, companies, billing,
warehouses, files and train scheduling, and moves billing, overview,
reports and the settings controllers onto their own keys instead of the
blanket admin key. Drops the demo-permissions module and the untested
notification test route.
2026-08-07 07:32:25 +00: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
3a2f1a46d6 fix(auth): resolve position-type permissions so GL staff can open clearance pages 2026-08-06 13:24:42 +00:00
Hagernesh
1f4d659ffb Last mile confirmation request , approval, payment Feature 2026-08-05 20:01:48 +00:00
Nathnael
595c165820 feat: implement audit logs 2026-08-05 14:17:00 +00:00
marshal
3a1456263e Merge pull request #1107 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-08-04 14:40:41 +03:00
Marshal
56697d8fc5 implement exchange settings management and fallback rate handling 2026-08-04 11:22:47 +00:00
marshal
237bb067ad Merge pull request #1097 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-08-04 01:11:09 +03:00
Marshal
c3979b08b6 add reports module with controller, service, and repository 2026-08-03 21:43:23 +00:00
Nathnael Wondisha
229fc8e2db Merge pull request #1094 from Tria-plc/fixes
Fixes
2026-08-03 15:01:08 +03:00
Nathnael
72532f36cd fix: seeder 2026-08-03 11:58:33 +00:00
Marshal
f4fd469643 per-user trade-direction access scope 2026-08-02 22:29:58 +00:00
marshal
69f4616480 Merge pull request #1000 from Tria-plc/freight_feature/usermanagement
New Transit Agents admin table (name, valid-from/to, active/suspended…
2026-07-29 08:46:14 +03:00
Marshal
b17a72c280 New Transit Agents admin table (name, valid-from/to, active/suspended, validity badge) — DJ assign step now picks from it, active+valid only. 2026-07-29 05:38:35 +00:00
Nathnael
e823874d39 feat(auth): add login audience middleware (EDRFREIGHT-415) 2026-07-28 10:46:55 +00:00
Nathnael
03b8ca0ce7 refactor: centralized the iam seeder 2026-07-27 08:42:27 +00:00
Nathnael
1fe10ee3c2 feat(seed): implement local IAM baseline seeder with configurable settings 2026-07-27 07:09:09 +00:00
ghost2023
6fb9107e43 fix 2026-07-25 12:11:04 +03:00
Hagernesh
cf8a2e928d fix(warehouses): detention groups by canonical truck type
Join truck_types via vehicles.truck_type_id (normalized legacy
vehicle_type only as fallback) so type renames can't unmatch detention
rules and FK-less vehicles keep billing.
2026-07-24 11:55:05 +00:00
ghost2023
eab6f54e98 fix: rm iam seeder 2026-07-23 11:43:46 +03:00
Nathnael
2c7a4b7112 Merge branch 'dev' into freight/feat/fixes-v1 2026-07-20 08:20:34 +00:00
Nathnael
a45e1008fa fix: normalized the region and logged the otp properly 2026-07-20 08:19:59 +00:00
Hagernesh
eb998bfddd Facility 2026-07-20 07:13:51 +00:00
Nathnael
031e5ab292 Merge branch 'dev' into freight/feat/chat-app 2026-07-17 11:01:39 +00:00
Nathnael
1fd46afaaa fix: added chat to the freight api 2026-07-17 10:59:25 +00:00
Hagernesh
ce3ef15e7c feat(yards): record which yards can load/unload cargo
Intercity cargo is loaded at its origin yard and unloaded at its destination, but
only some yards have the equipment. EDR's facilities are Indode, Sebeta, Modjo,
Adama and Dire Dawa — and the set grows, so it has to be data.

- yards.has_facility marks a yard as a load/unload point; the new yard_facilities
  record says what it can do. Only Indode stores cargo (has_warehouse), so only it
  accrues storage/demurrage — the rest just move cargo on and off the train.
- facility_handling_events records each load/unload and carries its GRN.
  warehouse_inventory cannot: its warehouse/yard/zone are NOT NULL, so a facility
  without a warehouse could never have a row. inventory_id links to the storage
  record when there is one.
- YardFacilitiesService.facilityForYard is the single resolver the handling flows
  share, so they cannot drift on what a facility is.
- The seeder flags EXISTING yards and creates none. The codes are historical and
  do not read like the facility names — Indode is KALITY ("Gelan Multi Purpose
  Port (Indode)") and Sebeta is LEGACY_DEST — so it maps by code. Creating fresh
  INDODE/SEBETA yards would have split data that routes and bookings already
  reference.

Negad is deliberately absent: NAGAD ("DCT/SGDT") is in Djibouti while
NEGAD_FY_BCC is in Ethiopia and inactive, and which one is the intercity facility
is unsettled.

No behaviour change yet — nothing reads has_facility until the gate lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 10:40:16 +00:00
Marshal
01459bd73c train 2026-07-14 13:11:38 +00:00
Marshal
b5a97d344a train 2026-07-14 13:10:00 +00:00
Hagernesh
da44752c70 SELECT BOX 2026-07-11 08:30:39 +00:00
Hagernesh
eec3d1863a Cleaned warehouse related UI and made all 15 pages consisitent 2026-07-11 08:30:39 +00:00
Marshal
3443b79644 make a contrat template 2026-07-09 21:13:07 +00:00
Marshal
94904ea6d0 resolve conflict 2026-07-07 21:46:25 +00:00
Marshal
87a95b37bf enhance train scheduling and booking management 2026-07-07 21:38:45 +00:00
Marshal
f300600bfa changes 2026-07-07 12:28:47 +00:00
natib21
75427ea63a fix tracker 2026-07-07 06:39:02 +00:00
natib21
6b0db45be2 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight/feature/first_mile_invoice 2026-07-06 12:06:22 +00:00
natib21
998a6801ab fleet 2026-07-06 12:05:52 +00:00
Nathnael
5a10c14ceb feat: setup the notification module to the api 2026-07-06 06:51:38 +00:00
Hagernesh Tadesse
493af38ba2 Merge pull request #455 from Tria-plc/naming_convention
Handover customer sign
2026-07-04 10:04:23 +03:00
Hagernesh
18f47481d7 Handover customer sign 2026-07-04 06:31:23 +00:00
natib21
e893af8133 fix 2026-07-03 15:22:51 +00:00
natib21
0e6ebda6f6 fix 2026-07-03 15:21:23 +00:00
yaschalew
47f87e8435 fix conflict 2026-07-03 17:31:29 +03:00
ghost2023
4a6e42ccd9 fix: logger 2026-07-03 17:21:26 +03:00
natib21
e4b0c73c63 fix fayda 2026-07-03 09:10:05 +00:00