Commit Graph

4068 Commits

Author SHA1 Message Date
mulish77
6c36e2d0ef Update main.ts 2026-07-28 16:19:53 +03:00
mulish77
0e8c6e0345 Update main.ts 2026-07-28 16:18:07 +03:00
Muluhabt
0dfb0cbe28 Fixing the round trip disabling dates 2026-07-28 16:12:44 +03:00
Nathnael
9c16579f54 fix(backoffice): scope unit-admin role matching to the selected org (EDRFREIGHT-223)
getAdminRoleInfo picked a user's unit_admin role by role key alone —
a unit-admin grant carries only a unitId, no organizationId, so a user
who is unit-admin in one org and (say) org-admin in another had the
wrong unit attached to their row wherever both orgs share the viewer's
admin list. That wrong unitId then flowed into the remove action,
which deletes by exact {userId, roleId, unitId} match — a legitimate
0-match, surfaced as "user_role_not_found", removal silently failing.

Fetches the selected org's unit ids (same pattern as the position-type
form's org→units scoping) and requires the unit-admin grant's unitId
to be one of them before treating it as this org's grant.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-28 12:36:01 +00:00
Nathnael
f39ae77401 fix(backoffice): map raw IAM error codes to friendly messages (EDRFREIGHT-223, EDRFREIGHT-225)
@tria-plc/iamapi-common throws BadRequestException with a raw,
untranslated code as the message (e.g. "user_role_not_found",
"unit_employee_limit_reached:5") — useErrorHandler's extractMessage
returned that string verbatim, so removing an org/unit admin whose
role row didn't match, or inviting past a unit's employee cap, toasted
the raw backend code instead of an explanation. Adds a small code→i18n
map checked before the raw-message fallback, shared by both the async
and sync error handlers so every caller (org-admin removal, employee
invites, etc.) picks it up for free.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-28 12:28:11 +00:00
Nathnael
b1cb149c44 feat(backoffice): add organization admin permission assignment page (EDRFREIGHT-242)
There was no UI to assign permissions to the Organization Admin role,
even though the backend's Role→Permission endpoints
(@tria-plc/iamapi-common's role-permissions routes) were already live
and unused. Adds a dedicated page — application picker + the existing
permission checklist — that assigns/reads permissions for the fixed
Organization Admin role, linked from the Organization Admins page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-28 12:27:44 +00:00
Nathnael
c2375a5306 fix(backoffice): scope copy-permissions-from to the selected unit (EDRFREIGHT-308)
The "Copy Permissions From" dropdown in the position-type form only
filtered candidates by the selected organization's full unit set,
ignoring the form's own "Select Unit" field entirely — so switching
units never re-scoped the list, unlike the equivalent unit filter on
the position-management table.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-28 12:27:14 +00:00
Abubeker Yasin
722c2feed2 Merge pull request #998 from Tria-plc/dev
Merge
2026-07-28 15:01:22 +03:00
Nathnael Wondisha
8309483d8f Merge pull request #996 from Tria-plc/freight/fix/auth-separation
feat(auth): add login audience middleware (EDRFREIGHT-415)
2026-07-28 13:52:42 +03:00
marshal
3e828d3a3b Merge pull request #997 from Tria-plc/freight_feature/usermanagement
let customers dispute booking duty/tax advice so GL Ethiopia can re-a…
2026-07-28 13:49:47 +03:00
Marshal
891311d861 let customers dispute booking duty/tax advice so GL Ethiopia can re-advise 2026-07-28 10:48:27 +00:00
Nathnael
e823874d39 feat(auth): add login audience middleware (EDRFREIGHT-415) 2026-07-28 10:46:55 +00:00
mulish77
e108e3624b Merge pull request #995 from Tria-plc/dev
Fixing Cors issues
2026-07-28 13:41:48 +03:00
mulish77
881f7e1e56 Merge pull request #994 from Tria-plc/tests
Fixing cors issue in produciton
2026-07-28 13:37:53 +03:00
Muluhabt
83137ea0ef Fixing cors issue in produciton 2026-07-28 13:37:10 +03:00
Abubeker Yasin
7e1727a7bf Merge pull request #993 from Tria-plc/alpha
fix: ( bookings ) require explicit tickets:generate to issue reservat…
2026-07-28 12:19:47 +03:00
Abubeker Yasin
ed09bfd8b6 fix: ( bookings ) require explicit tickets:generate to issue reservations 2026-07-28 12:18:25 +03:00
marshal
9911d862f7 Merge pull request #992 from Tria-plc/freight_feature/usermanagement
Pre-declaration Djibouti GL assignee request flow
2026-07-28 12:17:50 +03:00
Marshal
e1c831211f Pre-declaration Djibouti GL assignee request flow 2026-07-28 09:01:23 +00:00
mulish77
6a33544e93 Merge pull request #990 from Tria-plc/dev
Issues fix for production
2026-07-28 11:55:15 +03:00
Abubeker Yasin
7276c9881f Merge pull request #991 from Tria-plc/alpha
Alpha
2026-07-28 11:41:33 +03:00
Abubeker Yasin
0d46f3715e fix: ( payments ) bounce D-Money checkout via /go and follow user domain 2026-07-28 11:39:48 +03:00
Abubeker Yasin
686350135d refactor: ( payment ) allow payment change based on platform change 2026-07-28 10:42:02 +03:00
marshal
2d8b9203d5 Merge pull request #989 from Tria-plc/freight_feature/usermanagement
update body-parser implementation to use Nest's API and improve depe…
2026-07-28 10:25:05 +03:00
Marshal
653d5782ee update body-parser implementation to use Nest's API and improve dependency handling 2026-07-28 07:21:04 +00:00
mulish77
b14c1e9ad8 Merge pull request #988 from Tria-plc/tests
fix(bookings): apply promo discount to client-subtotal totals in gues…
2026-07-28 09:58:39 +03:00
Muluhabt
acd4b37d59 fix(bookings): apply promo discount to client-subtotal totals in guest/authenticated booking
createGuestBooking (ONE_WAY) and createGuestRoundTripBooking overwrote the
authoritative discounted total with an undiscounted client-provided subtotal
(per-seat sum or reviewedTotalMinor) whenever one was present, silently
dropping a valid promos discount at booking-creation time, even though the
same promo was correctly applied in the fare-breakdown/quote step. Only the
no-client-subtotal fallback branch subtracted discountMinor.

Mirrors the existing usedClientSubtotal fix already present in
BookingsService.createOneWayBooking (H-13): subtract discountMinor from the
client subtotal before storing it, in ETB and display currency. TRANSIT and
ROUND_TRIP_TRANSIT were unaffected since neither overrides with a client
subtotal.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-28 09:42:27 +03:00
Abubeker Yasin
99838aa8b6 Merge pull request #987 from Tria-plc/alpha
Alpha
2026-07-28 09:36:03 +03:00
marshal
646a029d1a Merge pull request #986 from Tria-plc/freight_feature/usermanagement
update body-parser implementation to use Nest's API and improve depe…
2026-07-28 09:34:01 +03:00
Marshal
7fcf3a7084 update body-parser implementation to use Nest's API and improve dependency handling 2026-07-28 06:33:26 +00:00
Abubeker Yasin
236d55580a fix: ( bookings ) restrict reservation issuance to admins 2026-07-28 09:31:01 +03:00
mulish77
3646f4cfb8 Merge pull request #985 from Tria-plc/tests
fix(search): compute next-day date bound with real arithmetic, not st…
2026-07-28 09:30:13 +03:00
Muluhabt
1d6f89df29 fix(search): compute next-day date bound with real arithmetic, not string padding
Searching on the last day of a month (e.g. 2026-07-31) built an invalid
"next day" string like "2026-07-32" for the Prisma date-range filter,
crashing POST /search with a PrismaClientValidationError in production.
Affected searchSchedules, searchAlternatives, classifyEmptySearch, and
searchTransitOptions — all four built the bound the same way.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-28 09:28:34 +03:00
marshal
161bdfff71 Merge pull request #984 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-28 09:21:12 +03:00
Marshal
c1c35e78d4 increase JSON body size limit, update awaiting shipment endpoint handling, and enhance contract document editor UI 2026-07-28 06:18:04 +00:00
Marshal
8319aad5c3 increase JSON body size limit, update awaiting shipment endpoint handling, and enhance contract document editor UI 2026-07-28 06:16:56 +00:00
marshal
bd3ff193d6 Merge pull request #983 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-28 08:58:28 +03:00
Marshal
f40a079420 update contract document handling and improve clarity in UI messages 2026-07-28 05:51:24 +00:00
Marshal
8477de41a9 changes 2026-07-28 05:10:01 +00:00
marshal
f47a99c034 Merge pull request #982 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-28 08:03:48 +03:00
Marshal
2429f6b629 implement contract cancellation feature and update contract statuses
- Added functionality to cancel contracts, allowing users to provide a reason for cancellation.
- Updated contract statuses to include SUSPENDED and changed CLOSED to COMPLETED.
- Enhanced the UI to reflect the new cancellation option and updated messaging for contract statuses.
- Refactored contract booking actions to accommodate changes in booking logic for ONE_TIME and GENERAL contracts.
- Removed clearance document management from the contract detail page, as it is now handled per booking.
- Introduced a SQL script to reset bookings and train schedules for development purposes.
2026-07-28 05:02:58 +00:00
Marshal
481878e553 paginate wagons, locomotives and routes lists server-side 2026-07-27 21:27:36 +00:00
marshal
260a3b1198 Merge pull request #981 from Tria-plc/freight_feature/usermanagement
update locaomotive and fix wagon transfer issue
2026-07-27 23:55:12 +03:00
Marshal
496c66017f update locaomotive and fix wagon transfer issue 2026-07-27 20:34:14 +00:00
marshal
691195c9f9 Merge pull request #980 from Tria-plc/freight_feature/usermanagement
fix: correct column name in orderBy clause for listRequests method
2026-07-27 17:49:35 +03:00
Marshal
deadc59277 fix: correct column name in orderBy clause for listRequests method 2026-07-27 14:44:16 +00:00
Abubeker Yasin
f6084d8c80 Merge pull request #979 from Tria-plc/dev
merge to alpha
2026-07-27 16:22:12 +03:00
mulish77
b0e3acad2a Merge pull request #978 from Tria-plc/tests
Fixing build issues
2026-07-27 15:30:56 +03:00
Muluhabt
11e6d226df Fixing build issues 2026-07-27 15:30:28 +03:00
mulish77
7695bae1f1 Merge pull request #977 from Tria-plc/tests
Adding train delay minutes and also disabling no schedule days in the…
2026-07-27 15:11:00 +03:00