diff --git a/domain/epc/property_overlays/main_fuel_overlay.py b/domain/epc/property_overlays/main_fuel_overlay.py new file mode 100644 index 00000000..4d721865 --- /dev/null +++ b/domain/epc/property_overlays/main_fuel_overlay.py @@ -0,0 +1,22 @@ +"""Map a Landlord-Override main-fuel value to a heating Simulation Overlay. + +A main-fuel value is one canonical gov-EPC `main_fuel` description ("mains gas", +"electricity", …). The calculator reads the dwelling's primary fuel from +`main_heating_details[0].main_fuel_type` as the RdSAP **int code**, so the +overlay decomposes the value into that code and emits a whole-dwelling +`HeatingOverlay` (fuel is not a per-building-part attribute, so `building_part` +is ignored). Codes follow the modern RdSAP-20/21 `(not community)` family the +gov-EPC API baseline uses. Unresolvable values produce no overlay. +""" + +from __future__ import annotations + +from typing import Optional + +from domain.modelling.simulation import EpcSimulation + + +def fuel_overlay_for( + main_fuel_value: str, building_part: int +) -> Optional[EpcSimulation]: + raise NotImplementedError diff --git a/tests/domain/epc/test_main_fuel_overlay.py b/tests/domain/epc/test_main_fuel_overlay.py new file mode 100644 index 00000000..96072c1d --- /dev/null +++ b/tests/domain/epc/test_main_fuel_overlay.py @@ -0,0 +1,19 @@ +"""The Landlord-Override main-fuel → heating Simulation Overlay mapping. + +A main-fuel value resolves to the RdSAP `main_fuel_type` int code the calculator +reads from the dwelling's primary heating system; the overlay is whole-dwelling. +""" + +from __future__ import annotations + +from domain.epc.property_overlays.main_fuel_overlay import fuel_overlay_for + + +def test_mains_gas_overlays_the_primary_fuel() -> None: + # Act + simulation = fuel_overlay_for("mains gas", 0) + + # Assert — mains gas (not community) is RdSAP main_fuel code 26. + assert simulation is not None + assert simulation.heating is not None + assert simulation.heating.main_fuel_type == 26