feat(bookings): show allocated wagons in portal

This commit is contained in:
Marshal
2026-08-06 20:40:28 +00:00
parent 4eb0d56faf
commit c61b66fd23
4 changed files with 28 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ import { MileSummaryCard } from "./components/MileSummaryCard";
import { BodyGrid, PageShell } from "./components/layout";
import {
CancelledBanner,
ActionRequiredBanner,
ConsolidationPairedNotice,
ConsolidationWaitingBanner,
} from "./components/Notices";
@@ -162,6 +163,9 @@ export function ReadonlyBookingView({
"DOCUMENTS_UNDER_REVIEW",
"CLEARANCE_READY",
"OPERATION_REQUESTED",
// Operations returned the order — same card hosts the pick-a-new-day +
// resubmit flow.
"OPERATION_CHANGES_REQUESTED",
].includes(status);
// Paired: a consolidation partner was found and the booking resumed the normal
// flow. Surface the "partner found" reassurance only in the early stages,
@@ -234,7 +238,14 @@ export function ReadonlyBookingView({
priceLabel={pricing ? priceTotal(pricing) : undefined}
/>
) : (
<StatusHero booking={booking} />
<StatusHero booking={booking}>
{status === "OPERATION_CHANGES_REQUESTED" &&
booking.latestChangeRequestNote ? (
<ActionRequiredBanner title="Operations requested changes — pick a new shipment day and resubmit.">
{booking.latestChangeRequestNote}
</ActionRequiredBanner>
) : undefined}
</StatusHero>
)}
{showPairedNotice && <ConsolidationPairedNotice />}

View File

@@ -85,7 +85,12 @@ export function ClearanceFlow({ booking, flow, footer }: ClearanceFlowProps) {
return (
<Stack gap={0}>
{isReady ? (
{status === "OPERATION_CHANGES_REQUESTED" ? (
<Alert color="yellow" radius="md" icon={<Clock size={18} />} mb="md">
Operations returned this order for changes. Review their note, pick a
new shipment day below and resubmit.
</Alert>
) : isReady ? (
<Alert color="teal" radius="md" icon={<CheckCircle2 size={18} />} mb="md">
{needsCompletion
? "Clearance is finalized. Complete your booking now — enter the cargo details and pick a shipment day inside an open booking window."

View File

@@ -89,6 +89,12 @@ function actionByStatus(booking: ActionBooking): BookingNextAction | null {
label: "Schedule & proceed",
title: "Schedule your shipment",
};
case "OPERATION_CHANGES_REQUESTED":
return {
kind: "SCHEDULE_OPERATION",
label: "Choose day & resubmit",
title: "Resubmit your shipment",
};
default:
return null;
}

View File

@@ -98,7 +98,10 @@ export function useClearanceFlow(booking: Freight.IBooking) {
[clearance],
);
const isReady = status === "CLEARANCE_READY";
// OPERATION_CHANGES_REQUESTED re-opens the same pick-a-day flow: the
// customer resubmits via the same clearance/proceed endpoint.
const isReady =
status === "CLEARANCE_READY" || status === "OPERATION_CHANGES_REQUESTED";
// Bare initiated instance: created with no cargo and no price; completion
// (cargo + shipment day + window check) happens on the full booking form.
const isBareInstance =