notification fix bug
This commit is contained in:
@@ -15,11 +15,11 @@ export class NotificationListeners {
|
||||
|
||||
constructor(private readonly notificationService: NotificationService) {}
|
||||
|
||||
@OnEvent('order.created')
|
||||
@OnEvent(OrderCreatedEvent.name)
|
||||
async handleOrderCreated(event: OrderCreatedEvent) {
|
||||
try {
|
||||
this.logger.log(`Order created event received: ${event.orderNumber}`);
|
||||
|
||||
console.log('Order created event received: ', event);
|
||||
await this.notificationService.sendNotification({
|
||||
restaurantId: event.restaurantId,
|
||||
userId: event.userId,
|
||||
@@ -33,7 +33,7 @@ export class NotificationListeners {
|
||||
);
|
||||
}
|
||||
}
|
||||
@OnEvent('order.payment.success')
|
||||
@OnEvent(OrderPaymentSuccessEvent.name)
|
||||
async handleOrderPaymentSuccess(event: OrderPaymentSuccessEvent) {
|
||||
try {
|
||||
this.logger.log(`Order payment success event received: ${event.orderNumber}`);
|
||||
@@ -52,7 +52,7 @@ export class NotificationListeners {
|
||||
}
|
||||
}
|
||||
|
||||
@OnEvent('review.created')
|
||||
@OnEvent(ReviewCreatedEvent.name)
|
||||
async handleReviewCreated(event: ReviewCreatedEvent) {
|
||||
try {
|
||||
this.logger.log(`Review created event received: ${event.reviewId}`);
|
||||
@@ -71,7 +71,7 @@ export class NotificationListeners {
|
||||
}
|
||||
}
|
||||
|
||||
@OnEvent('order.status.changed')
|
||||
@OnEvent(OrderStatusChangedEvent.name)
|
||||
async handleOrderStatusChanged(event: OrderStatusChangedEvent) {
|
||||
try {
|
||||
this.logger.log(`Order status changed: ${event.orderId} from ${event.oldStatus} to ${event.newStatus}`);
|
||||
|
||||
Reference in New Issue
Block a user