Coverage for src/kwai/modules/club/repositories/person_repository.py: 100%
4 statements
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
1"""Module that defines an interface for a person repository."""
3from abc import ABC, abstractmethod
5from kwai.modules.club.domain.person import PersonEntity, PersonIdentifier
8class PersonNotFoundException(Exception):
9 """Raised when a person cannot be found."""
12class PersonRepository(ABC):
13 """An interface for a person repository."""
15 @abstractmethod
16 async def create(self, person: PersonEntity) -> PersonEntity:
17 """Save a person entity."""
19 @abstractmethod
20 async def update(self, person: PersonEntity) -> None:
21 """Update a person entity."""
23 @abstractmethod
24 async def delete(self, person: PersonEntity):
25 """Delete a person entity."""
27 @abstractmethod
28 async def get(self, id_: PersonIdentifier) -> PersonEntity:
29 """Get the person for the given id."""