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. """ ...