mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
18 lines
574 B
Python
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: ...
|