Commit Graph

1546 Commits

Author SHA1 Message Date
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
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
3a2f1a46d6 fix(auth): resolve position-type permissions so GL staff can open clearance pages 2026-08-06 13:24:42 +00:00
Nathnael
ab7069e335 fix 2026-08-06 10:26:32 +00:00
Nathnael
23e756e0c7 fix(billing): ceil CBE invoice amounts to whole birr 2026-08-06 09:16:01 +00:00
Hagernesh
95fad6f095 Bulk (per ton per km) last-mile rates now carry From/To km bands like
container mode: the Add Rate dialog offers the multi-tier editor in both
modes, each tier is created as its own rate row, and overlapping bulk
bands are rejected. Pricing picks the tier whose half-open band holds
the trip km, falling back to the legacy bandless bulk rate.
2026-08-06 08:56:35 +00:00
Hagernesh
69f6fd36a9 fix(rates): render stored rate currency, default last mile to birr
The rate matrix currency cell hardcoded USD, so a last-mile rate
priced in ETB still displayed as dollars. formatCell now takes the
row and reads its currency code, falling back to USD.

Last-mile currency select gets defaultValue ETB (new generic
FormFieldDef.defaultValue for create-time pre-selection) and lists
ETB (Birr) first; USD stays selectable. Backend already persisted
and validated the chosen currency.
2026-08-06 08:56:35 +00:00
Hagernesh
4786c896b5 feat(last-mile): customer-signed LM contract gates the advance invoice
Approval now snapshots the rate estimate and generates a last-mile
contract instead of invoicing immediately. The customer picks a delivery
date on the confirm form, then reviews and signs the contract in the
portal (saved signature or drawn); the signed PDF is stored as
LM_<CustomerName>.pdf and only then is the advance invoice issued.
Backoffice shows signature status and the contract download.
2026-08-06 07:11:23 +00:00
Hagernesh
4716aa14c3 feat(rates): multi-tier distance band entry in last-mile rate form
- tierList field type in rule-engine form dialog (add/remove rows,
  overlap + open-ended validation, From km auto-continues)
- create submits one rate row per tier sequentially
- editing a band row keeps the single From/To/value form
2026-08-06 07:11:23 +00:00
Nathnael Wondisha
7f90ccc1b5 Merge pull request #1135 from Tria-plc/staging
Staging
2026-08-06 08:37:23 +03:00
marshal
5ba414db00 Merge pull request #1134 from Tria-plc/freight_feature/usermanagement
add metadata to ignore audit logging in payment events
2026-08-06 01:28:56 +03:00
Marshal
5933795116 add metadata to ignore audit logging in payment events 2026-08-05 22:26:04 +00:00
Hagernesh
5c8c68e990 feat(rates): last-mile rate rules with bulk per-ton-km and container distance bands
- rates: min_km/max_km columns, PER_TON_KM unit, ETB|USD currency for last mile
- extend UQ_rates_pattern with band start; overlap + shape validation
- shared last-mile charge resolver; approve-dialog price estimate endpoint
- delivery-fee invoice prices via rules, falls back to vehicle price/km
- backoffice: last-mile rate form (mode, container type, band, currency)
2026-08-05 22:13:42 +00:00
marshal
6125f644b1 Merge pull request #1131 from Tria-plc/freight_feature/usermanagement
feat(billing): enhance invoice payment processing and revert handling
2026-08-05 23:55:18 +03:00
Marshal
8089e5cfd9 feat(billing): enhance invoice payment processing and revert handling
feat(bookings): add event handlers for booking invoice payment processing
fix(bookings): include PAYMENT_VERIFICATION_IN_PROGRESS status in queries
fix(train-scheduling): update status checks to include PAYMENT_VERIFICATION_IN_PROGRESS
feat(notifier): notify customers when a train is cancelled
2026-08-05 20:46:44 +00:00
Hagernesh
1ee941c0df feat(mile): auto-estimate first/last-mile km from yard GPS to customer point 2026-08-05 20:30:17 +00:00
Hagernesh
334236aa10 feat(rule-engine): add yard_locations table, seed 5 facility yard GPS coords 2026-08-05 20:16:25 +00:00
marshal
ca109d88d2 Merge pull request #1128 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-08-05 23:05:39 +03:00
Marshal
1b5f364294 feat(fleet): add permanent delete option to FleetRecordActions 2026-08-05 20:05:05 +00:00
Hagernesh
1f4d659ffb Last mile confirmation request , approval, payment Feature 2026-08-05 20:01:48 +00:00
Nathnael
2133d6a574 fix: fitler out the client side request 2026-08-05 14:23:00 +00:00
Nathnael
595c165820 feat: implement audit logs 2026-08-05 14:17:00 +00:00
Nathnael
d5622ed360 chore: install auditlog pkg 2026-08-05 13:39:45 +00:00
Nathnael
4f08b370e1 Merge branch 'dev' into freight/nati-2 2026-08-05 13:27:10 +00:00
Nathnael
8476a6a00e fix: the fayda and etrade syncing 2026-08-05 13:06:56 +00:00
Marshal
b7dcc1bf0a feat(billing): add PAYMENT_PROCESSING invoice status on payment success redirect (all except CBE bill) 2026-08-05 12:59:37 +00:00
marshal
26837d5a7d Merge pull request #1120 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-08-05 13:08:23 +03:00
ghost2023
1515667158 fixup 2026-08-05 11:39:45 +03:00
ghost2023
41f2fd8333 fix: extension ensure 2026-08-05 11:10:52 +03:00
ghost2023
97eca6bed9 chore: squash the freight migration 2026-08-05 10:46:02 +03:00
ghost2023
eb0f071d89 Merge branch 'dev' into fixes 2026-08-05 10:29:58 +03:00
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
772c5245b0 Merge pull request #1113 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-08-04 20:31:16 +03:00
ghost2023
9485e7e9cf fix: exchange moduel regsiter 2026-08-04 17:49:37 +03:00
ghost2023
969f626d4a Merge branch 'dev' into fixes 2026-08-04 17:38:13 +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
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
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
56697d8fc5 implement exchange settings management and fallback rate handling 2026-08-04 11:22:47 +00:00