mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 18:20:57 +00:00
add Group 9 delivery scenarios for self-haul and last-mile paths
- Implemented G9·S38 tests for customer self-haul truck assignments, ensuring compliance with container limits and truck assignments. - Added G9·S39 tests for last-mile delivery, self-haul, and yard pickup, verifying independent paths for multiple bookings on the same train. - Created seed data for Group 1 and Group 2 scenarios, ensuring proper setup for weight and capacity tests. - Updated booking interface to deprecate in favor of for better clarity in allocations.
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import {
|
||||
ActionIcon,
|
||||
Alert,
|
||||
Box,
|
||||
Button,
|
||||
@@ -665,6 +666,17 @@ export default function GlCreateBookingForm() {
|
||||
),
|
||||
);
|
||||
|
||||
// Drop one container row and shrink quantity to match — the inverse of
|
||||
// syncUnits growing the array when quantity goes up.
|
||||
const removeUnit = (lineIdx: number, unitIdx: number) =>
|
||||
setContainerLines((prev) =>
|
||||
prev.map((l, i) => {
|
||||
if (i !== lineIdx) return l;
|
||||
const units = l.units.filter((_, j) => j !== unitIdx);
|
||||
return withDerivedCounts({ ...l, quantity: String(units.length), units });
|
||||
}),
|
||||
);
|
||||
|
||||
// Same client-side validation as the customer portal shipment form
|
||||
// (new-shipment-form/schema.ts): ISO container numbers unique within the
|
||||
// shipment, positive VGM per unit, hazardous/reefer counts bounded by the
|
||||
@@ -1362,6 +1374,8 @@ export default function GlCreateBookingForm() {
|
||||
}
|
||||
onChange={(e) => {
|
||||
patchLine(lineIdx, { quantity: e.currentTarget.value });
|
||||
}}
|
||||
onBlur={(e) => {
|
||||
syncUnits(lineIdx, Number(e.currentTarget.value || 0));
|
||||
}}
|
||||
radius={10}
|
||||
@@ -1495,6 +1509,14 @@ export default function GlCreateBookingForm() {
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
color="red"
|
||||
aria-label={`Remove container ${unitIdx + 1}`}
|
||||
onClick={() => removeUnit(lineIdx, unitIdx)}
|
||||
>
|
||||
<X size={16} />
|
||||
</ActionIcon>
|
||||
</Group>
|
||||
))}
|
||||
</Stack>
|
||||
|
||||
Reference in New Issue
Block a user