Model/applications/abri/abri_trigger_request.py
Daniel Roth c281456164 A trigger message validates the fields each fired Abri flow needs 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 10:04:55 +00:00

28 lines
888 B
Python

"""The message contract between the HubSpot scraper and the abri lambda.
One message per scrape, naming every Abri flow that fired plus the deal
fields those flows need. A message missing a field its flow needs fails
validation — the resulting failed task / DLQ entry is the agreed
visibility surface.
"""
from datetime import date
from typing import Any, List, Literal, Optional
from pydantic import BaseModel, ConfigDict
AbriFlow = Literal["amend_job", "log_job", "sync_tenant_data"]
class AbriTriggerRequest(BaseModel):
model_config = ConfigDict(extra="ignore")
hubspot_deal_id: str
flows: List[AbriFlow]
place_ref: Optional[str] = None
deal_name: Optional[str] = None
confirmed_survey_date: Optional[date] = None
confirmed_survey_time: Optional[str] = None
def model_post_init(self, __context: Any) -> None:
raise NotImplementedError