mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 23:28:11 +00:00
Adding train delay minutes and also disabling no schedule days in the booking selection
This commit is contained in:
@@ -312,6 +312,18 @@ export class NotificationsService {
|
||||
const ref = booking?.bookingRef ?? payload.booking.bookingRef;
|
||||
const passengerId = booking?.passengerId ?? payload.booking.passengerId;
|
||||
|
||||
// A backoffice-issued reservation already sends its own purpose-built message —
|
||||
// GuestBookingService.issueBookingFromReservation texts /reserve/pay/<payToken> for a
|
||||
// PASSENGER-kind booking (the traveler has no portal session, so this generic template's
|
||||
// /booking/detail?ref= link doesn't work), and for STAFF kind the booking is finalized
|
||||
// immediately after this event fires, so onPaymentSucceeded's "ticket ready" message is
|
||||
// the correct one to send, not a redundant/contradictory "awaiting payment" notice.
|
||||
const source = (booking as any)?.source ?? payload.booking?.source;
|
||||
if (source === 'BACKOFFICE_RESERVATION') {
|
||||
this.logger.log(`Skipping generic booking.created notification for ${ref} — reservation flow sends its own`);
|
||||
return;
|
||||
}
|
||||
|
||||
const template = await this.prisma.notificationTemplate.findUnique({
|
||||
where: { code: 'booking.created' },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user