A deal crossing into abandonment builds an abandon_job message 🟥

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-07 15:53:47 +00:00
parent 70fb6d5735
commit aaa8c9763f

View file

@ -62,6 +62,7 @@ def test_a_first_confirmed_survey_date_builds_a_log_job_message() -> None:
"deal_name": "49 Admers Crescent",
"confirmed_survey_date": "2026-06-24",
"confirmed_survey_time": "14:30",
"outcome": None,
}
@ -185,9 +186,9 @@ def test_no_message_for_a_non_abri_deal() -> None:
assert message is None
def test_abandonment_alone_stays_unwired_and_builds_no_message() -> None:
# Arrange: the abandonment predicate would fire, but CancelJob does not
# exist yet, so no flow may be dispatched for it.
def test_a_deal_crossing_into_abandonment_builds_an_abandon_job_message() -> None:
# Arrange: attempts reach the threshold with a negative outcome, so the
# deal crosses into the abandoned state and the abandon flow fires.
old_deal = make_old_deal(
project_code=ABRI_PROJECT_CODE, number_of_attempts="2", outcome=None
)
@ -203,7 +204,9 @@ def test_abandonment_alone_stays_unwired_and_builds_no_message() -> None:
)
# Assert
assert message is None
assert message is not None
assert message["flows"] == ["abandon_job"]
assert message["outcome"] == "no answer"
# ==========================