diff --git a/backend/services/falukantService.js b/backend/services/falukantService.js index 1142142..34b4e37 100644 --- a/backend/services/falukantService.js +++ b/backend/services/falukantService.js @@ -3726,16 +3726,11 @@ class FalukantService extends BaseService { // Für jede Stadt den Preis berechnen und Branch-Typ bestimmen const results = []; - const isCarrot = productId === 3; // Debug für Karotten - if (isCarrot) { - console.log(`[getProductPricesInCities CARROT] productId: ${productId}, currentPrice: ${currentPrice}, currentRegionId: ${currentRegionId}, knowledgeFactor: ${knowledgeFactor}, product.sellCost: ${product.sellCost}, cities: ${cities.length}`); - } + console.log(`[getProductPricesInCities] Processing ${cities.length} cities for product ${productId}, knowledgeFactor: ${knowledgeFactor}, product.sellCost: ${product.sellCost}`); for (const city of cities) { // Aktuelle Stadt ausschließen if (currentRegionId && city.id === currentRegionId) { - if (isCarrot) { - console.log(`[getProductPricesInCities CARROT] Skipping current city: ${city.name} (${city.id})`); - } + console.log(`[getProductPricesInCities] Skipping current city: ${city.name} (${city.id})`); continue; } @@ -3750,9 +3745,7 @@ class FalukantService extends BaseService { const max = basePrice; const priceInCity = min + (max - min) * (knowledgeFactor / 100); - if (isCarrot) { - console.log(`[getProductPricesInCities CARROT] City: ${city.name} (${city.id}), worthPercent: ${worthPercent}, basePrice: ${basePrice}, priceInCity: ${priceInCity}, currentPrice: ${currentPrice}, isBetter: ${priceInCity > currentPrice}`); - } + console.log(`[getProductPricesInCities] City: ${city.name} (${city.id}), worthPercent: ${worthPercent}, basePrice: ${basePrice}, priceInCity: ${priceInCity}, currentPrice: ${currentPrice}, isBetter: ${priceInCity > currentPrice}`); // Nur Städte zurückgeben, wo der Preis höher ist // Keine Toleranz, da wir die aktuelle Stadt bereits ausschließen @@ -3769,9 +3762,7 @@ class FalukantService extends BaseService { } } - if (isCarrot) { - console.log(`[getProductPricesInCities CARROT] Adding ${city.name} to results: price=${priceInCity}, branchType=${branchType}`); - } + console.log(`[getProductPricesInCities] Adding ${city.name} to results: price=${priceInCity}, branchType=${branchType}`); results.push({ regionId: city.id, @@ -3782,9 +3773,7 @@ class FalukantService extends BaseService { } } - if (isCarrot) { - console.log(`[getProductPricesInCities CARROT] Returning ${results.length} cities with better prices:`, results.map(r => `${r.regionName} (${r.price})`).join(', ')); - } + console.log(`[getProductPricesInCities] Returning ${results.length} cities with better prices for product ${productId}:`, results.map(r => `${r.regionName} (${r.price.toFixed(2)})`).join(', ')); // Sortiere nach Preis (höchster zuerst) results.sort((a, b) => b.price - a.price);