Commit Graph

1359 Commits

Author SHA1 Message Date
Marshal
668b5e1c9d add permissions and fix issues 2026-07-23 20:24:20 +00:00
Marshal
40f16f3cec changes 2026-07-23 14:30:49 +00:00
Marshal
127676055b changes 2026-07-23 14:18:24 +00:00
Marshal
15a6bab5d0 revert back the clerance payment 2026-07-23 13:54:09 +00:00
Marshal
13609f8d59 changes 2026-07-23 11:06:10 +00:00
Marshal
1576fcdc45 fix configratio 2026-07-23 06:21:51 +00:00
Marshal
129a4d1d0a implement freight permissions for trains, wagons, and routes 2026-07-23 05:57:14 +00:00
Marshal
2481f43f1f add e2e test 2026-07-22 23:44:32 +00:00
Marshal
b0f561a935 Add end-to-end tests for import corridor flows
- Implement full train import journey with six container bookings filling a 54-wagon train.
- Create tests for split offer and rebooking scenarios, handling payment expiry and waiting list promotions.
- Add tests for handling waiting bookings expiration when the train is full.
- Implement tests for reopening booking windows after expired reservations.
- Seed database with necessary corridor data for import flows, including yards, container types, locomotives, and rates.
2026-07-22 21:02:17 +00:00
Marshal
5709801590 enhance shipment form and booking process 2026-07-22 17:25:01 +00:00
Marshal
2aa405d8e4 chnages 2026-07-22 11:04:17 +00:00
Marshal
996df4a7f8 chnages 2026-07-22 10:52:27 +00:00
Marshal
b5546b9d6f feat(freight-me): add position type lookup and enrich user profile with position type 2026-07-22 08:57:47 +00:00
Nathnael Wondisha
0fb8eba4df Merge pull request #899 from Tria-plc/freight/feat/fixes-v1
Freight/feat/fixes v1
2026-07-22 11:02:11 +03:00
Nathnael
16dc143e66 fix: the invoice and receipt documents in the booking 2026-07-22 08:00:38 +00:00
Nathnael
82c5fb88dc fix: type errors 2026-07-22 07:29:16 +00:00
Nathnael
1da08131ea fix: merge 2026-07-22 07:26:25 +00:00
Hagernesh
19906b273e fix(operations): prefill booking context on single assign; enforce per-truck container loads
- single-row Assign vehicle uses the full single-record flow (details + containers)
- release() rejects exit containers not assigned to the departing truck
- weighing modal offers only the selected truck's assigned containers
2026-07-22 07:24:14 +00:00
Nathnael
8d4b133277 fix: port 2026-07-22 07:20:51 +00:00
Nathnael
179d6eea9e Merge branch 'dev' into freight/feat/fixes-v1 2026-07-22 07:20:08 +00:00
Nathnael
82cb5508cc chore: rm the active company profile 2026-07-22 06:43:05 +00:00
marshal
03dfc2df09 Merge pull request #892 from Tria-plc/freight_feature/usermanagement
refactor(train-scheduling): rename and restructure container movement…
2026-07-22 02:49:59 +03:00
Marshal
ed3c8307bb refactor(train-scheduling): rename and restructure container movement logic 2026-07-21 23:49:10 +00:00
marshal
d683f6da9c Merge pull request #891 from Tria-plc/freight_feature/usermanagement
feat(user-management): implement staff reference permissions for vari…
2026-07-22 02:29:55 +03:00
Marshal
d25612c2f0 feat(user-management): implement staff reference permissions for various controllers and update sidebar permissions 2026-07-21 23:25:43 +00:00
marshal
8927f38bfe Merge pull request #890 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-22 02:17:00 +03:00
Marshal
835c9e111c feat(train-scheduling): implement container movement between wagons
- Added functionality to move containers between wagons in the train scheduling system.
- Introduced  API endpoint and service method to handle container movement.
- Updated  component to support drag-and-drop for rearranging containers.
- Enhanced  to allow moving containers to other wagons via a context menu.
- Implemented UI feedback for container movement actions, including loading states and success/error notifications.
- Updated relevant types and constants to accommodate new container movement logic.
- Added tests for the rule engine to ensure proper handling of hazardous bookings.
2026-07-21 23:02:06 +00:00
Hagernesh
b54cb2483e Card called GET /warehouse-inventory (staff perm) → 403 swallowed as
empty state. New customer-safe bookings/:id/location endpoint returns
location fields only; card now uses it.
2026-07-21 14:15:56 +00:00
Hagernesh
89d82f45c6 fix padding on portal 2026-07-21 14:01:10 +00:00
Marshal
00a81fda15 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight_feature/usermanagement 2026-07-21 13:24:21 +00:00
Marshal
42e5dd3a26 changes 2026-07-21 13:24:05 +00:00
marshal
ca8a7602ef Merge pull request #876 from Tria-plc/freight_feature/usermanagement
changes
2026-07-21 15:15:19 +03:00
Marshal
07c390a3b2 changes 2026-07-21 12:14:47 +00:00
Nathnael
d95af0ea72 style: show the profile and the review ont the settings 2026-07-21 12:13:18 +00:00
Hagernesh
86569f7490 Customer portal card displays warehouse location data (warehouse/yard/zone + arrival time) once cargo arrives at warehouse. Shows loading state during fetch, placeholder text if not yet received. Type-check passes. 2026-07-21 11:55:18 +00:00
Hagernesh
ed503f1e6b feat(portal): show warehouse location for arrived cargo
Display cargo warehouse location (warehouse, yard, zone, arrival time) on
the portal booking detail page once the cargo has been received and
assigned to a warehouse location.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-21 11:55:18 +00:00
Hagernesh
1fae0752a0 Ticket: Warehouse dashboard Needs Attention cards — fix trucks-on-site aging counters (EDR trucks, UNLOADED status) and make each card open the exact list behind its count via new inventory drill-down filters. 2026-07-21 11:03:40 +00:00
Hagernesh
b616f520ae feat(fleet): validate vehicle plate numbers against a letters-and-digits format
Plate, power-plate and trailer accepted any free text — a vehicle could be
saved with a plate of "assadasd". They must be letters, a hyphen, then digits,
like ET-9875 or AA-8642.

The server now enforces it on CreateVehicleDto (and UpdateVehicleDto via
PartialType): each plate is trimmed and upper-cased, then matched against
^[A-Z]{2,3}-\d{2,6}$, so "et-9875" is accepted and stored as ET-9875 while an
empty optional trailer/power plate still passes.

The fleet form gains the same check inline: FleetFormFieldDef takes an optional
pattern, the dialog tests it on submit against the upper-cased value, and the
vehicle config points plate and trailer at a regex that mirrors the server's.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 11:03:40 +00:00
Marshal
9ca4075c1e Implement intercity document handling and rejection notes for contracts 2026-07-21 10:39:21 +00:00
Marshal
6f8456631c Implement intercity document handling and rejection notes for contracts 2026-07-21 10:20:36 +00:00
Marshal
ceb32e0a80 Implement intercity document handling and rejection notes for contracts 2026-07-21 10:15:18 +00:00
Hagernesh
92a0cc197b feat(fleet): make the dashboard stat cards link to their detail
The four headline cards — total vehicles, drivers, fuel spend, maintenance —
were static numbers with no way through to the list behind them. Each now takes
an optional href and, when set, wraps in a link to its detail page (vehicles,
drivers, fuel purchases, maintenance). A card without an href stays exactly as
before. The Card is wrapped rather than turned into a link so Mantine's Card
typing stays clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 09:22:47 +00:00
Hagernesh
64a4bcbd5c feat(warehouse): make the ops KPI cards link to their detail
The dashboard counters were static — "Trucks on-site" showed a number with no
way to open the list behind it, same for the others. KpiStrip now takes an
optional href per item: a cell with one becomes a link (pointer, hover tint,
aria-label) and a cell without one stays exactly as before, so every existing
strip is unaffected.

The warehouse ops strip wires each card to its detail: trucks on-site to the
Trucks on Site page, received-today and pending-inspection to the inventory
board filtered to RECEIVED, items-aging to the inventory board.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 09:22:46 +00:00
Nathnael
649316070d fix(otp): fall back to email for foreign phone numbers
The SMS gateway is domestic-only, but OTP sends fanned out to any phone
on the account - a foreign number meant a code queued into the void
while the response claimed success. isDomesticPhone (+2519/+2517 E.164)
now gates SMS: dual-channel sends with a foreign phone go email-only
(the phone stays on the row so verify still matches it), and a
phone-only foreign target still tries SMS as the only route. The
staff-triggered reset exposes phoneIsDomestic so the backoffice disables
the SMS channel with an explanation, and the API refuses the channel
directly for foreign numbers.

EDRFREIGHT-186
2026-07-21 09:09:45 +00:00
Nathnael
4afffca3d2 fix(companies): honest status errors and per-role suspension visibility
A suspended customer trying to create a contract was told their account
was "awaiting approval" - the guards collapsed every non-active status
into the pending message. Contract and booking creation now go through a
shared assertCompanyActiveFor that names the real company status, and
the per-role guard names the role's actual state (suspended,
blacklisted, rejected - with the reviewer note) so a customer suspended
for one operation knows the others still work.

Portal: the operation dropdown gets a Suspended badge, the block modal a
suspended branch quoting the staff message, and the wizard a
suspended/blacklisted gate instead of falling through to a submit error.

EDRFREIGHT-234
2026-07-21 09:09:34 +00:00
Nathnael
c8f932f5d5 feat(companies): require and deliver a staff message on suspend/reactivate
Staff could suspend or reactivate a customer role with one silent click:
no reason captured, nothing stored, and the customer was never told.
The API now rejects a suspend or reactivate without a non-empty note,
keeps the note in reviewNote while suspended, and sends the customer an
SMS/email/in-app notification quoting the staff message. In the
backoffice the reject-note modal is generalised into a decision modal
shared by reject, suspend and reactivate, so all three force a message.

EDRFREIGHT-188
2026-07-21 09:09:15 +00:00
Nathnael
4f6a559ae3 feat(portal): reviewer note and resubmit for rejected roles in settings
A customer whose role was rejected saw only a bare "Rejected" chip in
settings - the reviewer's note and the resubmit action existed solely
inside the contract wizard's block modal, so fixing and reapplying from
the profile page was impossible. The settings role card now shows the
reviewer note (for suspended roles too) and offers "Resubmit for
approval", which flips the role back to Pending and notifies the
backoffice through the existing roleReapplied inbox event.

RoleCard's locked variant now renders as a plain box instead of a
button so it can host the action button (buttons cannot nest) and the
new detail line.

EDRFREIGHT-233
2026-07-21 09:09:04 +00:00
Nathnael
d76d198a18 fix(companies): default customer list to review-queue ordering
Marketing asked for approval requests to surface in order instead of the
alphabetical default. New sortBy=review tiers the list by what needs
action - submitted applications awaiting first approval, then approved
customers with a pending change request, then everyone else (drafts
included) - newest first within each tier. Exposed as the backoffice
"Needs review first" sort option and made the default on both ends.

EDRFREIGHT-232
2026-07-21 09:08:53 +00:00
Marshal
603537a20b add yard distances management to rule engine
- Introduced new yard distances resource with CRUD operations.
- Created migration for yard distances table with necessary constraints.
- Implemented service and repository for yard distances handling.
- Added controller for API endpoints to manage yard distances.
- Updated rule engine configuration to include yard distances.
- Enhanced rule engine resource page to support yard distance selection.
- Updated contracts and train builder pages to handle new yard distance logic.
- Added error handling utility for better error message extraction.
2026-07-21 08:50:50 +00:00
Hagernesh
2397c6bca4 fix(warehouse): show assigned trucks on the Trucks on Site page, not only arrived ones
The page filtered on arrived_at IS NOT NULL, so a truck appeared only once the
warehouse receive flow stamped its arrival. Assigned trucks that had not yet
reached the yard were invisible, which left the page empty whenever nothing had
been received — every assigned truck was missing.

It now lists every truck assigned to a booking that has not departed, from both
haulage paths, tagged INBOUND (assigned, not yet arrived) or ON_SITE (arrived).
A scope toggle filters between them, dwell time shows only once a truck has
actually arrived, and the KPI count on the dashboard stays strict (arrived only).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 08:24:39 +00:00