feat: ( notifications ) add payment/cancellation events and ticket confirmation

This commit is contained in:
Abubeker Yasin
2026-06-19 15:49:30 +03:00
parent fcbc59e95b
commit 2288a9efda
7 changed files with 280 additions and 39 deletions

View File

@@ -1007,6 +1007,7 @@ export class BookingsService {
await this.prisma.bookingCancellation.create({ data: { bookingId: booking.id, cancelledBy: booking.passengerId, reason, refundAmount, refundMethod: booking.paymentIntent?.method ?? 'ORIGINAL', refundStatus: 'PENDING' } });
await this.seatsService.releaseSeats(booking.seats.map((s) => s.seatId));
await this.prisma.booking.update({ where: { bookingRef }, data: { status: 'CANCELLED' } });
this.eventEmitter.emit('booking.cancelled', { booking, refundAmount });
return { cancelled: true, refundAmount: refundAmount / 100, currency: 'ETB' };
}