From 26d34c345c990f9846a1c866feb32ee2a0405724 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 10 Jun 2026 14:45:25 +0000 Subject: [PATCH] get last_submission_date from hubspot --- backend/app/db/models/hubspot_deal_data.py | 1 + etl/hubspot/hubspotClient.py | 1 + etl/hubspot/hubspotDataTodB.py | 4 ++++ etl/hubspot/hubspot_deal_differ.py | 1 + 4 files changed, 7 insertions(+) diff --git a/backend/app/db/models/hubspot_deal_data.py b/backend/app/db/models/hubspot_deal_data.py index 5104f377..caf1df5d 100644 --- a/backend/app/db/models/hubspot_deal_data.py +++ b/backend/app/db/models/hubspot_deal_data.py @@ -86,6 +86,7 @@ class HubspotDealData(SQLModel, table=True): last_contact_date: Optional[datetime] = Field(default=None) last_outbound_call: Optional[datetime] = Field(default=None) last_outbound_email: Optional[datetime] = Field(default=None) + last_submission_date: Optional[datetime] = Field(default=None) created_at: Optional[datetime] = Field( sa_column=Column( diff --git a/etl/hubspot/hubspotClient.py b/etl/hubspot/hubspotClient.py index 482ae460..28abf303 100644 --- a/etl/hubspot/hubspotClient.py +++ b/etl/hubspot/hubspotClient.py @@ -351,6 +351,7 @@ class HubspotClient: "last_contact_date", "last_outbound_call", "last_outbound_email", + "last_submission_date", ], ) ) diff --git a/etl/hubspot/hubspotDataTodB.py b/etl/hubspot/hubspotDataTodB.py index 042571da..ae2daa49 100644 --- a/etl/hubspot/hubspotDataTodB.py +++ b/etl/hubspot/hubspotDataTodB.py @@ -297,6 +297,9 @@ class HubspotDataToDb: "last_contact_date": parse_hs_date(deal_data.get("last_contact_date")), "last_outbound_call": parse_hs_date(deal_data.get("last_outbound_call")), "last_outbound_email": parse_hs_date(deal_data.get("last_outbound_email")), + "last_submission_date": parse_hs_date( + deal_data.get("last_submission_date") + ), }.items(): setattr(existing, attr, value) @@ -399,6 +402,7 @@ class HubspotDataToDb: last_contact_date=parse_hs_date(deal_data.get("last_contact_date")), last_outbound_call=parse_hs_date(deal_data.get("last_outbound_call")), last_outbound_email=parse_hs_date(deal_data.get("last_outbound_email")), + last_submission_date=parse_hs_date(deal_data.get("last_submission_date")), ) def _handle_existing_photo_upload( diff --git a/etl/hubspot/hubspot_deal_differ.py b/etl/hubspot/hubspot_deal_differ.py index 40eef059..6d49cf59 100644 --- a/etl/hubspot/hubspot_deal_differ.py +++ b/etl/hubspot/hubspot_deal_differ.py @@ -118,6 +118,7 @@ class HubspotDealDiffer: ("last_contact_date", "last_contact_date"), ("last_outbound_call", "last_outbound_call"), ("last_outbound_email", "last_outbound_email"), + ("last_submission_date", "last_submission_date"), ] for hs_field, db_field in date_fields: