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
« 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."""
3from abc import ABC, abstractmethod
4from typing import Self
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
11class MemberQuery(Query, ABC):
12 """An interface for a member query."""
14 @abstractmethod
15 def filter_by_id(self, id_: MemberIdentifier) -> Self:
16 """Filter on the license of the member."""
18 @abstractmethod
19 def filter_by_license(self, license: str) -> Self:
20 """Filter on the license of the member."""
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."""
28 @abstractmethod
29 def filter_by_active(self) -> Self:
30 """Filter on the active members."""
32 @abstractmethod
33 def filter_by_uuid(self, uuid: UniqueId) -> Self:
34 """Filter on the uuid."""