get windturbine working

This commit is contained in:
Jun-te Kim 2025-05-08 11:58:27 +00:00
parent 261ad10937
commit 54d11e38de
4 changed files with 14 additions and 4 deletions

View file

@ -83,8 +83,9 @@ class HubspotTodb():
for add, file_loc in data_loc.items():
self.data_in_sharepoint.append(surveyedDataProcessor(add, file_loc))
def load_all(self):
self.gather_data_from_each_sharepoint()
def load_all(self, fast=False):
if fast is False:
self.gather_data_from_each_sharepoint()
with get_db_session() as session:
self.load_pre_site_note(session)
session.commit()

View file

@ -10,4 +10,4 @@ from etl.db.hubSpotLoad import HubspotTodb
dbLoader = HubspotTodb()
dbLoader.load_all()
dbLoader.load_all()

View file

@ -5,7 +5,7 @@ from etl.transform.preSiteNoteTypes import (
AssessorInfo, CompanyInfo,
PreSiteNotesSummaryInfo, PreSiteNote,
PropertyDescription, Dimension, HeatingType, Heating, HeatingSystemControls,
OtherDetails,
OtherDetails, WindTurbine
)
import uuid
@ -99,6 +99,9 @@ class surveyedDataProcessor():
# Other details
otherDetails = self.get_attribute_and_load(self.pre_site_note.property_description, "otherDetails", OtherDetails, db_session)
# windTurbine
windTurbine = self.get_attribute_and_load(self.pre_site_note.property_description, "windTurbine", WindTurbine, db_session)

View file

@ -219,6 +219,12 @@ class PropertyDescription(BaseModel):
showerAndBaths: Optional[ShowerAndBaths]
flueGasHeatRecoverySystem: Optional[FlueGasHeatRecoverySystem]
photovoltaicPanel: Optional[PhotovoltaicPanel]
# windTuribe
wind_turbine_id: Optional[uuid.UUID] = Field(
default=None,
foreign_key="windturbine.id"
)
windTurbine: Optional[WindTurbine]