merge this to main

This commit is contained in:
Jun-te Kim 2025-06-17 09:39:35 +00:00
parent 298f58fa31
commit c8c3ab9379
3 changed files with 13 additions and 18 deletions

View file

@ -157,10 +157,8 @@ for pipeline, deals in notes_data.items():
# Generate file name with next Mondays date
days_ahead = (7 - today.weekday()) % 7
days_ahead = 7 if days_ahead == 0 else days_ahead
next_monday = today + timedelta(days=days_ahead)
formatted = next_monday.strftime("%d-%m-%Y Monday")
monday = previous_monday()
formatted = monday.strftime("%d-%m-%Y Monday")
file_name = f"{formatted} DEAL_NOTES_FROM_HUBSPOT.xlsx"
output_path = os.path.abspath(file_name)
wb.save(output_path)

View file

@ -9,7 +9,7 @@ from etl.transform.preSiteNoteTypes import (
HeatingType, Insulation
)
from etl.transform.conditionReportTypes import (
ConditionReport, AssessorDetails, InspectionAndProject, TheProperty,
ConditionReportModel, AssessorDetails, InspectionAndProject, TheProperty,
MainElevation, Elevation, ElevationInfo, PropertyAccess, ExternalElevation, ExternalElevationFront,
ExternalElevationGableOne, ExternalElevationGableTwo, ExternalElevationRear, ConservatoryOrOutbuilding,
AccessAndElevations, Hallway, RoomInfo, WindowsInfo, VentilationInfo, LivingRoom, DiningRoom, Kitchen, Rooms,
@ -92,27 +92,24 @@ class ConditionReport(SiteNotesExtractor):
def __init__(self, data_list):
super().__init__(data_list)
self.type = ReportType.OSMOSIS_CONDITION_PAS_2035_REPORT
self.setup()
self.setup_condition_report()
def setup(self):
def setup_condition_report(self):
assesor_details, inspection_and_project, the_property, main_elevation, elevations = self.get_section_1()
access_and_elevations = self.get_section_2()
rooms = self.get_section_3()
general_condition_of_heating_system, main_heating_one, main_heating_two, secondary_heating, heating_by_room, renewables = self.get_section_4()
occupants, energy_use, heating, shower_and_bath, appliances, fridge_and_freezers, cooker, tumble_dryer = self.get_section_5()
site_name, reference_code, address, postcode = self.get_section_0()
# TODO: Complete this function
self.make_condition_report_object(
assesor_details,
inspection_and_project,
the_property,
main_elevation,
elevations,
access_and_elevations,
rooms,
return ConditionReportModel(
project_site_name=site_name,
property_reference_code=reference_code,
property_address=address,
postcode=postcode,
)
def get_section_0(self):
data = self.get_data_between("Project Site Name", "1. General Information")

View file

@ -272,7 +272,7 @@ class OccupantAssessment(BaseModel):
tumble_dryer: TumbleDryer
class ConditionReport(BaseModel):
class ConditionReportModel(BaseModel):
project_site_name: str
property_reference_code: str
property_address: str