Coverage for src/kwai/modules/training/coaches/coach.py: 88%
16 statements
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
1"""Module that defines a coach entity."""
3from kwai.core.domain.entity import Entity
4from kwai.core.domain.value_objects.identifier import IntIdentifier
5from kwai.core.domain.value_objects.name import Name
8CoachIdentifier = IntIdentifier
11class CoachEntity(Entity[CoachIdentifier]):
12 """A coach.
14 Attributes:
15 _id: The id of the coach.
16 _name: The name of the coach.
17 """
19 def __init__(self, *, id_: CoachIdentifier | None = None, name: Name, active: bool):
20 super().__init__(id_ or CoachIdentifier())
21 self._id = id_
22 self._name = name
23 self._active = active
25 @property
26 def name(self) -> Name:
27 """Return the name of the coach."""
28 return self._name
30 @property
31 def is_active(self) -> bool:
32 """Return True when the coach is still active, False otherwise."""
33 return self._active