Coverage for src/kwai/modules/portal/repositories/author_query.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.8.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 

8from kwai.modules.portal.domain.author import AuthorIdentifier 

9 

10 

11class AuthorQuery(Query, ABC): 

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

13 

14 @abstractmethod 

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

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

17 

18 @abstractmethod 

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

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