From a397eba48de1f666c4553ba1120afa1d163b6c7b Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 27 Jul 2026 13:34:49 +0000 Subject: [PATCH] =?UTF-8?q?Persist=20the=20deal's=20extra=20booking=20info?= =?UTF-8?q?rmation=20from=20the=20scrape=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The differ and the HubSpot fetch already named notes_for_surveyor, but the SQLModel had no such field, so check_for_db_update_trigger raised AttributeError on every deal and the scrape could not diff at all. Co-Authored-By: Claude Opus 5 (1M context) --- backend/app/db/models/hubspot_deal_data.py | 4 ++++ etl/hubspot/hubspotDataTodB.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/backend/app/db/models/hubspot_deal_data.py b/backend/app/db/models/hubspot_deal_data.py index d2c8c8fe9..966966a4c 100644 --- a/backend/app/db/models/hubspot_deal_data.py +++ b/backend/app/db/models/hubspot_deal_data.py @@ -26,6 +26,10 @@ class HubspotDealData(SQLModel, table=True): number_of_attempts: Optional[str] = Field(default=None) outcome_notes: Optional[str] = Field(default=None) booking_status: Optional[str] = Field(default=None) + # The HubSpot deal property behind the "Extra booking information" + # label; the property ID is fixed externally and is what the scrape, + # the differ and the Abri void flag all key on. + notes_for_surveyor: Optional[str] = Field(default=None) major_condition_issue_description: Optional[str] = Field(default=None) major_condition_issue_photos: Optional[str] = Field(default=None) diff --git a/etl/hubspot/hubspotDataTodB.py b/etl/hubspot/hubspotDataTodB.py index d80019b74..cb3a2297e 100644 --- a/etl/hubspot/hubspotDataTodB.py +++ b/etl/hubspot/hubspotDataTodB.py @@ -214,6 +214,7 @@ class HubspotDataToDb: "number_of_attempts": deal_data.get("number_of_attempts"), "outcome_notes": deal_data.get("outcome_notes"), "booking_status": deal_data.get("booking_status"), + "notes_for_surveyor": deal_data.get("notes_for_surveyor"), "project_code": deal_data.get("project_code"), "company_id": company, "major_condition_issue_description": deal_data.get( @@ -340,6 +341,7 @@ class HubspotDataToDb: number_of_attempts=deal_data.get("number_of_attempts"), outcome_notes=deal_data.get("outcome_notes"), booking_status=deal_data.get("booking_status"), + notes_for_surveyor=deal_data.get("notes_for_surveyor"), project_code=deal_data.get("project_code"), company_id=company, major_condition_issue_description=deal_data.get(