diff --git a/apps/edr-freight-api/py/waafi.jpeg b/apps/edr-freight-api/py/waafi.jpeg new file mode 100644 index 000000000..392de36cc Binary files /dev/null and b/apps/edr-freight-api/py/waafi.jpeg differ diff --git a/apps/edr-freight-web/portal/src/pages/bookings/BookingsListPage.tsx b/apps/edr-freight-web/portal/src/pages/bookings/BookingsListPage.tsx index 9a19393c8..4a7643377 100644 --- a/apps/edr-freight-web/portal/src/pages/bookings/BookingsListPage.tsx +++ b/apps/edr-freight-web/portal/src/pages/bookings/BookingsListPage.tsx @@ -449,12 +449,18 @@ export default function BookingsListPage() { const allItems = data?.items ?? []; const total = data?.meta?.total ?? allItems.length; - // Server handles status + pagination; reference search is applied on the page. + // Server handles status + pagination; reference search is applied on the page + // (matches booking reference, contract reference, and route yards). const rows = useMemo(() => { const q = query.trim().toLowerCase(); if (!q) return allItems; return allItems.filter((b) => - [b.reference, b.originYard?.label, b.destinationYard?.label] + [ + b.reference, + b.contractReference, + b.originYard?.label, + b.destinationYard?.label, + ] .filter(Boolean) .some((v) => String(v).toLowerCase().includes(q)), ); @@ -506,6 +512,41 @@ export default function BookingsListPage() { ); }, }, + { + id: "contract", + size: 150, + meta: hMeta, + header: () => , + cell: ({ row }) => { + const ref = row.original.contractReference; + const cid = row.original.contractId; + if (!ref) { + return ( + + — + + ); + } + return ( + { + e.stopPropagation(); + navigate(`/contracts/${cid}`); + } + : undefined + } + > + {ref} + + ); + }, + }, { id: "type", size: 150, @@ -708,7 +749,7 @@ export default function BookingsListPage() { > } value={query} onChange={(e) => setQuery(e.currentTarget.value)} diff --git a/packages/types/src/freight/index.ts b/packages/types/src/freight/index.ts index 705439904..f80f01e23 100644 --- a/packages/types/src/freight/index.ts +++ b/packages/types/src/freight/index.ts @@ -388,6 +388,8 @@ export interface IBooking extends BaseEntity { customerId: string; /** The contract this booking was created under (Path A / Path B). */ contractId?: string | null; + /** Human-readable reference of the parent contract, joined onto list rows. */ + contractReference?: string | null; trainId?: string | null; status: BookingStatus; /** ONE_TIME for normal bookings; GENERAL_CONTRACT for umbrella contracts. */