booking operations and trains scheduling also allocations

This commit is contained in:
marshal
2026-06-10 00:48:32 +03:00
parent 675975bc08
commit 5774d7db9d
180 changed files with 13423 additions and 3877 deletions

View File

@@ -0,0 +1,14 @@
import type { FreightType } from "@/types/trainScheduling";
const isContainerFreight = (freightType?: string | null) => freightType === "CONTAINER";
/** Show container number placement step when train includes container cargo. */
export function shouldShowContainerPlacementStep(params: {
containerUnitCount: number;
scheduleFreightType?: FreightType | string | null;
bookingFreightTypes: Array<FreightType | string | null | undefined>;
}): boolean {
if (params.containerUnitCount > 0) return true;
if (isContainerFreight(params.scheduleFreightType)) return true;
return params.bookingFreightTypes.some(isContainerFreight);
}