diff --git a/backend/services/falukantService.js b/backend/services/falukantService.js index bd15530..5e1caf6 100644 --- a/backend/services/falukantService.js +++ b/backend/services/falukantService.js @@ -589,6 +589,7 @@ class FalukantService extends BaseService { } } await this.addSellItem(branchId, user.id, productId, quantity); + console.log('[FalukantService.sellProduct] emitting events for user', user.user.hashedId, 'branch', branch?.id); notifyUser(user.user.hashedId, 'falukantUpdateStatus', {}); notifyUser(user.user.hashedId, 'falukantBranchUpdate', { branchId: branch.id }); return { success: true }; @@ -654,6 +655,7 @@ class FalukantService extends BaseService { for (const item of inventory) { await Inventory.destroy({ where: { id: item.id } }); } + console.log('[FalukantService.sellAllProducts] emitting events for user', falukantUser.user.hashedId, 'branch', branchId, 'revenue', total, 'items', inventory.length); notifyUser(falukantUser.user.hashedId, 'falukantUpdateStatus', {}); notifyUser(falukantUser.user.hashedId, 'falukantBranchUpdate', { branchId }); return { success: true, revenue: total };