Coverage for src/kwai/modules/identity/users/user_account_query.py: 100%
6 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 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.modules.identity.users.user_account import UserAccountIdentifier
11class UserAccountQuery(Query):
12 """Interface for a user account query."""
14 @abstractmethod
15 def filter_by_id(self, id_: UserAccountIdentifier) -> Self:
16 """Add a filter to the query with the id of the user."""
17 raise NotImplementedError
19 @abstractmethod
20 def filter_by_email(self, email: EmailAddress) -> Self:
21 """Add a filter to the query with the email of the user."""
22 raise NotImplementedError