mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
pashub trigger true if coordination complete and pashub link set 🟩
This commit is contained in:
parent
ad2c979b15
commit
832bcd96e4
1 changed files with 16 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue