From def88f6486ddbc4384277bbd5e9e159bb3df6a83 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Wed, 3 Dec 2025 15:59:15 +0100 Subject: [PATCH] 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. --- frontend/src/components/falukant/RevenueSection.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/falukant/RevenueSection.vue b/frontend/src/components/falukant/RevenueSection.vue index 58fc62d..5050fd5 100644 --- a/frontend/src/components/falukant/RevenueSection.vue +++ b/frontend/src/components/falukant/RevenueSection.vue @@ -130,8 +130,10 @@ 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 this.$set(this.betterPricesMap, product.id, data || []); + console.log(`[RevenueSection] betterPricesMap after update:`, JSON.parse(JSON.stringify(this.betterPricesMap))); } catch (error) { console.error(`Error loading prices for product ${product.id}:`, error); this.$set(this.betterPricesMap, product.id, []); @@ -141,7 +143,9 @@ } }, getBetterPrices(productId) { - return this.betterPricesMap[productId] || []; + const prices = this.betterPricesMap[productId] || []; + console.log(`[RevenueSection] getBetterPrices(${productId}): returning`, prices); + return prices; }, getCityPriceClass(branchType) { if (branchType === 'store') return 'city-price-green';