mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Fail non-retriably when amending or abandoning a deal that never logged to Abri 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fb64f9687e
commit
e85a0cb14f
1 changed files with 11 additions and 2 deletions
|
|
@ -99,6 +99,10 @@ def dispatch_abri_flows(
|
|||
|
||||
|
||||
def _run_amend(request: AbriTriggerRequest, flows: AbriFlows) -> str:
|
||||
if request.client_booking_reference is None:
|
||||
raise DealDivergedFromAbriError(
|
||||
flow="amend_job", deal_id=request.hubspot_deal_id
|
||||
)
|
||||
if (
|
||||
request.confirmed_survey_date is None
|
||||
or request.third_party_surveyor_identifier is None
|
||||
|
|
@ -165,8 +169,13 @@ def _run_log(
|
|||
|
||||
def _run_abandon(request: AbriTriggerRequest, flows: AbriFlows) -> str:
|
||||
# Runs last so a cancellation can never interfere with a log, amend or
|
||||
# tenant sync in the same batch. A missing job_no raises the retriable
|
||||
# not-yet-recorded error, which propagates so the task fails and redelivers.
|
||||
# tenant sync in the same batch. With a Job Number, a missing DB job_no
|
||||
# raises the retriable not-yet-recorded error, which propagates so the task
|
||||
# fails and redelivers; with no Job Number at all, the deal has diverged.
|
||||
if request.client_booking_reference is None:
|
||||
raise DealDivergedFromAbriError(
|
||||
flow="abandon_job", deal_id=request.hubspot_deal_id
|
||||
)
|
||||
outcome = flows.abandon_job(
|
||||
DealAbandonment(
|
||||
deal_id=request.hubspot_deal_id,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue