Commit Graph

39 Commits

Author SHA1 Message Date
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
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
1d8f095831 fix 2026-07-03 22:43:45 +00:00
natib21
8661586301 fix 2026-07-03 16:21:07 +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
natib21
4519a1d75d fix 2026-07-02 10:33:32 +00:00
yaschalew
10e442deb1 fix 2026-07-02 13:18:49 +03:00
natib21
07abe9b679 fix 2026-07-02 08:51:21 +00:00
natib21
6fa315db0f fix 2026-06-29 14:45:22 +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
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
natib21
f1b9989730 fix 2026-06-24 11:47:02 +00:00
natib21
0e351fa0b4 sms 2026-06-24 10:02:16 +00:00
natib21
9fcbf2783a booking id 2026-06-24 08:33:51 +00:00
natib21
f6ffea2b87 fix return value 2026-06-24 06:38:03 +00:00
natib21
448b7fe969 fix last first mile 2026-06-23 15:18:32 +00:00
natib21
bee47b231a add column 2026-06-22 07:54:07 +00:00
natib21
00d722fa4f last mile 2026-06-22 07:49:47 +00:00