Adding train delay minutes and also disabling no schedule days in the booking selection

This commit is contained in:
Muluhabt
2026-07-27 14:42:57 +03:00
parent d175514f85
commit d71f6dc1b3
19 changed files with 845 additions and 54 deletions

View File

@@ -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' },
});