mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 10:45:44 +00:00
feat(warehouse,last-mile): truck load size rule, dedup last-mile, driver-required + arrival prefill
Truck loading: - loadTruck enforces max 2 containers / one 40ft (two 20ft) and auto-marks an assigned truck arrived on load; container-items payload + modal expose container size with a client-side selection cap. - Show "#x containers pending assignment" in the portal truck card and the backoffice container modal. Last-mile: - create() is idempotent — return the existing record for a booking instead of inserting a duplicate delivery row (fixed the same booking showing twice in Assign-Mile). - setVehicles/update reject a truck with no assigned driver; the Assign toast now surfaces the reason. - New GET /last-mile/booking/:id/arrival-trucks returns assigned EDR trucks with driver details; ReleaseOrderModal fetches and auto-fills them so an assigned EDR truck no longer reads as "not assigned yet". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -666,8 +666,12 @@ const LastMilePage = () => {
|
||||
void qc.invalidateQueries({ queryKey: QUERY_KEYS.LAST_MILE.ROOT });
|
||||
void qc.invalidateQueries({ queryKey: ["vehicles"] });
|
||||
},
|
||||
onError: () => {
|
||||
toast({ title: "Assign failed", variant: "destructive" });
|
||||
onError: (e: unknown) => {
|
||||
// Surface the backend reason (e.g. "Truck … has no assigned driver …").
|
||||
const raw = (e as { response?: { data?: { message?: string | string[] } } })?.response?.data
|
||||
?.message;
|
||||
const description = Array.isArray(raw) ? raw.join(", ") : raw;
|
||||
toast({ title: "Assign failed", description, variant: "destructive" });
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user