Coverage for bc/kwai-bc-training/src/kwai_bc_training/teams/team_query.py: 100%

5 statements  

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

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

2 

3from abc import ABC, abstractmethod 

4from typing import Self 

5 

6from kwai_core.domain.repository.query import Query 

7 

8from kwai_bc_training.teams.team import TeamIdentifier 

9 

10 

11class TeamQuery(Query, ABC): 

12 """Interface for a team query.""" 

13 

14 @abstractmethod 

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

16 """Add a filter for a given id. 

17 

18 Args: 

19 id_: A team id. 

20 """ 

21 raise NotImplementedError 

22 

23 @abstractmethod 

24 def filter_by_ids(self, *id_: TeamIdentifier) -> Self: 

25 """Add a filter on one or more team identifiers. 

26 

27 Args: 

28 id_: one or more ids of a team. 

29 """ 

30 raise NotImplementedError