mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 16:35:42 +00:00
Merge pull request #1516 from Tria-plc/freight/fix_issue
Freight/fix issue
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user