Add debug logging in RevenueSection for better price retrieval tracking

- Introduced console logs to track the number of better prices received for each product and the state of the betterPricesMap after updates.
- Enhanced the getBetterPrices method with logging to provide visibility into the prices being returned, improving traceability during price evaluations.
- These changes aim to facilitate debugging and provide clearer insights into the price handling process within the RevenueSection component.
This commit is contained in:
Torsten Schulz (local)
2025-12-03 15:59:15 +01:00
parent 1797ae3e58
commit def88f6486

View File

@@ -130,8 +130,10 @@
currentRegionId: this.currentRegionId currentRegionId: this.currentRegionId
} }
}); });
console.log(`[RevenueSection] Product ${product.id} (${product.labelTr}): received ${data?.length || 0} better prices:`, data);
// Speichere betterPrices in einem separaten Map, nicht auf dem product Objekt // Speichere betterPrices in einem separaten Map, nicht auf dem product Objekt
this.$set(this.betterPricesMap, product.id, data || []); this.$set(this.betterPricesMap, product.id, data || []);
console.log(`[RevenueSection] betterPricesMap after update:`, JSON.parse(JSON.stringify(this.betterPricesMap)));
} catch (error) { } catch (error) {
console.error(`Error loading prices for product ${product.id}:`, error); console.error(`Error loading prices for product ${product.id}:`, error);
this.$set(this.betterPricesMap, product.id, []); this.$set(this.betterPricesMap, product.id, []);
@@ -141,7 +143,9 @@
} }
}, },
getBetterPrices(productId) { getBetterPrices(productId) {
return this.betterPricesMap[productId] || []; const prices = this.betterPricesMap[productId] || [];
console.log(`[RevenueSection] getBetterPrices(${productId}): returning`, prices);
return prices;
}, },
getCityPriceClass(branchType) { getCityPriceClass(branchType) {
if (branchType === 'store') return 'city-price-green'; if (branchType === 'store') return 'city-price-green';