Model/repositories/bulk_upload/bulk_upload_status_writer.py
2026-06-04 11:47:42 +00:00

24 lines
914 B
Python

from __future__ import annotations
from abc import ABC, abstractmethod
from uuid import UUID
class BulkUploadStatusWriter(ABC):
"""Port: writes the terminal BulkUpload status at Finalise (ADR-0013).
The finaliser owns the terminal write — Next.js no longer writes ``complete``;
it only flips ``awaiting_review → finalising`` at dispatch (ADR-0005). This is
the backend half of that "two writers" split, alongside the combiner's
``combining``/``awaiting_review`` writes.
"""
@abstractmethod
def set_status(self, task_id: UUID, status: str) -> None:
"""Set the status of the bulk_address_uploads row for ``task_id``.
Does not commit — the caller owns the transaction boundary, so the status
flip can share the same transaction as the property insert (atomic
finalise) or run in its own session for the failure path.
"""
...