Coverage for bc/kwai-bc-portal/src/kwai_bc_portal/repositories/author_query.py: 100%

6 statements  

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

1"""Module that defines an interface for an Author 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 

8 

9from kwai_bc_portal.domain.author import AuthorIdentifier 

10 

11 

12class AuthorQuery(Query, ABC): 

13 """An interface for an author query.""" 

14 

15 @abstractmethod 

16 def filter_by_id(self, id_: AuthorIdentifier) -> Self: 

17 """Filter an author on its id.""" 

18 

19 @abstractmethod 

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

21 """Filter an author on its unique user id."""