Coverage for src/kwai/modules/training/teams/team.py: 100%

10 statements  

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

1"""Module that defines a team entity.""" 

2 

3from kwai.core.domain.entity import Entity 

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

5 

6 

7TeamIdentifier = IntIdentifier 

8 

9 

10class TeamEntity(Entity[TeamIdentifier]): 

11 """A team. 

12 

13 Attributes: 

14 _id: The id of the team. 

15 _name: The name of the team. 

16 """ 

17 

18 def __init__(self, *, id_: TeamIdentifier | None = None, name: str): 

19 super().__init__(id_ or TeamIdentifier()) 

20 self._name = name 

21 

22 @property 

23 def name(self) -> str: 

24 """Return the name of the team.""" 

25 return self._name