Coverage for src/kwai/modules/identity/users/user_account_query.py: 100%

7 statements  

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

2 

3from abc import abstractmethod 

4from typing import Self 

5 

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 

9from kwai.modules.identity.users.user_account import UserAccountIdentifier 

10 

11 

12class UserAccountQuery(Query): 

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

14 

15 @abstractmethod 

16 def filter_by_id(self, id_: UserAccountIdentifier) -> Self: 

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

18 raise NotImplementedError 

19 

20 @abstractmethod 

21 def filter_by_uuid(self, uuid: UniqueId) -> Self: 

22 """Add a filter to the query with the uuid of the user.""" 

23 raise NotImplementedError 

24 

25 @abstractmethod 

26 def filter_by_email(self, email: EmailAddress) -> Self: 

27 """Add a filter to the query with the email of the user.""" 

28 raise NotImplementedError