diff --git a/backend/documents_parser/tests/test_end_to_end.py b/backend/documents_parser/tests/test_end_to_end.py index 5d7597c5..84e611c6 100644 --- a/backend/documents_parser/tests/test_end_to_end.py +++ b/backend/documents_parser/tests/test_end_to_end.py @@ -13,6 +13,7 @@ from datatypes.epc.domain.epc_property_data import ( SapEnergySource, SapFloorDimension, SapHeating, + SapVentilation, SapWindow, ShowerOutlet, ShowerOutlets, @@ -56,6 +57,9 @@ class TestPdfToEpcPropertyData: emitter_temperature="Unknown", main_heating_control="Programmer, room thermostat and TRVs", fan_flue_present=True, + condensing=True, + weather_compensator=False, + central_heating_pump_age_str="Unknown", ) ], has_fixed_air_conditioning=False, @@ -208,6 +212,10 @@ class TestPdfToEpcPropertyData: wall_thickness_mm=310, roof_insulation_location="Joists", roof_insulation_thickness=100, + floor_type="Ground Floor", + floor_construction_type="Solid", + floor_insulation_type_str="As Built", + floor_u_value_known=False, ), SapBuildingPart( identifier="extension_1", @@ -252,6 +260,24 @@ class TestPdfToEpcPropertyData: post_town="Crewe", postcode="CW1 4JR", report_reference="6EA2A86D-94CE-4792-8D49-AB495C744EDD", + number_of_storeys=2, + any_unheated_rooms=False, + waste_water_heat_recovery="None", + hydro=False, + photovoltaic_array=False, + sap_ventilation=SapVentilation( + ventilation_type="Mechanical Extract - Decentralised", + draught_lobby=False, + pressure_test="No test", + open_flues_count=0, + closed_flues_count=0, + boiler_flues_count=0, + other_flues_count=0, + extract_fans_count=0, + passive_vents_count=0, + flueless_gas_fires_count=0, + ventilation_in_pcdf_database=False, + ), ) diff --git a/datatypes/epc/domain/mapper.py b/datatypes/epc/domain/mapper.py index 156a205c..196587a4 100644 --- a/datatypes/epc/domain/mapper.py +++ b/datatypes/epc/domain/mapper.py @@ -16,6 +16,7 @@ from datatypes.epc.domain.epc_property_data import ( SapFloorDimension, SapHeating, SapRoomInRoof, + SapVentilation, SapWindow, ShowerOutlet, ShowerOutlets, @@ -56,6 +57,7 @@ from datatypes.epc.surveys.pashub_rdsap_site_notes import ( ExtensionConstruction, ExtensionMeasurements, ExtensionRoofSpace, + FloorConstruction, FloorMeasurement, HeatingAndHotWater, PasHubRdSapSiteNotes, @@ -190,6 +192,12 @@ class EpcPropertyDataMapper: post_town=post_town, postcode=postcode, report_reference=metadata.report_reference, + number_of_storeys=general.number_of_storeys, + any_unheated_rooms=room_counts.any_unheated_rooms, + waste_water_heat_recovery=room_counts.waste_water_heat_recovery, + hydro=renewables.hydro, + photovoltaic_array=renewables.photovoltaic_array, + sap_ventilation=_map_sap_ventilation(ventilation), ) @staticmethod @@ -1482,6 +1490,7 @@ def _map_main_building_part( roof: RoofSpaceDetail, ) -> SapBuildingPart: main = construction.main_building + floor = construction.floor roof_location, roof_thickness = _map_roof(roof) return SapBuildingPart( identifier="main", @@ -1494,6 +1503,10 @@ def _map_main_building_part( wall_thickness_mm=main.wall_thickness_mm, roof_insulation_location=roof_location, roof_insulation_thickness=roof_thickness, + floor_type=floor.floor_type, + floor_construction_type=floor.floor_construction, + floor_insulation_type_str=floor.floor_insulation_type, + floor_u_value_known=floor.floor_u_value_known, ) @@ -1574,6 +1587,9 @@ def _map_sap_heating( emitter_temperature=main.emitter_temperature, fan_flue_present=main.fan_assist, main_heating_control=main.controls, + condensing=main.condensing, + weather_compensator=main.weather_compensator, + central_heating_pump_age_str=main.central_heating_pump_age, ) ], has_fixed_air_conditioning=ventilation.has_fixed_air_conditioning, @@ -1585,3 +1601,19 @@ def _map_sap_heating( cylinder_insulation_thickness_mm=heating.water_heating.insulation_thickness_mm, immersion_heating_type=heating.water_heating.immersion_type, ) + + +def _map_sap_ventilation(ventilation: Ventilation) -> SapVentilation: + return SapVentilation( + ventilation_type=ventilation.ventilation_type, + draught_lobby=ventilation.draught_lobby, + pressure_test=ventilation.pressure_test, + open_flues_count=ventilation.number_of_open_flues, + closed_flues_count=ventilation.number_of_closed_flues, + boiler_flues_count=ventilation.number_of_boiler_flues, + other_flues_count=ventilation.number_of_other_flues, + extract_fans_count=ventilation.number_of_extract_fans, + passive_vents_count=ventilation.number_of_passive_vents, + flueless_gas_fires_count=ventilation.number_of_flueless_gas_fires, + ventilation_in_pcdf_database=ventilation.ventilation_in_pcdf_database, + )