mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 01:48:12 +00:00
add goverment booking
This commit is contained in:
@@ -139,6 +139,17 @@ export class SchedulingRescheduleService {
|
||||
actorUserId?: string,
|
||||
) {
|
||||
const plan = await this.previewReschedule(scheduleId, dto);
|
||||
// Gov bookings may never be pushed off a train. Checked here (not only in
|
||||
// unassignBooking) because the displacement loop below swallows unassign
|
||||
// errors and force-detaches the booking anyway.
|
||||
const govDisplaced = plan.displaced.filter((b) => b.isGovernment);
|
||||
if (govDisplaced.length) {
|
||||
throw new BadRequestException(
|
||||
`Government bookings cannot be removed from a train: ${govDisplaced
|
||||
.map((b) => b.reference)
|
||||
.join(', ')}`,
|
||||
);
|
||||
}
|
||||
const expectedDisplaced = new Set(plan.displaced.map((b) => b.id));
|
||||
const providedDisplaced = new Set(dto.displacedBookingIds);
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user