From 6de0da869e664a9f49c0d81954d2355283e44be4 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 3 Jul 2026 10:11:14 +0000 Subject: [PATCH] =?UTF-8?q?Abri=20deal=20abandonment=20requires=20a=20nega?= =?UTF-8?q?tive=20outcome=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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/etl/hubspot/hubspot_deal_differ.py b/etl/hubspot/hubspot_deal_differ.py index 1ce82ba3a..96a771a12 100644 --- a/etl/hubspot/hubspot_deal_differ.py +++ b/etl/hubspot/hubspot_deal_differ.py @@ -13,6 +13,13 @@ class HubspotDealDiffer: ] RETROFIT_DESIGN_COMPLETE = "uploaded" LODGEMENT_COMPLETE: List[str] = ["lodgement complete", "measures lodged"] + NEGATIVE_OUTCOMES: List[str] = [ + "no answer", + "cancelled", + "no show", + "tenant refusal", + "not viable", + ] ABRI_CONDITION_ASSOCIATED_PROJECT_ID = "123456" ABRI_CONDITION_PROJECT_CODE = "Abri Condition" @@ -230,7 +237,11 @@ class HubspotDealDiffer: return False new_attempts = parse_hs_int(new_deal.get("number_of_attempts")) - return new_attempts is not None and new_attempts >= 3 + if new_attempts is None or new_attempts < 3: + return False + + new_outcome = (new_deal.get("outcome") or "").lower() + return new_outcome in HubspotDealDiffer.NEGATIVE_OUTCOMES @staticmethod def check_for_magicplan_trigger(