Coverage for app/ddd/application/usecase/user/delete_user_usecase.py: 100%
9 statements
« prev ^ index » next coverage.py v7.6.10, created at 2025-01-15 01:44 +0000
« prev ^ index » next coverage.py v7.6.10, created at 2025-01-15 01:44 +0000
1from app.ddd.application.dto.user import DeleteUserInputDTO, DeleteUserOutputDTO
2from app.ddd.application.usecase.user.base_user_usecase import BaseUserUseCase
3from app.ddd.domain import UserId
6class DeleteUserUseCase(BaseUserUseCase[DeleteUserInputDTO, DeleteUserOutputDTO]):
7 def execute(self, input_dto: DeleteUserInputDTO) -> DeleteUserOutputDTO:
8 user_id: UserId = UserId(root=input_dto.user_id)
9 with self._uow:
10 self._uow.user_repository.delete(user_id)
11 return DeleteUserOutputDTO(user_id = user_id.root)