Merge pull request #1415 from Tria-plc/freight_feature/usermanagement

feat: implement MANUAL_ONLY status for bookings and update related logic
This commit is contained in:
marshal
2026-08-26 01:02:18 +03:00
committed by GitHub
8 changed files with 257 additions and 36 deletions

View File

@@ -2415,7 +2415,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