From c558b79b687b69ea9abcd57a522835dc6fd32c83 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 21 Apr 2026 11:13:04 +0000 Subject: [PATCH] =?UTF-8?q?map=20water=20heating=20cylinder=20size=20?= =?UTF-8?q?=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/documents_parser/tests/test_end_to_end.py | 3 +++ backend/documents_parser/tests/test_extractor.py | 3 +++ datatypes/epc/domain/epc_property_data.py | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/documents_parser/tests/test_end_to_end.py b/backend/documents_parser/tests/test_end_to_end.py index 5d0bc31d..b994cd11 100644 --- a/backend/documents_parser/tests/test_end_to_end.py +++ b/backend/documents_parser/tests/test_end_to_end.py @@ -267,3 +267,6 @@ class TestPdfToEpcPropertyDataFixture2: def test_cylinder_insulation_thickness(self, result: EpcPropertyData) -> None: assert result.sap_heating.cylinder_insulation_thickness_mm == 38 + + def test_cylinder_size(self, result: EpcPropertyData) -> None: + assert result.sap_heating.cylinder_size == "Normal (90-130 litres)" diff --git a/backend/documents_parser/tests/test_extractor.py b/backend/documents_parser/tests/test_extractor.py index 6eda5284..27214fd2 100644 --- a/backend/documents_parser/tests/test_extractor.py +++ b/backend/documents_parser/tests/test_extractor.py @@ -398,6 +398,9 @@ class TestWaterHeatingCylinderThickness: def test_cylinder_insulation_thickness_mm_absent(self, hhw_no_cylinder: HeatingAndHotWater) -> None: assert hhw_no_cylinder.water_heating.insulation_thickness_mm is None + def test_cylinder_size(self, hhw: HeatingAndHotWater) -> None: + assert hhw.water_heating.cylinder_size == "Normal (90-130 litres)" + class TestHeatingAndHotWater: @pytest.fixture diff --git a/datatypes/epc/domain/epc_property_data.py b/datatypes/epc/domain/epc_property_data.py index cc21d7f9..f0d8607d 100644 --- a/datatypes/epc/domain/epc_property_data.py +++ b/datatypes/epc/domain/epc_property_data.py @@ -54,8 +54,8 @@ class SapHeating: instantaneous_wwhrs: InstantaneousWwhrs main_heating_details: List[MainHeatingDetail] has_fixed_air_conditioning: bool - cylinder_size: Optional[int] = ( - None # int code from API; not directly available from site notes + cylinder_size: Optional[Union[int, str]] = ( + None # int code from API; str (e.g. "Normal (90-130 litres)") from site notes ) water_heating_code: Optional[int] = None # TODO: make enum? water_heating_fuel: Optional[int] = None # TODO: make enum?