from __future__ import annotations from abc import ABC, abstractmethod from domain.magicplan.models import Plan class MagicPlanRepository(ABC): """Persists a MagicPlan aggregate. Implementations are expected to write child rows using bulk inserts (one round-trip per table) — the codebase targets Postgres exclusively. Upsert semantics on magic_plan_uid; child rows are deleted and re-inserted on each save (idempotent re-run behaviour per ADR-0012). """ @abstractmethod def save(self, plan: Plan, uploaded_file_id: int) -> None: ...