Abri Condition project gate is a reusable helper for future Abri triggers 🟪

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-02 16:03:34 +00:00
parent 7aabfdfa5b
commit 592173e1e5

View file

@ -175,8 +175,7 @@ class HubspotDealDiffer:
def check_for_abri_survey_creation(
new_deal: Dict[str, str], old_deal: HubspotDealData
) -> bool:
new_project_code = (new_deal.get("project_code") or "").lower()
if new_project_code != HubspotDealDiffer.ABRI_CONDITION_PROJECT_CODE.lower():
if not HubspotDealDiffer._is_abri_condition_deal(new_deal):
return False
if old_deal.confirmed_survey_date is not None:
@ -184,6 +183,11 @@ class HubspotDealDiffer:
return parse_hs_date(new_deal.get("confirmed_survey_date")) is not None
@staticmethod
def _is_abri_condition_deal(new_deal: Dict[str, str]) -> bool:
new_project_code = (new_deal.get("project_code") or "").lower()
return new_project_code == HubspotDealDiffer.ABRI_CONDITION_PROJECT_CODE.lower()
@staticmethod
def check_for_magicplan_trigger(
new_deal: Dict[str, str], old_deal: HubspotDealData