From b102a31fc1a658077e94ee141f6eed07073c6169 Mon Sep 17 00:00:00 2001 From: Marshal Date: Tue, 14 Jul 2026 13:51:31 +0000 Subject: [PATCH] fix train builder and consolidation --- .../new-booking-form/step8-review.tsx | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step8-review.tsx b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step8-review.tsx index a789943c2..501a04a5d 100644 --- a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step8-review.tsx +++ b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step8-review.tsx @@ -25,10 +25,11 @@ import { } from "lucide-react"; import type { Freight } from "@/types"; import { + calcWagons, type BookingFormInputValues, type BookingFormValues, } from "./schema"; -import { StepHeader } from "./shared"; +import { AlertBox, StepHeader } from "./shared"; export const REVIEW_STEP_TARGETS = { contract: 1, @@ -160,6 +161,12 @@ export function Step8Review({ .join(", ") : ""; + // 20ft containers must pair up (two per wagon) — an odd total blocks submit. + const { hasOddUnit: hasOdd20ft, ft20Wagons: twentyFtCount } = + values.cargoType === "container" + ? calcWagons(values.containers ?? []) + : { hasOddUnit: false, ft20Wagons: 0 }; + const isGeneralContract = values.bookingType === "general_contract"; // Both one-time and general contracts take the bulk amount from the cargo step // (cargoWeight); general contracts no longer collect a per-route quantity. @@ -529,10 +536,27 @@ export function Step8Review({ - - Ready to submit. You'll review the unit rates before final - submission. - + {hasOdd20ft ? ( + + +

+ Odd number of 20ft containers ({twentyFtCount}) +

+

+ 20ft containers travel two per wagon, so they must be booked + in even numbers. Go back to the cargo step and{" "} + add one more 20ft container or{" "} + remove one (e.g. {twentyFtCount + 1} or{" "} + {twentyFtCount - 1} instead of {twentyFtCount}). +

+
+
+ ) : ( + + Ready to submit. You'll review the unit rates before final + submission. + + )}