mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-19 08:53:17 +00:00
Repair the Abri trigger-builder import after its move into HubspotDealDiffer
The move in 3934e2d3 left the trigger-builder test and local smoke script
importing the deleted etl.hubspot.abri_flow_triggers module; point them at
HubspotDealDiffer.check_abri_triggers_and_construct_message so they collect
and run again.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8aa2841546
commit
70fb6d5735
2 changed files with 11 additions and 13 deletions
|
|
@ -3,7 +3,7 @@ from typing import Any, Dict
|
|||
import uuid
|
||||
|
||||
from backend.app.db.models.hubspot_deal_data import HubspotDealData
|
||||
from etl.hubspot.abri_flow_triggers import check_for_abri_triggers_and_construct_message
|
||||
from etl.hubspot.hubspot_deal_differ import HubspotDealDiffer
|
||||
|
||||
BASE_TIME = datetime(2025, 12, 1, 12, 0, 0)
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ def test_a_first_confirmed_survey_date_builds_a_log_job_message() -> None:
|
|||
)
|
||||
|
||||
# Act
|
||||
message = check_for_abri_triggers_and_construct_message(
|
||||
message = HubspotDealDiffer.check_abri_triggers_and_construct_message(
|
||||
hubspot_deal_id=DEAL_ID,
|
||||
new_deal=new_deal,
|
||||
new_project=None,
|
||||
|
|
@ -76,7 +76,7 @@ def test_a_changed_confirmed_survey_date_builds_an_amend_job_message() -> None:
|
|||
)
|
||||
|
||||
# Act
|
||||
message = check_for_abri_triggers_and_construct_message(
|
||||
message = HubspotDealDiffer.check_abri_triggers_and_construct_message(
|
||||
hubspot_deal_id=DEAL_ID,
|
||||
new_deal=new_deal,
|
||||
new_project=None,
|
||||
|
|
@ -98,7 +98,7 @@ def test_a_first_expected_commencement_date_builds_a_tenant_sync_message() -> No
|
|||
new_deal = make_new_deal(expected_commencement_date="2026-07-01")
|
||||
|
||||
# Act
|
||||
message = check_for_abri_triggers_and_construct_message(
|
||||
message = HubspotDealDiffer.check_abri_triggers_and_construct_message(
|
||||
hubspot_deal_id=DEAL_ID,
|
||||
new_deal=new_deal,
|
||||
new_project=None,
|
||||
|
|
@ -131,7 +131,7 @@ def test_several_flows_firing_in_one_scrape_share_one_message() -> None:
|
|||
)
|
||||
|
||||
# Act
|
||||
message = check_for_abri_triggers_and_construct_message(
|
||||
message = HubspotDealDiffer.check_abri_triggers_and_construct_message(
|
||||
hubspot_deal_id=DEAL_ID,
|
||||
new_deal=new_deal,
|
||||
new_project=None,
|
||||
|
|
@ -155,7 +155,7 @@ def test_no_message_when_no_abri_trigger_fires() -> None:
|
|||
new_deal = make_new_deal(outcome="left voicemail")
|
||||
|
||||
# Act
|
||||
message = check_for_abri_triggers_and_construct_message(
|
||||
message = HubspotDealDiffer.check_abri_triggers_and_construct_message(
|
||||
hubspot_deal_id=DEAL_ID,
|
||||
new_deal=new_deal,
|
||||
new_project=None,
|
||||
|
|
@ -173,7 +173,7 @@ def test_no_message_for_a_non_abri_deal() -> None:
|
|||
new_deal = make_new_deal(project_code="Other", confirmed_survey_date="2026-06-24")
|
||||
|
||||
# Act
|
||||
message = check_for_abri_triggers_and_construct_message(
|
||||
message = HubspotDealDiffer.check_abri_triggers_and_construct_message(
|
||||
hubspot_deal_id=DEAL_ID,
|
||||
new_deal=new_deal,
|
||||
new_project=None,
|
||||
|
|
@ -194,7 +194,7 @@ def test_abandonment_alone_stays_unwired_and_builds_no_message() -> None:
|
|||
new_deal = make_new_deal(number_of_attempts="3", outcome="no answer")
|
||||
|
||||
# Act
|
||||
message = check_for_abri_triggers_and_construct_message(
|
||||
message = HubspotDealDiffer.check_abri_triggers_and_construct_message(
|
||||
hubspot_deal_id=DEAL_ID,
|
||||
new_deal=new_deal,
|
||||
new_project=None,
|
||||
|
|
@ -218,7 +218,7 @@ def test_a_missing_listing_still_builds_the_message_without_a_place_ref() -> Non
|
|||
new_deal = make_new_deal(confirmed_survey_date="2026-06-24")
|
||||
|
||||
# Act
|
||||
message = check_for_abri_triggers_and_construct_message(
|
||||
message = HubspotDealDiffer.check_abri_triggers_and_construct_message(
|
||||
hubspot_deal_id=DEAL_ID,
|
||||
new_deal=new_deal,
|
||||
new_project=None,
|
||||
|
|
|
|||
|
|
@ -129,9 +129,7 @@ def main() -> None:
|
|||
from applications.abri.abri_trigger_request import AbriTriggerRequest
|
||||
from applications.abri.dispatch import dispatch_abri_flows
|
||||
from backend.app.db.models.hubspot_deal_data import HubspotDealData
|
||||
from etl.hubspot.abri_flow_triggers import (
|
||||
check_for_abri_triggers_and_construct_message,
|
||||
)
|
||||
from etl.hubspot.hubspot_deal_differ import HubspotDealDiffer
|
||||
from etl.hubspot.hubspotClient import HubspotClient
|
||||
from infrastructure.abri.abri_client import AbriClient
|
||||
from infrastructure.abri.config import AbriConfig
|
||||
|
|
@ -198,7 +196,7 @@ def main() -> None:
|
|||
f"job_no={deal_row.client_booking_reference}"
|
||||
)
|
||||
|
||||
message = check_for_abri_triggers_and_construct_message(
|
||||
message = HubspotDealDiffer.check_abri_triggers_and_construct_message(
|
||||
hubspot_deal_id=DEAL_ID,
|
||||
new_deal=hubspot_deal,
|
||||
new_project=project,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue