Coverage for src/kwai/modules/portal/domain/author.py: 100%

13 statements  

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

1"""Module for defining the Author entity.""" 

2 

3from dataclasses import dataclass 

4from typing import ClassVar, Type 

5 

6from kwai.core.domain.entity import DataclassEntity 

7from kwai.core.domain.value_objects.identifier import IntIdentifier 

8from kwai.core.domain.value_objects.unique_id import UniqueId 

9 

10 

11class AuthorIdentifier(IntIdentifier): 

12 """Identifier for an author entity.""" 

13 

14 

15@dataclass(kw_only=True, eq=False, slots=True, frozen=True) 

16class AuthorEntity(DataclassEntity): 

17 """An author entity.""" 

18 

19 ID: ClassVar[Type] = AuthorIdentifier 

20 

21 uuid: UniqueId 

22 name: str = "" 

23 active: bool = True 

24 remark: str = ""