mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 02:28:18 +00:00
feat(booking-trucks-tab): show truck-level detention, gate times, inspection status, and cargo costs
Booking detail now has a Trucks tab displaying every EDR or customer truck assigned to a booking's last mile. Each row shows warehouse-gate times (arrival/departure) and destination-detention times (arrival/return), with detention costs and inspection status. Detention rows only for EDR trucks; customer self-haul shows —. Reuses existing TruckDetentionModal and FeePreviewModal for edit/view actions. Backend: arrivalTrucksForBooking() adds lastMileId per truck (direct chain to detention preview), containerItems() adds inspection_status column to responses. No new SQL, no migrations, no new endpoints. Frontend: BookingTrucksPanel.tsx self-fetches all data via existing warehouse + last-mile services, renders adaptive table with cargo-cost strip above. Wired into BookingRequestDetailPage.tsx tab bar.
This commit is contained in:
@@ -91,6 +91,7 @@ export interface ContainerItem {
|
||||
contractId: string | null;
|
||||
hasLastMile: boolean;
|
||||
handoverSigned: boolean;
|
||||
inspectionStatus: string | null;
|
||||
}
|
||||
|
||||
/** A pre-dispatch EXPORT train that has inventory waiting to be loaded. */
|
||||
@@ -136,6 +137,8 @@ const cleanParams = (params: object) =>
|
||||
|
||||
/** An assigned EDR last-mile truck, shaped for the arrival/exit weighing prefill. */
|
||||
export interface LastMileArrivalTruck {
|
||||
/** The last-mile leg this truck belongs to — feed straight into lastMileService.truckDetentionPreview(lastMileId). */
|
||||
lastMileId: string;
|
||||
vehicleId: string;
|
||||
truckPlateNumber: string | null;
|
||||
trailerPlateNumber: string | null;
|
||||
|
||||
Reference in New Issue
Block a user