Fix coordination/design field names and add MagicPlan trigger to HubspotDealDiffer 🟩

This commit is contained in:
Daniel Roth 2026-05-08 12:55:23 +00:00
parent 676022a4c0
commit 69faa530a4

View file

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