pashub trigger true if coordination complete and pashub link set 🟩

This commit is contained in:
Daniel Roth 2026-04-08 15:42:29 +00:00
parent ad2c979b15
commit 832bcd96e4

View file

@ -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