feat: implement MANUAL_ONLY status for bookings and update related logic

This commit is contained in:
Marshal
2026-08-25 22:01:03 +00:00
parent b926a3116e
commit 29371b0b39
8 changed files with 257 additions and 36 deletions

View File

@@ -2405,7 +2405,12 @@ export class TrainSchedulingService {
);
const booking = await this.bookingsRepository.findById(bookingId);
const schedulingStatus = this.resolvePostUnassignStatus(booking);
// Removed from a train by staff → MANUAL_ONLY: the paid booking must not
// be auto re-placed by any allocation sweep (it would retake the space it
// was just pulled from). Staff re-assign it manually; assign resets the
// status to SCHEDULED. Schedule *cancellation* keeps the old behaviour
// (resolvePostUnassignStatus) — there the train died, not the booking.
const schedulingStatus = SchedulingStatus.ManualOnly;
// Clear the schedule pointer too: unassign fully detaches the booking from
// this train. Leaving trainScheduleId set glued the booking to a schedule
// that may then be dispatched/cancelled/deleted, orphaning it — the