from abc import ABC, abstractmethod from uuid import UUID from domain.tasks.subtasks import SubTask class SubTaskRepository(ABC): @abstractmethod def create(self, subtask: SubTask) -> SubTask: ... @abstractmethod def create_many(self, subtasks: list[SubTask]) -> None: """Persist many SubTasks in one round-trip (one INSERT + one commit) — the batch form of ``create`` for callers that fan a Task out into many children at once.""" ... @abstractmethod def get(self, subtask_id: UUID) -> SubTask: ... @abstractmethod def save(self, subtask: SubTask) -> None: ... @abstractmethod def save_many(self, subtasks: list[SubTask]) -> None: """Persist updates to many SubTasks in one round-trip (one bulk fetch + one commit) — the batch form of ``save``.""" ... @abstractmethod def list_by_task(self, task_id: UUID) -> list[SubTask]: ...