From 27b16dc1c9589d9a5f3c0f37b09f2c875502855e Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 9 Jun 2025 16:43:48 +0000 Subject: [PATCH] section 4 save --- etl/pdfReader/sitenotes.py | 20 ++++++++++++++++++-- etl/transform/conditionReportTypes.py | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/etl/pdfReader/sitenotes.py b/etl/pdfReader/sitenotes.py index 57b5648..13ae756 100644 --- a/etl/pdfReader/sitenotes.py +++ b/etl/pdfReader/sitenotes.py @@ -13,7 +13,7 @@ from etl.transform.conditionReportTypes import ( MainElevation, Elevation, ElevationInfo, PropertyAccess, ExternalElevation, ExternalElevationFront, ExternalElevationGableOne, ExternalElevationGableTwo, ExternalElevationRear, ConservatoryOrOutbuilding, AccessAndElevations, Hallway, RoomInfo, WindowsInfo, VentilationInfo, LivingRoom, DiningRoom, Kitchen, - Utility, WC, Landing, Bedroom, Bathroom, LoftSpace, RoomInRoof + Utility, WC, Landing, Bedroom, Bathroom, LoftSpace, RoomInRoof, HeatingSystem, GeneralConditionHeatingSystem ) from datetime import datetime from pprint import pprint @@ -88,6 +88,7 @@ class ConditionReport(SiteNotesExtractor): self.get_section_1() self.get_section_2() self.get_section_3() + self.get_section_4() self.get_section_0() def get_section_0(self): @@ -287,8 +288,8 @@ class ConditionReport(SiteNotesExtractor): _ = self.get_bathroom() _ = self.get_loft_space() _ = self.get_room_in_roof() + print("Put all this togeter in section 3") - pprint(_) def get_room_info(self, data): ventilation = VentilationInfo( @@ -453,6 +454,21 @@ class ConditionReport(SiteNotesExtractor): is_there_a_room_in_roof=room_in_roof_state, room_info=room_info ) + + def get_section_4(self): + _ = self.get_general_condition_of_heating_system() + pprint(_) + + def get_general_condition_of_heating_system(self): + data = self.get_data_between("4. Heating System", "Main Heating 1") + return GeneralConditionHeatingSystem( + is_the_heating_system_in_working_order=True if self.get_next_value(data, "Is the Heating System in working order?") else False, + does_the_occupant_have_a_smart_meter=True if self.get_next_value(data, "Does the occupant have a Smart Meter?") else False, + are_there_any_smart_monitoring_devices=True if self.get_next_value(data, "Are there any smart monitoring devices (Switchee etc)?") else False, + are_the_gas_and_electricity_meters_accessible=True if self.get_next_value(data, "Are the Gas and Electricity Meters accessible") else False, + dual_or_single_electric_meter=self.get_next_value(data, "Dual or single electric meter"), + ) + diff --git a/etl/transform/conditionReportTypes.py b/etl/transform/conditionReportTypes.py index 54accb8..c431b7f 100644 --- a/etl/transform/conditionReportTypes.py +++ b/etl/transform/conditionReportTypes.py @@ -171,7 +171,7 @@ class GeneralConditionHeatingSystem(BaseModel): does_the_occupant_have_a_smart_meter: bool are_there_any_smart_monitoring_devices: bool are_the_gas_and_electricity_meters_accessible: bool - further_notes: str + dual_or_single_electric_meter: str class SecondaryHeating(BaseModel): is_there_a_secondary_heating: bool