From 26e2a98034761e8549f39026c17eb21fcbfdb6a8 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 20 Jul 2026 08:34:43 +0000 Subject: [PATCH] =?UTF-8?q?Amend=20the=20Abri=20booking=20when=20the=20dea?= =?UTF-8?q?l's=20surveyor=20changes=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- etl/hubspot/hubspot_deal_differ.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/etl/hubspot/hubspot_deal_differ.py b/etl/hubspot/hubspot_deal_differ.py index 30651fdf9..cf35a77da 100644 --- a/etl/hubspot/hubspot_deal_differ.py +++ b/etl/hubspot/hubspot_deal_differ.py @@ -320,14 +320,19 @@ class HubspotDealDiffer: new_survey_date = parse_hs_date(new_deal.get("confirmed_survey_date")) new_survey_time = new_deal.get("confirmed_survey_time") + new_surveyor = new_deal.get("third_party_surveyor_identifier") logger.info( "Abri job-amendment check: " "old_confirmed_survey_date=%s new_confirmed_survey_date=%s " - "old_confirmed_survey_time=%s new_confirmed_survey_time=%s", + "old_confirmed_survey_time=%s new_confirmed_survey_time=%s " + "old_third_party_surveyor_identifier=%s " + "new_third_party_surveyor_identifier=%s", old_deal.confirmed_survey_date, new_survey_date, old_deal.confirmed_survey_time, new_survey_time, + old_deal.third_party_surveyor_identifier, + new_surveyor, ) # A first-time survey date logs a new job, not an amendment. @@ -341,7 +346,10 @@ class HubspotDealDiffer: if old_deal.confirmed_survey_date != new_survey_date: return True - return old_deal.confirmed_survey_time != new_survey_time + if old_deal.confirmed_survey_time != new_survey_time: + return True + + return old_deal.third_party_surveyor_identifier != new_surveyor @staticmethod def check_for_abri_tenant_data_fetch(