mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Abri survey creation trigger fires when confirmed_survey_date is first set on an Abri Condition deal 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
cf50c53cad
commit
bd3c45d81c
2 changed files with 36 additions and 0 deletions
|
|
@ -170,6 +170,12 @@ class HubspotDealDiffer:
|
|||
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def check_for_abri_survey_creation(
|
||||
new_deal: Dict[str, str], old_deal: HubspotDealData
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
@staticmethod
|
||||
def check_for_magicplan_trigger(
|
||||
new_deal: Dict[str, str], old_deal: HubspotDealData
|
||||
|
|
|
|||
|
|
@ -343,6 +343,36 @@ def test_magicplan_trigger__outcome_surveyed_uppercase__returns_true() -> None:
|
|||
assert result is True
|
||||
|
||||
|
||||
# ==================================
|
||||
# ABRI SURVEY CREATION TRIGGER TESTS
|
||||
# ==================================
|
||||
|
||||
|
||||
def test_abri_survey_creation__date_first_set_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=None,
|
||||
)
|
||||
new_deal = make_new_deal(
|
||||
deal_id,
|
||||
project_code="Abri Condition",
|
||||
confirmed_survey_date="2026-07-15",
|
||||
)
|
||||
|
||||
# Act
|
||||
result = HubspotDealDiffer.check_for_abri_survey_creation(
|
||||
new_deal=new_deal,
|
||||
old_deal=old_deal,
|
||||
)
|
||||
|
||||
# Assert
|
||||
assert result is True
|
||||
|
||||
|
||||
# =======================
|
||||
# DB UPDATE TRIGGER TESTS
|
||||
# =======================
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue