mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 15:58:18 +00:00
fix(freight): gate loading on booking paymentStatus only; default schedule voyage no. to train's voyage number
This commit is contained in:
@@ -270,7 +270,7 @@ export class SchedulingRescheduleService {
|
||||
// M12: only announce a new departure when the date actually moved —
|
||||
// `newDeparture` is null when the date was unchanged, so retained customers
|
||||
// are not falsely told the train was rescheduled.
|
||||
await this.notifyRescheduleOutcome(dto, newDeparture);
|
||||
await this.notifyRescheduleOutcome(scheduleId, dto, newDeparture);
|
||||
if (newDeparture) void this.trainSchedulingService.emitWindowState(scheduleId);
|
||||
|
||||
return { plan, schedule: assignResult };
|
||||
@@ -283,6 +283,7 @@ export class SchedulingRescheduleService {
|
||||
* company so the notifier has a phone/email to reach.
|
||||
*/
|
||||
private async notifyRescheduleOutcome(
|
||||
scheduleId: string,
|
||||
dto: ExecuteRescheduleDto,
|
||||
newDeparture: Date | null,
|
||||
): Promise<void> {
|
||||
@@ -294,9 +295,9 @@ export class SchedulingRescheduleService {
|
||||
const booking = await this.loadBookingForNotify(bookingId);
|
||||
if (!booking) continue;
|
||||
if (isMaintenance) {
|
||||
this.notifier.maintenanceMoved(booking, newDeparture);
|
||||
this.notifier.maintenanceMoved(booking, newDeparture, scheduleId, dto.reason);
|
||||
} else {
|
||||
this.notifier.rescheduled(booking, newDeparture);
|
||||
this.notifier.rescheduled(booking, newDeparture, scheduleId, dto.reason);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -307,7 +308,8 @@ export class SchedulingRescheduleService {
|
||||
for (const bookingId of dto.displacedBookingIds) {
|
||||
const booking = await this.loadBookingForNotify(bookingId);
|
||||
if (!booking) continue;
|
||||
this.notifier.removedFromTrain(booking);
|
||||
// Displaced bookings no longer point at the schedule — pass it explicitly.
|
||||
this.notifier.removedFromTrain(booking, scheduleId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user