back tow workign

This commit is contained in:
Jun-te Kim 2025-05-07 15:02:10 +00:00
parent bf54d759f2
commit 13503a7495
3 changed files with 12 additions and 3 deletions

View file

@ -95,5 +95,6 @@ class HubspotTodb():
assessor = surveyedData.load_assessor_table(db_session)
# Loads the pre site summary information
summary_info = surveyedData.load_pre_site_notes_summary_table(db_session)
# Creates the a final pre site note table that links all information
surveyedData.create_pre_site_note_table(db_session, assessor, summary_info)
presitenote = surveyedData.create_pre_site_note_table(db_session, assessor, summary_info)

View file

@ -4,7 +4,9 @@ import math
from etl.transform.preSiteNoteTypes import (
AssessorInfo, CompanyInfo,
PreSiteNotesSummaryInfo, PreSiteNote,
PropertyDescription, Dimension,
)
import uuid
class surveyedDataProcessor():
def __init__(self, address, files):
@ -33,7 +35,14 @@ class surveyedDataProcessor():
data_dict=summary_data,
lookup_field="reference_number"
)
def load_property_description(self, db_session, presitenote):
propertydescription = self.pre_site_note.property_description.__dict__
print(propertydescription)
pass
def load_company_table(self, db_session):
company_data = self.pre_site_note.company_information.__dict__
return self.upsert_record(
@ -116,7 +125,6 @@ class surveyedDataProcessor():
def load_assessor_table(self, db_session):
company = self.load_company_table(db_session)
print(f"Company ID: {company.id}")
assessor_data = self.pre_site_note.assessor_information.__dict__
return self.upsert_record(
db_session=db_session,

View file

@ -238,4 +238,4 @@ class PreSiteNote(BaseModel, table=True):
nullable=False
)
assessor: Optional["AssessorInfo"] = Relationship(back_populates="pre_site_notes")
assessor: Optional["AssessorInfo"] = Relationship(back_populates="pre_site_notes")