order and payment notifs

This commit is contained in:
2025-12-20 21:46:15 +03:30
parent e0df01053b
commit cb532a7941
5 changed files with 47 additions and 20 deletions
@@ -56,7 +56,7 @@ export class OrdersService {
private readonly paymentsService: PaymentsService,
private readonly inventoryService: InventoryService,
private readonly eventEmitter: EventEmitter2,
) {}
) { }
async checkout(userId: string, restaurantId: string) {
const cart = await this.cartService.findOneOrFail(userId, restaurantId);
@@ -133,7 +133,7 @@ export class OrdersService {
const { paymentUrl } = await this.paymentsService.payOrder(order.id);
this.eventEmitter.emit(
OrderCreatedEvent.name,
new OrderCreatedEvent(order.id, restaurantId, String(order?.orderNumber) || ''),
new OrderCreatedEvent(order.id, restaurantId, String(order?.orderNumber) || '', order.total),
);
return { paymentUrl, order };