From 5bd4e2288672afdbd0a52beaa920a6e95933ac4e Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 21 Apr 2026 15:31:01 +0000 Subject: [PATCH] =?UTF-8?q?map=20pv=20connection=20=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 | 7 +++++++ datatypes/epc/domain/epc_property_data.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/documents_parser/tests/test_end_to_end.py b/backend/documents_parser/tests/test_end_to_end.py index 03c487fc..121c004a 100644 --- a/backend/documents_parser/tests/test_end_to_end.py +++ b/backend/documents_parser/tests/test_end_to_end.py @@ -292,3 +292,10 @@ class TestPdfToEpcPropertyDataFixture3: def test_immersion_heating_type(self, result: EpcPropertyData) -> None: assert result.sap_heating.immersion_heating_type == "Dual" + + def test_pv_connection(self, result: EpcPropertyData) -> None: + assert result.sap_energy_source.pv_connection == "Connected to dwellings electricity meter" + + def test_photovoltaic_supply_percent_roof(self, result: EpcPropertyData) -> None: + assert result.sap_energy_source.photovoltaic_supply is not None + assert result.sap_energy_source.photovoltaic_supply.none_or_no_details.percent_roof_area == 45 diff --git a/datatypes/epc/domain/epc_property_data.py b/datatypes/epc/domain/epc_property_data.py index 563ceb31..46d6edae 100644 --- a/datatypes/epc/domain/epc_property_data.py +++ b/datatypes/epc/domain/epc_property_data.py @@ -130,7 +130,7 @@ class SapEnergySource: wind_turbines_terrain_type: str # int in API, str (e.g. "Suburban") in site notes electricity_smart_meter_present: bool - pv_connection: Optional[int] = None + pv_connection: Optional[Union[int, str]] = None # int from API; str from site notes photovoltaic_supply: Optional[PhotovoltaicSupply] = None wind_turbine_details: Optional[WindTurbineDetails] = None pv_batteries: Optional[PvBatteries] = None