Implement consolidated booking handling and UI updates for shared wagons

This commit is contained in:
Marshal
2026-07-03 05:07:23 +00:00
parent bb2cedc87f
commit 75cda22a48
7 changed files with 361 additions and 85 deletions

View File

@@ -20,6 +20,7 @@ import {
import {
AlertTriangle,
ArrowLeft,
ArrowLeftRight,
Boxes,
CalendarDays,
CheckCircle2,
@@ -242,6 +243,25 @@ const BOOKING_COLUMNS: ColumnDef<BatchBoardBookingDetail>[] = [
Gov
</Badge>
) : null}
{b.consolidationPartnerRef ? (
<Tooltip
label={`Consolidated — shares one wagon with ${b.consolidationPartnerRef}`}
withArrow
multiline
maw={260}
>
<Badge
size="xs"
variant="light"
color="edr-green"
radius="sm"
leftSection={<ArrowLeftRight size={10} />}
style={{ textTransform: "none" }}
>
shared wagon · {b.consolidationPartnerRef}
</Badge>
</Tooltip>
) : null}
</Group>
);
},

View File

@@ -277,6 +277,8 @@ export interface BatchBoardBookingDetail extends BatchBoardBooking {
selectedForBatchAt: string | null;
allocationStatus: BookingAllocationStatus;
allocationIssue: string | null;
consolidationPartnerId: string | null;
consolidationPartnerRef: string | null;
}
export interface BatchWindowGroup {

View File

@@ -197,6 +197,15 @@ export function BookingPaymentPanel({
: priceTotal(pricing);
const items = priceLineItems(pricing);
// Consolidation: this shipment shares a wagon with a partner booking, and the
// wagon is only scheduled once both partners have paid. Surface a note while
// payment is still pending (pay-window open, or a deadline set and not paid).
const showConsolidationNote =
!paid &&
Boolean(booking.consolidationPartnerId) &&
(booking.status === "SELECTED_FOR_BATCH" ||
Boolean(booking.paymentDeadline));
const { data: invoices = [] } = useQuery({
queryKey: ["booking-invoices", booking.id],
queryFn: () => invoicesService.listForSource("booking", booking.id),
@@ -268,6 +277,12 @@ export function BookingPaymentPanel({
onPay={onPay}
paying={paying}
/>
{showConsolidationNote && (
<Text mt={12} fz="12px" c="#9AA8B5" lh={1.5}>
This shipment shares a wagon with a consolidation partner both
shipments must be paid for the wagon to be scheduled.
</Text>
)}
<Divider />
</Box>
)}