mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Abri deal abandonment triggers after three attempts with a negative outcome 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
701a6aa5cd
commit
aca507cc47
2 changed files with 42 additions and 0 deletions
|
|
@ -220,6 +220,14 @@ class HubspotDealDiffer:
|
|||
|
||||
return parse_hs_date(new_deal.get("expected_commencement_date")) is not None
|
||||
|
||||
@staticmethod
|
||||
def check_for_abri_deal_abandonment(
|
||||
new_deal: Dict[str, str],
|
||||
new_project: Optional[ProjectData],
|
||||
old_deal: HubspotDealData,
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
@staticmethod
|
||||
def check_for_magicplan_trigger(
|
||||
new_deal: Dict[str, str], old_deal: HubspotDealData
|
||||
|
|
|
|||
|
|
@ -867,6 +867,40 @@ def test_abri_tenant_data_fetch__non_abri_project_id_with_abri_code__returns_fal
|
|||
assert result is False
|
||||
|
||||
|
||||
# ====================================
|
||||
# ABRI DEAL ABANDONMENT TRIGGER TESTS
|
||||
# ====================================
|
||||
|
||||
|
||||
def test_abri_deal_abandonment__third_attempt_with_negative_outcome__returns_true() -> (
|
||||
None
|
||||
):
|
||||
deal_id = uuid.uuid4()
|
||||
|
||||
# Arrange
|
||||
old_deal = make_old_deal(
|
||||
id=deal_id,
|
||||
project_code="Abri Condition",
|
||||
outcome=None,
|
||||
)
|
||||
new_deal = make_new_deal(
|
||||
deal_id,
|
||||
project_code="Abri Condition",
|
||||
number_of_attempts="3",
|
||||
outcome="No Answer",
|
||||
)
|
||||
|
||||
# Act
|
||||
result = HubspotDealDiffer.check_for_abri_deal_abandonment(
|
||||
new_deal=new_deal,
|
||||
new_project=None,
|
||||
old_deal=old_deal,
|
||||
)
|
||||
|
||||
# Assert
|
||||
assert result is True
|
||||
|
||||
|
||||
# =======================
|
||||
# DB UPDATE TRIGGER TESTS
|
||||
# =======================
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue