mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
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:
parent
0135f0f27b
commit
406365753b
1 changed files with 19 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue