Commit Graph

4212 Commits

Author SHA1 Message Date
Marshal
49c453b82a always-on calendar, currency cards 2026-08-05 07:26:41 +00:00
ghost2023
321f3612ec refactor(freight-api): split migration histories between IAM and freight 2026-08-05 10:26:25 +03:00
Marshal
15c43789d3 always-on calendar, currency cards 2026-08-05 07:12:27 +00:00
marshal
724079663b Merge pull request #1114 from Tria-plc/freight_feature/usermanagement
always-on calendar, currency cards
2026-08-05 10:05:45 +03:00
Marshal
2f576fd1de always-on calendar, currency cards 2026-08-05 07:03:39 +00:00
marshal
772c5245b0 Merge pull request #1113 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-08-04 20:31:16 +03:00
Nathnael Wondisha
e5a0b25888 Merge pull request #1112 from Tria-plc/fixes
fix: exchange moduel regsiter
2026-08-04 17:53:19 +03:00
ghost2023
9485e7e9cf fix: exchange moduel regsiter 2026-08-04 17:49:37 +03:00
Nathnael Wondisha
eb027fd62e Merge pull request #1109 from Tria-plc/fixes
Fixes
2026-08-04 17:39:00 +03:00
ghost2023
969f626d4a Merge branch 'dev' into fixes 2026-08-04 17:38:13 +03:00
ghost2023
f75b681a0e fix(freight-portal): add /callback route for Fayda redirects 2026-08-04 17:37:41 +03:00
Marshal
5d68a3f7b7 add permanent purge functionality for wagons and routes
- Implemented a  method in  to permanently delete wagons without history.
- Added corresponding permissions for hard delete actions in .
- Updated the UI components to include purge actions, ensuring they are only available to users with the appropriate permissions.
- Created modals for confirming permanent deletions in  and .
- Enhanced API services to handle purge requests for locomotives, wagons, and routes.
- Added tests for the purge functionality in both  and  services to ensure proper behavior and error handling.
2026-08-04 14:07:16 +00:00
Marshal
8cf49aa1cc enhance contract document rendering with detailed cargo information
- Updated ContractDocumentViewModelBuilder to include cargoTypeName, containerType, and cargoSummary in the schedule.
- Modified contract dynamic template tests to validate the new cargo fields.
- Enhanced contract renderer service tests to reflect changes in cargo data structure.
- Updated contract view model interface to include new cargo-related fields.
- Improved dynamic template rendering to display cargo type and container type.
- Refactored exchange settings controller and service to streamline error handling and feed status management.
- Introduced article HTML conversion functions to support Quill editor integration for structured article editing.
- Added tests for article HTML conversion to ensure correct round-trip processing of clauses and bullets.
2026-08-04 13:06:03 +00:00
Marshal
d0040a6851 enhance contract document rendering with detailed cargo information
- Updated ContractDocumentViewModelBuilder to include cargoTypeName, containerType, and cargoSummary in the schedule.
- Modified contract dynamic template tests to validate the new cargo fields.
- Enhanced contract renderer service tests to reflect changes in cargo data structure.
- Updated contract view model interface to include new cargo-related fields.
- Improved dynamic template rendering to display cargo type and container type.
- Refactored exchange settings controller and service to streamline error handling and feed status management.
- Introduced article HTML conversion functions to support Quill editor integration for structured article editing.
- Added tests for article HTML conversion to ensure correct round-trip processing of clauses and bullets.
2026-08-04 13:03:39 +00:00
Abubeker Yasin
14af6374f8 Update payment-deadline.utils.ts 2026-08-04 15:44:57 +03:00
Nathnael
7393034188 feat(WIP): require the gm for fayda on ethiopian companies 2026-08-04 12:43:25 +00:00
Nathnael
415ae52143 test(integration): boot freight API in-process across parallel shards
The suite drove a containerized freight API, so every code change needed an
image rebuild before a test could see it, and there was no way to attach a
debugger. Files also ran strictly in sequence against one shared database,
which is the root of the warm-stack gotchas the README documents: stowaway
paid bookings climbing back aboard, a short consist on the fifth file.

The freight app now boots inside each vitest worker from dist/, and each
worker owns a whole shard of the topology - its own database, payment API,
gateway mock and broker vhost - so nothing mutable is shared and files run
in parallel. Full suite drops from roughly 20 minutes to 196s at 4 shards.

- main.ts exports createFreightApp() so the harness applies the same prefix,
  pipes, filters and interceptors as production instead of replaying them by
  hand; self-start is guarded by require.main so the Dockerfile CMD still boots
- booking-window tick cadence is env-driven (BOOKING_WINDOW_TICK_CRON), */1 in
  the suite, */10 unchanged in production
- prepare-shards.mjs seeds a template database (boot seeders, then the SQL
  fixtures that depend on them) and clones it per shard; it.mjs re-clones on
  every run, so each run is hermetic
- gateway mock and payment API are generated per shard: the mock keeps modes
  and orders process-global and 20 of 25 specs reset it in beforeAll, and the
  inbound CBE bill query has to reach one specific shard's app
- poll() samples every 250ms instead of 2000ms, keeping the caller's deadline
- authz.it.ts seeds its own invoice; it previously read another spec's leftover
  and returned early, which silently passed on a pristine database

Known: an unlocked MAX(sequence_no)+1 in train-scheduling.service.ts races
under concurrent allocation and leaves a short consist, so 1-3 specs fail
intermittently. Pre-existing and reproduces at the production tick cadence.
2026-08-04 12:43:25 +00:00
Nathnael
3a69b961d4 refactor(freight): move the Fayda callback to /fayda/callback
Namespaces the OAuth landing path in all three places it exists: the API's
ack controller, both web apps' routes, and the redirect_uri env values.
A bare /callback claimed a generic top-level path in every app for one
provider's redirect.

The API side needed care. The ack controller moves to @Controller
('fayda/callback'), and the global-prefix exclusion has to name that exact
path — setGlobalPrefix's exclude is an exact route match, not a subtree, so
excluding "fayda" would have left /fayda/callback served at
/api/fayda/callback and 404ing at the registered redirect_uri, while
reading as though it covered everything under /fayda. Naming the full path
also keeps /api/fayda/verification/* prefixed, which every client calls.

Also drops a stale comment on the portal's callback route describing the
popup that no longer exists, and records why the route is public: behind
RequireAuth the onboarding gate redirects to /portal before the code+state
exchange can run.

NOT verified at runtime — this changes route registration, so boot the API
and confirm GET /fayda/callback answers un-prefixed and
/api/fayda/verification/start still resolves before relying on it.

Deploying this requires registering the new redirect_uri with eSignet
first; FAYDA_WEB_REDIRECT_URI, FAYDA_PORTAL_REDIRECT_URI and any mobile
client must be updated in step or verification breaks with a redirect_uri
mismatch.
2026-08-04 12:43:25 +00:00
Nathnael
b356433886 test(freight-e2e): fix stale onboarding selectors, tighten Fayda assertions
The onboarding journey had been failing at the company step for a while:
that step was restructured into StepSection cards, so its TIN and VAT
fields no longer have <label> elements and the label-based fill() helper
could not find them. Match on aria-label instead, which also sidesteps the
"0012345678" placeholder both fields share.

Two further staleness bugs were hiding behind that one, both in fill()
itself. It chained clear() into type() on a subject captured beforehand, so
a step-persist PATCH resolving between the two detached it; and re-querying
by the captured id was no better, because the fields remount rather than
re-render and Mantine mints a fresh generated id when they do. Resolve
label -> for -> element afresh for each action. fillPhone gets the same
treatment.

Tighten what the journey proves about Fayda. It verified out-of-band and
then never checked the result reached the UI, so assert the panel renders
fayda-mock's own payload — name, phone and email — which only holds if it
travelled Fayda -> API -> UI, and cross-check ownerFaydaSub on the company,
since that sub is what locks the owner's fields server-side. The PoA step
now asserts no file input exists while the PoA is unverified, covering the
DARS gating; asserted structurally so rewording the document setting cannot
turn a regression into a passing test.
2026-08-04 12:43:25 +00:00
Nathnael
53accbc57b feat(freight-portal): verify Fayda via redirect, gate DARS on verification
The verification popup was opened after the /start round-trip, by which
point the click's user activation is spent — iOS Safari blocks it outright,
so mobile customers could never verify. Replace the popup with a full-page
redirect: the panel stashes {subject, returnTo} in sessionStorage and
navigates the tab to eSignet, and /callback completes the code+state
exchange itself before returning the user where they were.

This drops the postMessage listener, the popup-closed poller and the
pop-up-blocked branch. onVerified goes with them: the app boots fresh on
the way back, so the target page refetches rather than being pushed to.

Hide the DARS delegation upload until the PoA is Fayda-verified. The paper
authorises the representative the verification names, so it has nothing to
authorise before one exists — and it has to stop being required while
hidden, or the save blocks on a control the customer cannot see. Freight
forwarders are still held to having a PoA by the step's verification gate
and by the API. This also removes the one thing the redirect could not
carry across: a staged File cannot be serialised to sessionStorage, and
there is now never one pending before verification.

Unsaved text typed since the last step-save is still lost on redirect; the
wizard's per-step persistence covers everything already advanced past.
2026-08-04 12:43:25 +00:00
ghost2023
3a5126670f fix: centralized on rabbitmq for sms 2026-08-04 15:32:49 +03: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
45216c5624 fix: update payment currency handling to require explicit selection by customer 2026-08-04 11:40:08 +00:00
Marshal
56697d8fc5 implement exchange settings management and fallback rate handling 2026-08-04 11:22:47 +00:00
Hagernesh Tadesse
e55978f1df Merge pull request #1106 from Tria-plc/edrmiles
feat(warehouses): filters, pagination and charts on container returns
2026-08-04 12:56:10 +03:00
Hagernesh
50fab52b1c feat(warehouses): filters, pagination and charts on container returns
Returned-containers list now uses the shared DataTable + useListControls
(search, inclusive date range, status select, pagination) instead of a
hand-rolled table. Adds two charts below the list — returns per day by
truck type and returns by status — driven by the same filtered rows.
Series colors validated for CVD separation and surface contrast.
2026-08-04 09:54:15 +00:00
marshal
5189325a3b Merge pull request #1105 from Tria-plc/dev
Freight Deployment
2026-08-04 12:52:08 +03:00
marshal
5d93017476 Merge pull request #1104 from Tria-plc/freight_feature/usermanagement
add custom contrat templates
2026-08-04 12:51:07 +03:00
Marshal
7c78a815eb add custom contrat templates 2026-08-04 09:48:49 +00:00
Nathnael Wondisha
fafa42f8a6 Merge pull request #1103 from Tria-plc/fixes
Fix: add the payment drain tail
2026-08-04 12:24:10 +03:00
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
Nathnael
a20498fd77 chore: more it test 2026-08-04 08:57:25 +00:00
marshal
1352b46c33 Merge pull request #1102 from Tria-plc/freight_feature/usermanagement
change ewit images
2026-08-04 11:43:01 +03:00
Marshal
aac1175964 change ewit images 2026-08-04 08:42:15 +00:00
Yonas Tewabe
eb972862c1 Create sonar-project.properties 2026-08-04 11:24:43 +03:00
marshal
61c3faa23e Merge pull request #1101 from Tria-plc/freight_feature/usermanagement
allow the custoemr to book while the payment window time
2026-08-04 11:15:02 +03:00
Marshal
2eb752e8c2 allow the custoemr to book while the payment window time 2026-08-04 08:10:00 +00:00
Hagernesh Tadesse
266a3aaf00 Merge pull request #1100 from Tria-plc/edrmiles
fix(bookings): gate export carriage acceptance sheet on GRN receipt
2026-08-04 11:03:57 +03:00
Hagernesh
87b04973d8 fix(bookings): gate export carriage acceptance sheet on GRN receipt
The sheet attests EDR has taken custody. Export custody happens at
warehouse receipt, so the shared received-with-GRN gate now runs even
when wagons are already allocated. Receipt-row query also accepts the
legacy notes GRN fallback, matching the loading gate.
2026-08-04 07:59:39 +00:00
Abubeker Yasin
19ab3af1cb chore: ( iam ) update iam package 2026-08-04 10:56:47 +03:00
Abubeker Yasin
85d5faed34 chore: ( iam ) update iam package 2026-08-04 10:27:59 +03:00
Hagernesh Tadesse
9d5c529be4 Merge pull request #1099 from Tria-plc/edrmiles
CAS
2026-08-04 10:01:29 +03:00
Abubeker Yasin
58febda715 Merge pull request #1098 from Tria-plc/dev
merge staging to dev
2026-08-04 09:58:16 +03:00
Hagernesh
dfc7dfec5a fix(freight): filter container returns by returned-by truck type
Top Returned Containers table ignored the EDR/Customer tab because
the backend never persisted which truck type performed the return.
Added returned_by column + DTO/entity field, wired create payload to
send it, and filtered the table by the active tab.
2026-08-04 06:55:22 +00:00
Hagernesh
5c33ea90bd Truck operations inside each bookings 2026-08-04 06:55:21 +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
05450d4693 add reports module with controller, service, and repository 2026-08-03 22:08:16 +00:00
Marshal
5e8eec9539 add reports module with controller, service, and repository 2026-08-03 21:58:35 +00:00
Marshal
c3979b08b6 add reports module with controller, service, and repository 2026-08-03 21:43:23 +00:00