Model/backend/app/documents/schemas.py
Khalim Conn-Kowlessar 3c00e0ef00 FastAPI trigger route: POST /v1/documents/bulk-download 🟩
Resolves the authenticated requester's email (ADR-0059), resolves + caps the
property selection, pins the recipe (landlord_property_ids, recipient_email,
package_name) onto one pre-created sub_task (raw SQL, dodging the mirror
double-registration), and enqueues one message to the worker. Refuses
double-submits (409) and oversized selections (400).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 09:59:02 +00:00

19 lines
542 B
Python

from typing import Optional
from uuid import UUID
from pydantic import BaseModel
class BulkDownloadRequest(BaseModel):
"""A request to assemble a Download Package (ADR-0060).
The front end creates the app-owned Task first (its own request lands in
``task.inputs``) and passes ``task_id`` here. Either an explicit
``property_ids`` selection or ``select_all`` (the whole portfolio) must be
given.
"""
task_id: UUID
portfolio_id: int
property_ids: Optional[list[int]] = None
select_all: bool = False