From c3f1a15993887cdf541a97cc7793e8edbc40aba6 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Tue, 26 Aug 2025 11:36:35 +0000 Subject: [PATCH] access and elevation --- deployment/lambda/extractor_and_loader/docker/app.py | 7 +++++-- etl/fileReader/sitenotes.py | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/deployment/lambda/extractor_and_loader/docker/app.py b/deployment/lambda/extractor_and_loader/docker/app.py index d345df2..8a08c48 100644 --- a/deployment/lambda/extractor_and_loader/docker/app.py +++ b/deployment/lambda/extractor_and_loader/docker/app.py @@ -57,17 +57,19 @@ def serialize_model(model: Any): else: return model -def make_final_json(rooms_obj, heating_system_obj, occupant): +def make_final_json(rooms_obj, heating_system_obj, occupant, access_and_elevations): # Convert to dict recursively rooms_data = serialize_model(rooms_obj) heating_data = serialize_model(heating_system_obj) occupant_data = serialize_model(occupant) + access_and_elevations_data = serialize_model(access_and_elevations) # Combine into one big JSON-ready dict final_data = { "rooms": rooms_data, "heating_system": heating_data, "occupant_info": occupant_data, + "access_and_elevations": access_and_elevations_data, } # Convert to pretty JSON string @@ -211,7 +213,8 @@ def handler(event, context): json_ = make_final_json( obj.master_obj[0], obj.master_obj[1], - obj.master_obj[2] + obj.master_obj[2], + obj.master_obj[3], ) print("Extracted completed, made json") diff --git a/etl/fileReader/sitenotes.py b/etl/fileReader/sitenotes.py index 425c5a3..f2de52d 100644 --- a/etl/fileReader/sitenotes.py +++ b/etl/fileReader/sitenotes.py @@ -105,19 +105,19 @@ class WarmHomesConditionReport(SiteNotesExtractor): def __init__(self, data_list): super().__init__(data_list) self.type = ReportType.WARM_HOMES_CONDITION_REPORT - room, heating_system, occupant = self.setup_condition_report() + room, heating_system, occupant, access_and_elevation = self.setup_condition_report() - self.master_obj = room, heating_system, occupant + self.master_obj = room, heating_system, occupant, access_and_elevation def setup_condition_report(self): # general_information = self.get_section_1() - # access_and_elevations = self.get_section_2() + access_and_elevations = self.get_section_2() rooms = self.get_section_3() heating_system = self.get_section_4() occupant_assessment = self.get_section_5() # site_name, reference_code, address, postcode = self.get_section_0() - return rooms, heating_system, occupant_assessment + return rooms, heating_system, occupant_assessment, access_and_elevations def get_section_0(self): data = self.get_data_between("Project Site Name", "1. General Information")