From 832bcd96e457a71453e1d4d2aa97a73dcba1b243 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 8 Apr 2026 15:42:29 +0000 Subject: [PATCH] =?UTF-8?q?pashub=20trigger=20true=20if=20coordination=20c?= =?UTF-8?q?omplete=20and=20pashub=20link=20set=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hubspot_deal_differ.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/backend/hubspot_trigger_orchestrator/hubspot_deal_differ.py b/backend/hubspot_trigger_orchestrator/hubspot_deal_differ.py index ab2b667e..77208432 100644 --- a/backend/hubspot_trigger_orchestrator/hubspot_deal_differ.py +++ b/backend/hubspot_trigger_orchestrator/hubspot_deal_differ.py @@ -1,4 +1,4 @@ -from typing import Dict, Optional +from typing import Dict, List, Optional from backend.app.db.models.organisation import HubspotDealData @@ -15,7 +15,11 @@ class HubspotDealDiffer: Case 3: Design is completed (and PasHub Link is populated) Case 4: Lodgement is completed (and PasHub Link is populated) """ - new_pashub_link: Optional[str] = new_deal.get("pashub_link", "") + new_pashub_link: str = new_deal.get("pashub_link", "") + COORDINATION_COMPLETE: List[str] = [ + "v1 ioe/mtp complete", + "v2 ioe/mtp complete", + ] # Case 1 if not new_pashub_link: return False @@ -26,6 +30,16 @@ class HubspotDealDiffer: if old_deal.pashub_link != new_pashub_link: return True + # Case 2 + new_coordination_status: str = new_deal.get("coordination_status", "") + + if ( + new_coordination_status + and new_coordination_status in COORDINATION_COMPLETE + and new_coordination_status != old_deal.coordination_status + ): + return True + raise NotImplementedError @staticmethod