Coverage for bc/kwai-bc-identity/src/kwai_bc_identity/users/user_query.py: 100%

8 statements  

« 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 query.""" 

2 

3from abc import abstractmethod 

4 

5from kwai_core.domain.repository.query import Query 

6from kwai_core.domain.value_objects.email_address import EmailAddress 

7from kwai_core.domain.value_objects.unique_id import UniqueId 

8 

9from kwai_bc_identity.users.user import UserIdentifier 

10 

11 

12class UserQuery(Query): 

13 """Interface for a user query.""" 

14 

15 @abstractmethod 

16 def filter_by_id(self, id_: UserIdentifier) -> "UserQuery": 

17 """Add a filter to the query for the id of the user.""" 

18 raise NotImplementedError 

19 

20 def filter_by_uuid(self, uuid: UniqueId) -> "UserQuery": 

21 """Add a filter for a user with the given unique id.""" 

22 raise NotImplementedError 

23 

24 def filter_by_email(self, email: EmailAddress) -> "UserQuery": 

25 """Add a filter for a user with the given email address.""" 

26 raise NotImplementedError