Commit Graph

4234 Commits

Author SHA1 Message Date
Nathnael
50b842b002 fix(auth): make contract template reads staff-only
The comment claimed reads were open to authenticated staff, but no guard
enforced it, so customers could list templates and render previews. The
backoffice Templates tab is the only consumer.
2026-08-07 07:47:44 +00:00
Nathnael
820010a732 chore(deploy): grant companion view keys in mapping SQL
Position types holding only an action key are denied by their module's
class-level view guard, so grant the matching <module>:view alongside
every action key a type already holds.
2026-08-07 07:41:01 +00:00
Nathnael
d4917bc6ec feat(auth): regate payment, booking and wagon reads
Payment summary/all moved off bookings:view onto payments:view, the
booking list now requires bookings:view for staff instead of accepting
any employee, and wagon reads require wagons:view or fleet:view rather
than bare authentication.
2026-08-07 07:41:00 +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
87e2edcbde fix(auth): stop class guards shadowing route permission keys
Nest runs class and method guards together, so a class-level view key
ANDs with every action key below it. Staff granted only an action were
denied before their key was ever checked: OCC could not fulfil wagon
transfers, dispatchers could not create a yard, and track staff could not
assign first/last-mile vehicles. Reads now carry the view key themselves,
and the warehouses baseline lists every key its routes use.
2026-08-07 07:40:50 +00:00
Nathnael
2a0810e734 chore(deploy): add position-type grant mapping SQL
Grants the new granular keys to the position types that hold the broad
key whose routes they took over. Idempotent; run after a seeded boot.
2026-08-07 07:32:25 +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
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
Nathnael
b0d5b2191f feat(auth): seed granular permission keys, retire unused ones
Adds the support, procurement, compliance, facilities, trade-access,
overview, reports and staff-users keys, plus the split action keys for
bookings, contracts, train scheduling and settings. Retires eight seeded
keys that no feature ever enforced, revoking their grants first.
2026-08-07 07:32:25 +00:00
Nathnael
79fec14c9a feat(auth): deny by default with employee/customer audience guards
FreightPermissionGuard now rejects non-employee user types before the key
check, making every BookingStaff route staff-only in one place. Adds
PortalCustomer and MixedAudience for the routes both audiences share, and
stops ServiceAuthGuard failing open when SERVICE_AUTH_TOKEN is unset.
2026-08-07 07:32:25 +00:00
Nathnael
828392dd04 feat: edr help video 2026-08-07 06:57:55 +00:00
Nathnael
30b0eff603 feat: add faq, help, privacy policy and tos 2026-08-06 20:40:05 +00:00
Nathnael
dd2b624aa6 fix: onboarding validation 2026-08-06 18:54:54 +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 Tadesse
eda3a82a6c Merge pull request #1141 from Tria-plc/lastmilerequest
Lastmile Payment in Birr
2026-08-06 11:59:49 +03: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 Tadesse
b4ac92e14e Merge pull request #1140 from Tria-plc/lastmilerequest 2026-08-06 01:19:08 -07:00
Hagernesh Tadesse
a5b89a3aa0 Merge pull request #1139 from Tria-plc/dev
Merge pull request #1138 from Tria-plc/lastmilerequest
2026-08-06 11:15:43 +03:00
Hagernesh Tadesse
4199e48b42 Merge pull request #1138 from Tria-plc/lastmilerequest
Last mile Contract
2026-08-06 10:21:30 +03: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
Stephanos A.
ea9df4407e Merge pull request #1137 from Tria-plc/alpha
Restored EXCESS_BAGGAGE as PaymentReferenceType
2026-08-06 08:58:41 +03:00
Stephanos A
3b49c49e42 Restored EXCESS_BAGGAGE as PaymentReferenceType 2026-08-06 08:54:21 +03:00
Nathnael Wondisha
7f90ccc1b5 Merge pull request #1135 from Tria-plc/staging
Staging
2026-08-06 08:37:23 +03:00
Stephanos A.
ad186ece57 Merge pull request #1136 from Tria-plc/alpha
Excess baggage payment link quick fix
2026-08-06 08:30:33 +03:00
Stephanos A
405ba908c3 Excess baggage payment link quick fix 2026-08-06 08:14:34 +03:00
Stephanos A.
15c4113b28 Merge pull request #1118 from Tria-plc/alpha
Alpha
2026-08-06 07:49:35 +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 Tadesse
9bf776859f Merge pull request #1133 from Tria-plc/lastmilerequest
feat(rates): last-mile rate rules with bulk per-ton-km and container …
2026-08-06 01:14:47 +03: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
8bb8b58185 Merge pull request #1132 from Tria-plc/dev
freight dev
2026-08-06 00:07:26 +03: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
Hagernesh Tadesse
be385e2d32 Merge pull request #1130 from Tria-plc/lastmilerequest
feat(mile): auto-estimate first/last-mile km from yard GPS to custome…
2026-08-05 23:51: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 Tadesse
634e1f3257 Merge pull request #1129 from Tria-plc/lastmilerequest
feat(rule-engine): add yard_locations table, seed 5 facility yard GPS…
2026-08-05 23:19:10 +03: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 Tadesse
d6c5861847 Merge pull request #1127 from Tria-plc/lastmilerequest
Last mile confirmation request , approval, payment Feature
2026-08-05 23:04:52 +03:00
Hagernesh
1f4d659ffb Last mile confirmation request , approval, payment Feature 2026-08-05 20:01:48 +00:00
Stephanos A
bf8906f983 Boarding status update issue fix 2026-08-05 21:32:23 +03:00
marshal
2d87794bf8 Merge pull request #1126 from Tria-plc/freight_feature/usermanagement
clarify replayed CBE payment failure msg
2026-08-05 18:15:36 +03:00
Marshal
1a37b62f24 clarify replayed CBE payment failure msg 2026-08-05 15:14:41 +00:00
marshal
2156f16a29 Merge pull request #1125 from Tria-plc/dev
deploy freight
2026-08-05 17:26:24 +03:00
Nathnael Wondisha
37d0cc966a Merge pull request #1124 from Tria-plc/freight/nati-2
Audit log and presistent cbe pnr
2026-08-05 17:23:54 +03:00
Nathnael
2133d6a574 fix: fitler out the client side request 2026-08-05 14:23:00 +00:00