Coverage for src/kwai/modules/club/repositories/member_query.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2024-01-01 00:00 +0000

1"""Module that defines an interface for a Member query.""" 

2 

3from abc import ABC, abstractmethod 

4from typing import Self 

5 

6from kwai.core.domain.repository.query import Query 

7from kwai.core.domain.value_objects.unique_id import UniqueId 

8from kwai.modules.club.domain.member import MemberIdentifier 

9 

10 

11class MemberQuery(Query, ABC): 

12 """An interface for a member query.""" 

13 

14 @abstractmethod 

15 def filter_by_id(self, id_: MemberIdentifier) -> Self: 

16 """Filter on the license of the member.""" 

17 

18 @abstractmethod 

19 def filter_by_license(self, license: str) -> Self: 

20 """Filter on the license of the member.""" 

21 

22 @abstractmethod 

23 def filter_by_license_date( 

24 self, license_end_month: int, license_end_year: int 

25 ) -> Self: 

26 """Filter on the license expiration date.""" 

27 

28 @abstractmethod 

29 def filter_by_active(self) -> Self: 

30 """Filter on the active members.""" 

31 

32 @abstractmethod 

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

34 """Filter on the uuid."""