mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
36 lines
1.5 KiB
Python
36 lines
1.5 KiB
Python
from typing import Optional
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class BulkUploadFinaliserTriggerBody(BaseModel):
|
|
"""Trigger body for the bulk_upload_finaliser Lambda (ADR-0013, extended in
|
|
ADR-0006).
|
|
|
|
Dispatched by the Next.js Finalise action via
|
|
``POST /v1/bulk-uploads/trigger-finaliser``. ``s3_uri`` is the combiner output
|
|
(``combined_output_s3_uri``) — the same address/UPRN CSV the old synchronous
|
|
``/finalize`` route read.
|
|
|
|
v2 adds the inputs for the ``property_overrides`` write:
|
|
- ``classifier_s3_uri``: the ``{uploadId}-classifier.csv`` (raw descriptions,
|
|
joined to the combiner output by ``source_row_id``). ``None`` when no
|
|
classifier columns were mapped → no overrides written.
|
|
- ``multi_entry_ordering``: confirmed permutations keyed by entry-count
|
|
(``{count: [file positions]}``). ``{}`` when not multi-entry.
|
|
- ``column_mapping``: classifier category → source CSV header, so the
|
|
finaliser knows which classifier-CSV column feeds each override_component.
|
|
"""
|
|
|
|
model_config = ConfigDict(extra="allow")
|
|
|
|
task_id: UUID
|
|
sub_task_id: UUID
|
|
s3_uri: str
|
|
# bigint in the FE schema; Python int is unbounded so Pydantic stays simple.
|
|
portfolio_id: int
|
|
bulk_upload_id: UUID
|
|
classifier_s3_uri: Optional[str] = None
|
|
multi_entry_ordering: dict[str, list[int]] = Field(default_factory=dict)
|
|
column_mapping: dict[str, str] = Field(default_factory=dict)
|