diff --git a/app/costing/aer_mapper.py b/app/costing/aer_mapper.py index 7bff694..fd387c4 100644 --- a/app/costing/aer_mapper.py +++ b/app/costing/aer_mapper.py @@ -216,6 +216,21 @@ def map_aer_plan(list_entry: dict, detail: dict) -> TariffPlan: label = incentive.get("displayName") or incentive.get("description", "") notes.append(f"One-off sign-up incentive not included in the cost estimate: {label}") + # Cost modeling can't tell you whether you actually qualify for a plan -- + # AER's data sometimes states this explicitly (e.g. "must purchase an + # eligible solar PV system from an Origin approved solar installer", + # "new residential customers only"), and a plan ranking well on price + # alone is useless if you don't meet its eligibility criteria. Surface + # whatever AER provides so at least the stated restrictions are visible + # in the comparison -- this can't catch requirements AER leaves + # unstated (e.g. concession/seniors card plans with no eligibility + # block at all), so a plan showing no note here isn't a guarantee of + # eligibility, just that AER didn't document a restriction. + for elig in ec.get("eligibility", []): + description = elig.get("description") or elig.get("information") + if description: + notes.append(f"Eligibility requirement: {description}") + supply_charge_c_per_day = supply_charges_c[0] if supply_charges_c else 0.0 if len(set(supply_charges_c)) > 1: notes.append("Supply charge varies by season in the source data; using the first season's rate.") diff --git a/app/web/templates/plans.html b/app/web/templates/plans.html index 52443c6..c137d4d 100644 --- a/app/web/templates/plans.html +++ b/app/web/templates/plans.html @@ -68,6 +68,9 @@ async function loadPlans(days) { const badges = []; if (row.is_current) badges.push('Current plan'); if (!row.modelable) badges.push('Not fully modeled'); + if (row.modeling_notes.some(n => n.startsWith('Eligibility requirement:'))) { + badges.push('Eligibility restricted'); + } let savingsCell = '—'; if (row.savings_vs_current_dollars !== null && row.savings_vs_current_dollars !== undefined && !row.is_current) {