Coverage for bc/kwai-bc-portal/src/kwai_bc_portal/repositories/author_query.py: 100%
6 statements
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
1"""Module that defines an interface for an Author query."""
3from abc import ABC, abstractmethod
4from typing import Self
6from kwai_core.domain.repository.query import Query
7from kwai_core.domain.value_objects.unique_id import UniqueId
9from kwai_bc_portal.domain.author import AuthorIdentifier
12class AuthorQuery(Query, ABC):
13 """An interface for an author query."""
15 @abstractmethod
16 def filter_by_id(self, id_: AuthorIdentifier) -> Self:
17 """Filter an author on its id."""
19 @abstractmethod
20 def filter_by_uuid(self, uuid: UniqueId) -> Self:
21 """Filter an author on its unique user id."""