mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-22 08:48:38 +00:00
Abri tenant data fetch triggers when commencement date is first set 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
050bb78313
commit
da0ef3e5e0
2 changed files with 41 additions and 0 deletions
|
|
@ -206,6 +206,14 @@ class HubspotDealDiffer:
|
||||||
|
|
||||||
return old_deal.confirmed_survey_time != new_deal.get("confirmed_survey_time")
|
return old_deal.confirmed_survey_time != new_deal.get("confirmed_survey_time")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def check_for_abri_tenant_data_fetch(
|
||||||
|
new_deal: Dict[str, str],
|
||||||
|
new_project: Optional[ProjectData],
|
||||||
|
old_deal: HubspotDealData,
|
||||||
|
) -> bool:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _is_abri_condition_deal(
|
def _is_abri_condition_deal(
|
||||||
new_deal: Dict[str, str], new_project: Optional[ProjectData]
|
new_deal: Dict[str, str], new_project: Optional[ProjectData]
|
||||||
|
|
|
||||||
|
|
@ -687,6 +687,39 @@ def test_abri_survey_amendment__date_first_set_on_abri_deal__returns_false() ->
|
||||||
assert result is False
|
assert result is False
|
||||||
|
|
||||||
|
|
||||||
|
# ====================================
|
||||||
|
# ABRI TENANT DATA FETCH TRIGGER TESTS
|
||||||
|
# ====================================
|
||||||
|
|
||||||
|
|
||||||
|
def test_abri_tenant_data_fetch__commencement_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",
|
||||||
|
expected_commencement_date=None,
|
||||||
|
)
|
||||||
|
new_deal = make_new_deal(
|
||||||
|
deal_id,
|
||||||
|
project_code="Abri Condition",
|
||||||
|
expected_commencement_date="2026-08-01",
|
||||||
|
)
|
||||||
|
|
||||||
|
# Act
|
||||||
|
result = HubspotDealDiffer.check_for_abri_tenant_data_fetch(
|
||||||
|
new_deal=new_deal,
|
||||||
|
new_project=None,
|
||||||
|
old_deal=old_deal,
|
||||||
|
)
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
assert result is True
|
||||||
|
|
||||||
|
|
||||||
# =======================
|
# =======================
|
||||||
# DB UPDATE TRIGGER TESTS
|
# DB UPDATE TRIGGER TESTS
|
||||||
# =======================
|
# =======================
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue