Verbesserung: Erweiterung der Protokollausgaben im FalukantService zur Nachverfolgbarkeit von Verkaufsereignissen
Änderungen: - Protokollausgaben wurden hinzugefügt, um die Ereignisse beim Verkauf von Produkten und beim Verkauf aller Produkte zu dokumentieren. - Diese Anpassungen erhöhen die Nachvollziehbarkeit der Benutzerinteraktionen und verbessern die Fehlerdiagnose im Service.
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user