Coverage for bc/kwai-bc-identity/src/kwai_bc_identity/users/user_account_query.py: 100%
7 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 the interface for a user account query."""
3from abc import abstractmethod
4from typing import Self
6from kwai_core.domain.repository.query import Query
7from kwai_core.domain.value_objects.email_address import EmailAddress
8from kwai_core.domain.value_objects.unique_id import UniqueId
10from kwai_bc_identity.users.user_account import UserAccountIdentifier
13class UserAccountQuery(Query):
14 """Interface for a user account query."""
16 @abstractmethod
17 def filter_by_id(self, id_: UserAccountIdentifier) -> Self:
18 """Add a filter to the query with the id of the user."""
19 raise NotImplementedError
21 @abstractmethod
22 def filter_by_uuid(self, uuid: UniqueId) -> Self:
23 """Add a filter to the query with the uuid of the user."""
24 raise NotImplementedError
26 @abstractmethod
27 def filter_by_email(self, email: EmailAddress) -> Self:
28 """Add a filter to the query with the email of the user."""
29 raise NotImplementedError