Abri survey amendment trigger fires when the confirmed survey date changes on an Abri condition deal 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-02 16:47:07 +00:00
parent 5df78cf9ba
commit 1c75b44630
2 changed files with 39 additions and 0 deletions

View file

@ -187,6 +187,14 @@ class HubspotDealDiffer:
return parse_hs_date(new_deal.get("confirmed_survey_date")) is not None
@staticmethod
def check_for_abri_survey_amendment(
new_deal: Dict[str, str],
new_project: Optional[ProjectData],
old_deal: HubspotDealData,
) -> bool:
raise NotImplementedError
@staticmethod
def _is_abri_condition_deal(
new_deal: Dict[str, str], new_project: Optional[ProjectData]

View file

@ -548,6 +548,37 @@ def test_abri_survey_creation__non_abri_project_id_with_abri_code__returns_false
assert result is False
# ===================================
# ABRI SURVEY AMENDMENT TRIGGER TESTS
# ===================================
def test_abri_survey_amendment__date_changed_on_abri_deal__returns_true() -> None:
deal_id = uuid.uuid4()
# Arrange
old_deal = make_old_deal(
id=deal_id,
project_code="Abri Condition",
confirmed_survey_date=datetime(2026, 7, 1, tzinfo=timezone.utc),
)
new_deal = make_new_deal(
deal_id,
project_code="Abri Condition",
confirmed_survey_date="2026-07-15",
)
# Act
result = HubspotDealDiffer.check_for_abri_survey_amendment(
new_deal=new_deal,
new_project=None,
old_deal=old_deal,
)
# Assert
assert result is True
# =======================
# DB UPDATE TRIGGER TESTS
# =======================