mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 10:10:57 +00:00
booking operations and trains scheduling also allocations
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user