Coverage for app/ddd/application/usecase/group/get_group_usecase.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-15 01:44 +0000

1from app.ddd.application.dto.group import ( 

2 GetGroupInputDTO, 

3 GetGroupOutputDTO, 

4) 

5from app.ddd.application.usecase.group.base_group_usecase import ( 

6 BaseGroupUseCase, 

7) 

8from app.ddd.domain import Group, GroupId 

9 

10 

11class GetGroupUseCase(BaseGroupUseCase[GetGroupInputDTO, GetGroupOutputDTO]): 

12 def execute(self, input_dto: GetGroupInputDTO) -> GetGroupOutputDTO: 

13 group_id: GroupId = GroupId(root=input_dto.group_id) 

14 group: Group = self._uow.group_repository.find_by_id(group_id) 

15 return GetGroupOutputDTO(group = group)