diff --git a/backend/hubspot_trigger_orchestrator/hubspot_deal_differ.py b/backend/hubspot_trigger_orchestrator/hubspot_deal_differ.py index ad20aca7..8f96ce73 100644 --- a/backend/hubspot_trigger_orchestrator/hubspot_deal_differ.py +++ b/backend/hubspot_trigger_orchestrator/hubspot_deal_differ.py @@ -20,6 +20,7 @@ class HubspotDealDiffer: "v2 ioe/mtp complete", ] RETROFIT_DESIGN_COMPLETE = "uploaded" + LODGEMENT_COMPLETE: List[str] = ["lodgement complete", "measures lodged"] new_pashub_link: str = new_deal.get("pashub_link", "") @@ -53,7 +54,17 @@ class HubspotDealDiffer: ): return True - raise NotImplementedError + # Case 4 + new_lodgement_status: str = new_deal.get("lodgement_status", "") + + if ( + new_lodgement_status + and new_lodgement_status in LODGEMENT_COMPLETE + and new_lodgement_status != old_deal.lodgement_status + ): + return True + + return False @staticmethod def check_for_db_update_trigger(