Coverage for bc/kwai-bc-training/src/kwai_bc_training/coaches/coach_query.py: 100%
6 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_training.coaches.coach import CoachIdentifier
12class CoachQuery(Query, ABC):
13 """Interface for a coach query."""
15 @abstractmethod
16 def filter_by_id(self, id_: CoachIdentifier) -> Self:
17 """Add a filter for a given id.
19 Args:
20 id_: A coach id.
21 """
22 raise NotImplementedError
24 @abstractmethod
25 def filter_by_ids(self, *id_: CoachIdentifier) -> Self:
26 """Add a filter on one or more coach identifiers.
28 Args:
29 id_: one or more ids of a coach.
30 """
31 raise NotImplementedError
33 @abstractmethod
34 def filter_by_active(self) -> Self:
35 """Add a filter for the active coaches."""
36 raise NotImplementedError
38 @abstractmethod
39 def filter_by_uuid(self, uuid: UniqueId) -> Self:
40 """Add a filter for getting the coach for the given uuid of a member."""
41 raise NotImplementedError
43 @abstractmethod
44 def filter_by_uuids(self, *uuids: UniqueId) -> Self:
45 """Add a filter for getting the coach for the given member uuids."""
46 raise NotImplementedError