Model/MEMORY.md
Jun-te Kim e73e8ea18e memory
2026-04-02 10:24:31 +00:00

1.2 KiB

Project Memory

HubSpot New Field Addition Process

When adding a new field from HubSpot to the deal table, touch these 4 locations in order:

  1. DB modelbackend/app/db/models/organisation.py Add field_name: Optional[str] = Field(default=None) to HubspotDealData, near related fields.

  2. HubSpot API fetchetl/hubspot/hubspotClient.py, from_deal_id_get_info() Add the HubSpot internal property name string to the properties=[...] list.

  3. Soft checketl/hubspot/hubspotDataTodB.py, update_deal_with_checks() Add a soft_assert(deal_in_db.field_name == hs_deal.get("hs_property_name"), "field_name mismatch") entry to the checks list.

  4. Upsertetl/hubspot/hubspotDataTodB.py, upsert_deal()

    • Update branch: add "field_name": deal_data.get("hs_property_name") to the attr dict
    • Insert branch: add field_name=deal_data.get("hs_property_name") to the HubspotDealData(...) constructor

Notes:

  • Date fields: wrap with self._parse_hs_date(deal_data.get(...)) in steps 3 & 4.
  • If HubSpot property name differs from DB column name (e.g. coordination_status__stage_1_coordination_status), use the HS name in .get() and the DB name as the key/attr.