From 4cb4d177d9a93fa11e18c116c6e781efb21b71c9 Mon Sep 17 00:00:00 2001 From: Hagernesh Date: Thu, 30 Jul 2026 06:34:47 +0000 Subject: [PATCH] feat: add truck arrival/departure times to import trucks page Show per-truck warehouse gate arrival (arrivedAt) and departure (departedAt) timestamps on the Import Trucks page, enabling staff to see when each truck entered and exited the warehouse. Times displayed in local format; EDR and customer trucks both supported. Co-Authored-By: Claude Haiku 4.5 --- .../src/pages/warehouses/ImportTrucksPage.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/edr-freight-web/backoffice/src/pages/warehouses/ImportTrucksPage.tsx b/apps/edr-freight-web/backoffice/src/pages/warehouses/ImportTrucksPage.tsx index c82a3e9bb..84d103003 100644 --- a/apps/edr-freight-web/backoffice/src/pages/warehouses/ImportTrucksPage.tsx +++ b/apps/edr-freight-web/backoffice/src/pages/warehouses/ImportTrucksPage.tsx @@ -50,11 +50,14 @@ import type { ImportUnloadedItem } from "@/types/warehouse"; * would be several hundred requests for rows nobody opened. */ -const COLS = 9; +const COLS = 11; const money = (amount: number, currency: string) => `${Number(amount).toLocaleString(undefined, { maximumFractionDigits: 2 })} ${currency === "ETB" ? "ETB" : currency}`; +const formatTime = (iso: string | null | undefined) => + iso ? new Date(iso).toLocaleString() : "—"; + interface BookingGroup { bookingId: string; bookingReference: string; @@ -103,6 +106,8 @@ interface TruckRow { demurrage: number; storage: number; vehicleId: string | null; + arrivedAt: string | null; + departedAt: string | null; } /** @@ -185,6 +190,8 @@ function TruckRows({ group }: { group: BookingGroup }) { truckType: t.truckType, containers, vehicleId: t.vehicleId, + arrivedAt: t.arrivedAt, + departedAt: t.departedAt, ...costsFor(containers), }; }; @@ -197,6 +204,8 @@ function TruckRows({ group }: { group: BookingGroup }) { truckType: t.truckType, containers, vehicleId: null, + arrivedAt: t.arrivedAt ?? null, + departedAt: t.departedAt ?? null, ...costsFor(containers), }; }; @@ -283,6 +292,12 @@ function TruckRows({ group }: { group: BookingGroup }) { {t.containers.length ? t.containers.join(", ") : "Bulk"} + + {formatTime(t.arrivedAt)} + + + {formatTime(t.departedAt)} + {formatNumber(t.weight)} {money(t.demurrage, feeCurrency)} {money(t.storage, feeCurrency)} @@ -431,6 +446,8 @@ export default function ImportTrucksPage() { Plate Type Containers + Truck Arrival + Truck Leaving Weight Demurrage Storage