mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 15:48:11 +00:00
Implement consolidated booking handling and UI updates for shared wagons
This commit is contained in:
@@ -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>
|
||||
);
|
||||
},
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user