From 69faa530a4c5a4dce34a00919baf965e2f59943a Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 8 May 2026 12:55:23 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20coordination/design=20field=20names=20and?= =?UTF-8?q?=20add=20MagicPlan=20trigger=20to=20HubspotDealDiffer=20?= =?UTF-8?q?=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etl/hubspot/hubspot_deal_differ.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/etl/hubspot/hubspot_deal_differ.py b/etl/hubspot/hubspot_deal_differ.py index a53df4f7..5435a46d 100644 --- a/etl/hubspot/hubspot_deal_differ.py +++ b/etl/hubspot/hubspot_deal_differ.py @@ -178,7 +178,7 @@ class HubspotDealDiffer: def _coordination_completed( new_deal: Dict[str, str], old_deal: HubspotDealData ) -> bool: - new_status: str = new_deal.get("coordination_status") or "" + new_status: str = new_deal.get("coordination_status__stage_1_") or "" return ( new_status != "" and new_status.lower() in HubspotDealDiffer.COORDINATION_COMPLETE @@ -187,7 +187,7 @@ class HubspotDealDiffer: @staticmethod def _design_completed(new_deal: Dict[str, str], old_deal: HubspotDealData) -> bool: - new_status: str = new_deal.get("design_status") or "" + new_status: str = new_deal.get("retrofit_design_status") or "" return ( new_status != "" and new_status.lower() == HubspotDealDiffer.RETROFIT_DESIGN_COMPLETE @@ -198,7 +198,12 @@ class HubspotDealDiffer: def check_for_magicplan_trigger( new_deal: Dict[str, str], old_deal: HubspotDealData ) -> bool: - raise NotImplementedError + new_status = (new_deal.get("coordination_status__stage_1_") or "").lower() + old_status = (old_deal.coordination_status or "").lower() + return ( + new_status in HubspotDealDiffer.COORDINATION_COMPLETE + and old_status not in HubspotDealDiffer.COORDINATION_COMPLETE + ) @staticmethod def _lodgement_completed(