diff --git a/apps/edr-freight-api/src/modules/train-scheduling/services/train-scheduling.service.ts b/apps/edr-freight-api/src/modules/train-scheduling/services/train-scheduling.service.ts index 9c83ed987..0cbe9c277 100644 --- a/apps/edr-freight-api/src/modules/train-scheduling/services/train-scheduling.service.ts +++ b/apps/edr-freight-api/src/modules/train-scheduling/services/train-scheduling.service.ts @@ -431,6 +431,12 @@ interface BookingWindowRow { route_stations: string[] | null; } +/** + * Dispatch crew gate (ITLMS Rolling Stock §1.2). Temporarily disabled so a + * train can depart with no crew assigned; set back to true to enforce. + */ +const ENFORCE_CREW_GATE_ON_DISPATCH = false; + @Injectable() export class TrainSchedulingService { private readonly logger = new Logger(TrainSchedulingService.name); @@ -3198,7 +3204,11 @@ export class TrainSchedulingService { // Stock §1.2 enforces composition "prior to departure", so an incomplete // crew saves freely on the assignment page but cannot depart. Optional // dependency: the positional spec constructors omit it. - await this.trainCrewAssignments?.assertCrewReadyForDispatch(scheduleId); + // TODO(crew-gate): temporarily off so trains can dispatch with no crew + // assigned. Flip ENFORCE_CREW_GATE_ON_DISPATCH once crew rostering is in use. + if (ENFORCE_CREW_GATE_ON_DISPATCH) { + await this.trainCrewAssignments?.assertCrewReadyForDispatch(scheduleId); + } // Staff may record the departure after the fact — past is fine, future is not. const now = dto.actualDepartureAt ? new Date(dto.actualDepartureAt) : new Date(); this.assertNotFuture(now, 'Departure time'); diff --git a/apps/edr-freight-web/backoffice/src/components/bookings/OperationRescheduleModal.tsx b/apps/edr-freight-web/backoffice/src/components/bookings/OperationRescheduleModal.tsx index 8fa1d5c46..0e31ceff4 100644 --- a/apps/edr-freight-web/backoffice/src/components/bookings/OperationRescheduleModal.tsx +++ b/apps/edr-freight-web/backoffice/src/components/bookings/OperationRescheduleModal.tsx @@ -22,6 +22,11 @@ import { useBookingDetail, useBookingMutations, } from "@/hooks/bookings/useBookings"; +import { + eatDay, + exportTrainOption, + isExportRailBooking, +} from "@/features/bookings/shipmentDay"; export interface OperationRescheduleModalProps { bookingId: string;