mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Accept an abandon_job flow carrying the deal outcome 🟩
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8cc6ee9f76
commit
db5ff971d8
1 changed files with 5 additions and 1 deletions
|
|
@ -11,13 +11,16 @@ from typing import Dict, List, Literal, Optional, Tuple
|
|||
|
||||
from pydantic import BaseModel, ConfigDict, Field, model_validator
|
||||
|
||||
AbriFlow = Literal["amend_job", "log_job", "sync_tenant_data"]
|
||||
AbriFlow = Literal["amend_job", "log_job", "sync_tenant_data", "abandon_job"]
|
||||
|
||||
# The deal fields each flow reads; hubspot_deal_id is always required.
|
||||
# abandon_job needs no field beyond the deal id (the outcome is optional, only
|
||||
# feeding the reason-mapping seam).
|
||||
_FIELDS_BY_FLOW: Dict[AbriFlow, Tuple[str, ...]] = {
|
||||
"amend_job": ("confirmed_survey_date",),
|
||||
"log_job": ("place_ref", "deal_name", "confirmed_survey_date"),
|
||||
"sync_tenant_data": ("place_ref",),
|
||||
"abandon_job": (),
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -30,6 +33,7 @@ class AbriTriggerRequest(BaseModel):
|
|||
deal_name: Optional[str] = None
|
||||
confirmed_survey_date: Optional[date] = None
|
||||
confirmed_survey_time: Optional[str] = None
|
||||
outcome: Optional[str] = None
|
||||
|
||||
@model_validator(mode="after")
|
||||
def _each_fired_flow_has_its_fields(self) -> "AbriTriggerRequest":
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue