Resolve a landlord age-band override onto the main building part 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jun-te Kim 2026-06-19 13:41:35 +00:00
parent 0135f0f27b
commit 406365753b

View file

@ -13,10 +13,27 @@ from __future__ import annotations
from typing import Optional
from domain.modelling.simulation import EpcSimulation
from datatypes.epc.domain.epc_property_data import BuildingPartIdentifier
from domain.modelling.simulation import BuildingPartOverlay, EpcSimulation
# RdSAP England-&-Wales construction age bands (letter codes A..M).
_VALID_AGE_BANDS: frozenset[str] = frozenset("ABCDEFGHIJKLM")
def age_band_overlay_for(
age_band_value: str, building_part: int
) -> Optional[EpcSimulation]:
raise NotImplementedError
band = age_band_value.strip().upper()
if band not in _VALID_AGE_BANDS:
return None
identifier = (
BuildingPartIdentifier.MAIN
if building_part == 0
else BuildingPartIdentifier.extension(building_part)
)
return EpcSimulation(
building_parts={
identifier: BuildingPartOverlay(construction_age_band=band)
}
)