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

9 statements  

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

1from app.ddd.application.dto.group import DeleteGroupInputDTO, DeleteGroupOutputDTO 

2from app.ddd.application.usecase.group.base_group_usecase import BaseGroupUseCase 

3from app.ddd.domain import GroupId 

4 

5 

6class DeleteGroupUseCase(BaseGroupUseCase[DeleteGroupInputDTO, DeleteGroupOutputDTO]): 

7 def execute(self, input_dto: DeleteGroupInputDTO) -> DeleteGroupOutputDTO: 

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

9 with self._uow: 

10 self._uow.group_repository.delete(group_id) 

11 return DeleteGroupOutputDTO(group_id = group_id.root)