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