Coverage for arclith / domain / ports / repository.py: 100%
20 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-03-25 15:02 +0100
« prev ^ index » next coverage.py v7.13.5, created at 2026-03-25 15:02 +0100
1from abc import ABC, abstractmethod
2from typing import Generic, Optional, TypeVar
4from uuid6 import UUID
6from arclith.domain.models.entity import Entity
8T = TypeVar("T", bound=Entity)
11class Repository(ABC, Generic[T]):
12 @abstractmethod
13 async def create(self, entity: T) -> T:
14 pass # pragma: no cover
16 @abstractmethod
17 async def read(self, uuid: UUID) -> Optional[T]:
18 pass # pragma: no cover
20 @abstractmethod
21 async def update(self, entity: T) -> T:
22 pass # pragma: no cover
24 @abstractmethod
25 async def delete(self, uuid: UUID) -> None:
26 pass # pragma: no cover
28 @abstractmethod
29 async def find_all(self) -> list[T]:
30 pass # pragma: no cover
32 @abstractmethod
33 async def find_deleted(self) -> list[T]:
34 pass # pragma: no cover
36 @abstractmethod
37 async def duplicate(self, uuid: UUID) -> T:
38 pass # pragma: no cover