mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 18:55:42 +00:00
Merge pull request #1515 from Tria-plc/freight/fix_issue
import utility functions for booking operations in OperationReschedul…
This commit is contained in:
@@ -431,6 +431,12 @@ interface BookingWindowRow {
|
|||||||
route_stations: string[] | null;
|
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()
|
@Injectable()
|
||||||
export class TrainSchedulingService {
|
export class TrainSchedulingService {
|
||||||
private readonly logger = new Logger(TrainSchedulingService.name);
|
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
|
// Stock §1.2 enforces composition "prior to departure", so an incomplete
|
||||||
// crew saves freely on the assignment page but cannot depart. Optional
|
// crew saves freely on the assignment page but cannot depart. Optional
|
||||||
// dependency: the positional spec constructors omit it.
|
// 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.
|
// Staff may record the departure after the fact — past is fine, future is not.
|
||||||
const now = dto.actualDepartureAt ? new Date(dto.actualDepartureAt) : new Date();
|
const now = dto.actualDepartureAt ? new Date(dto.actualDepartureAt) : new Date();
|
||||||
this.assertNotFuture(now, 'Departure time');
|
this.assertNotFuture(now, 'Departure time');
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ import {
|
|||||||
useBookingDetail,
|
useBookingDetail,
|
||||||
useBookingMutations,
|
useBookingMutations,
|
||||||
} from "@/hooks/bookings/useBookings";
|
} from "@/hooks/bookings/useBookings";
|
||||||
|
import {
|
||||||
|
eatDay,
|
||||||
|
exportTrainOption,
|
||||||
|
isExportRailBooking,
|
||||||
|
} from "@/features/bookings/shipmentDay";
|
||||||
|
|
||||||
export interface OperationRescheduleModalProps {
|
export interface OperationRescheduleModalProps {
|
||||||
bookingId: string;
|
bookingId: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user