Model/repositories/magic_plan/magic_plan_repository.py
2026-06-08 15:37:52 +00:00

18 lines
574 B
Python

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