mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 09:42:53 +00:00
feat(bookings): show allocated wagons in portal
This commit is contained in:
@@ -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 />}
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user