Commit Graph

58 Commits

Author SHA1 Message Date
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
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
cf8a2e928d fix(warehouses): detention groups by canonical truck type
Join truck_types via vehicles.truck_type_id (normalized legacy
vehicle_type only as fallback) so type renames can't unmatch detention
rules and FK-less vehicles keep billing.
2026-07-24 11:55:05 +00:00
Hagernesh
61e59036cd Browser testing for modern teams
Create tests, debug failures, and improve quality faster than ever. Get AI-powered guidance at every stage of testing, with full code ownership, on a platform that connects your team.
2026-07-21 12:57:37 +00:00
Hagernesh
c1c362ab9d fix(mile): only send bookings that bought EDR haulage to the mile queues
The rule that a customer's own truck and an EDR road leg are alternatives
existed on the truck side only (CustomerTruckService.assertSelfHaulPaid).
LastMileService had no counterpart: create checked payment and nothing else,
so any paid booking could be accepted into the queue. A booking took a
customer truck at 06:42 and an EDR last-mile leg with a real EDR truck at
06:47, neither side aware of the other, on a contract that had chosen no
road legs at all.

The road legs are chosen on the contract and copied onto the booking, and
the pickup/delivery address is the only per-booking record of that choice.
service_types cannot serve: every type ships with includes_first_mile and
includes_last_mile set to true, so reading them would mean no booking could
ever self-haul. That same always-true flag had already killed the first-mile
guard, whose `address || serviceType.includesFirstMile` admitted every paid
export booking.

One shared rule now answers it for both sides, so the two halves cannot
drift apart again: last-mile create rejects a booking that chose no road
legs and one already carrying a customer truck; first-mile no longer honours
the service-type flag; the customer-truck guard reads the same helper.

Existing legs are untouched — the guards are on creation, so the one booking
already carrying both needs a human to reconcile it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 08:03:16 +00:00
natib21
b300fd1de5 user permition 2026-07-07 10:00:48 +00:00
natib21
42710261e2 fix 2026-07-06 13:49:30 +00:00
natib21
2e31fd12e1 fix 2026-07-04 02:26:19 +00:00
natib21
bd88424167 fix 2026-07-04 01:47:28 +00:00
natib21
6bf7371716 fix 2026-07-04 00:37:36 +00:00
natib21
4994d14002 fix 2026-07-04 00:23:40 +00:00
natib21
1d8f095831 fix 2026-07-03 22:43:45 +00:00
natib21
8661586301 fix 2026-07-03 16:21:07 +00:00
natib21
ed388042af fix 2026-07-03 16:14:33 +00:00
natib21
4ec38bf028 fix 2026-07-03 15:56:28 +00:00
natib21
c643d30624 fix 2026-07-03 15:47:12 +00:00
natib21
0e6ebda6f6 fix 2026-07-03 15:21:23 +00:00
yaschalew
49036abf7f fix 2026-07-02 18:07:21 +03:00
yaschalew
2b7e67b227 fix 2026-07-02 17:56:17 +03:00
yaschalew
8f152466e8 Merge branch 'freight/feature/first_mile_invoice' of github.com:Tria-plc/edr-platform into freight/feature/first_mile_invoice 2026-07-02 17:14:31 +03:00
natib21
c2c29f0735 fix 2026-07-02 14:14:13 +00:00
yaschalew
86b1534ed4 Merge branch 'freight/feature/first_mile_invoice' of github.com:Tria-plc/edr-platform into freight/feature/first_mile_invoice 2026-07-02 16:56:04 +03:00
yaschalew
fb8dcb0217 fix 2026-07-02 16:55:51 +03:00
natib21
7f6c9c6313 fix 2026-07-02 13:55:08 +00:00
ghost2023
df60c4750e fix: warehouse query 2026-07-02 16:32:35 +03:00
ghost2023
b75a3ab54b fix: first-mile error 2026-07-02 16:25:45 +03:00
Marshal
7d3eb39625 fix error 2026-07-02 10:40:31 +00:00
natib21
4519a1d75d fix 2026-07-02 10:33:32 +00:00
yaschalew
10e442deb1 fix 2026-07-02 13:18:49 +03:00
Nathnael Wondisha
e874de25fe Merge pull request #397 from Tria-plc/feight/fix/ui-ux-issues
Feight/fix/UI ux issues
2026-07-02 12:49:07 +03:00
Nathnael
5aafa436c1 fixes 2026-07-02 09:38:14 +00:00
natib21
07abe9b679 fix 2026-07-02 08:51:21 +00:00
yaschalew
54b2114e7f fix issue 2026-07-02 11:28:56 +03:00
natib21
b142552f17 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight/hot_fix 2026-06-30 03:46:26 +00:00
natib21
25e91c6d93 fix: comment out isPostPaymentCompleted column decorator
Column doesn't exist in DB yet. Commenting out @Column decorator
prevents TypeORM from trying to select non-existent column.
Fixes 500 QueryFailedError on first-mile/last-mile list endpoints.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 03:33:54 +00:00
natib21
76b25bd214 fix 2026-06-30 02:33:29 +00:00
natib21
04bc9eded6 fix 2026-06-29 15:28:04 +00:00
natib21
c728b249c2 fix 2026-06-29 14:48:47 +00:00
natib21
6fa315db0f fix 2026-06-29 14:45:22 +00:00
natib21
7dba546254 fix 2026-06-29 13:59:51 +00:00
natib21
a64e531324 fix 2026-06-29 12:15:30 +00:00
natib21
b22ab739db fix 2026-06-29 12:08:16 +00:00
natib21
5c36c09dae fix 2026-06-29 12:01:19 +00:00
natib21
835facc65a fix 2026-06-29 11:12:51 +00:00
natib21
de0e9e8c9c fix status update 2026-06-27 10:29:16 +00:00
natib21
92df6c427c fix 2026-06-27 09:07:28 +00:00
hagiye
15be978c42 Warehouse receiving for export and GRN generation 2026-06-27 04:19:32 +03:00
yaschalew
a8f9fc0445 fix last mile 2026-06-25 12:02:27 +03:00
yaschalew
925754067b last mile 2026-06-25 09:40:52 +03:00
natib21
6cf0ae09f5 fix issue 2026-06-24 14:50:26 +00:00