Coverage for bc/kwai-bc-club/src/kwai_bc_club/repositories/coach_query.py: 100%
7 statements
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
1"""Module that defines an interface for a coach 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
9from kwai_bc_club.domain.club_coach import ClubCoachIdentifier
10from kwai_bc_club.domain.member import MemberIdentifier
13class CoachQuery(Query, ABC):
14 """An interface for a coach query."""
16 @abstractmethod
17 def filter_by_id(self, id_: ClubCoachIdentifier) -> Self:
18 """Filter by id."""
19 raise NotImplementedError
21 @abstractmethod
22 def filter_by_active(self) -> Self:
23 """Filter on the active coaches."""
24 raise NotImplementedError
26 @abstractmethod
27 def filter_by_user_uuid(self, uuid: UniqueId) -> Self:
28 """Filter on the uuid of the user that is linked to a coach."""
29 raise NotImplementedError
31 @abstractmethod
32 def filter_by_member(self, member_id: MemberIdentifier) -> Self:
33 """Filter on the associated member of the coach."""
34 raise NotImplementedError