import { computeSimulation, formatEuro, formatYears } from '/opt/projects/.covalba-refonte-worktrees/tom-estimateur/src/lib/coolRoofSimulator';

// Scénarios réalistes — ratios de conso froid usuels (kWh/m²/an) :
// bureau climatisé ~20-40, logistique frais ~40-80, agro froid positif ~100-200, surgelé ~200-300
const scenarios = [
  { name: 'Bureau tertiaire 1 200 m², 23°C, clim 30 kWh/m²/an', surface: 1200, kwh: 36000, temp: 23 },
  { name: 'Grande distribution 2 500 m², 21°C, clim 50 kWh/m²/an', surface: 2500, kwh: 125000, temp: 21 },
  { name: 'Logistique frais 5 000 m², 15°C, froid 60 kWh/m²/an', surface: 5000, kwh: 300000, temp: 15 },
  { name: 'Agro froid positif 3 000 m², 4°C, froid 150 kWh/m²/an', surface: 3000, kwh: 450000, temp: 4 },
  { name: 'Entrepôt surgelé 3 000 m², -18°C, froid 250 kWh/m²/an', surface: 3000, kwh: 750000, temp: -18 },
  { name: "EXEMPLE DU SHEET 1 200 m², 23°C, 18 000 kWh", surface: 1200, kwh: 18000, temp: 23 },
];

for (const s of scenarios) {
  const r = computeSimulation(
    { surface: s.surface, acConsumptionKwh: s.kwh, indoorTempC: s.temp, electricityPrice: 0.18 },
    'known',
  );
  if (r.status !== 'ok') { console.log(`${s.name} → ${r.status}`); continue; }
  console.log(
    `${s.name}\n  réduction ${(r.reductionRate * 100).toFixed(1)}% | économie ${formatEuro(r.annualSavings)}/an | chantier ${formatEuro(r.worksCost)} (${r.pricePerSqm}€/m²) | ROI ${r.roiYears ? formatYears(r.roiYears) : '—'} ans\n`,
  );
}
