feat: implement User Delete API / ユーザー削除APIの実装#524
Open
zigzagdev wants to merge 11 commits into
Open
Conversation
feat: implement deleteUser in Infra layer / Infra層のdeleteUser実装
…ayer feat: implement Application layer for User Delete API / Application層のDeleteUserUseCase実装
…layer
feat: implement Presentation layer for DELETE /api/v1/users/{id} / ユーザー削除APIのPresentation層実装
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/user #524 +/- ##
===============================================
+ Coverage 59.94% 60.30% +0.35%
- Complexity 1515 1534 +19
===============================================
Files 120 123 +3
Lines 7765 7854 +89
===============================================
+ Hits 4655 4736 +81
- Misses 3110 3118 +8
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / 目的
Implement the User Delete API (
DELETE /api/v1/users/{id}) across all layers as part of #514.ユーザー削除API(
DELETE /api/v1/users/{id})をInfra・Application・Presentation層にわたって実装しました(#514)。What I have done / 実施内容
Infra層 (PR #521)
UserRepositroyInterface:deleteUser(int $id): voidを追加UserRepository:deleteUser実装Exception('User not found.')をスローdelete()でレコードを削除UserRepositoryTest: DBインテグレーションテストを2件追加Application層 (PR #522)
DeleteUserUseCase:handle(int $id): voidUserRepositroyInterface::deleteUser()を呼び出し、例外はリポジトリから自動伝播Presentation層 (PR #523)
UserController::deleteUser(): route{id}を int にキャストしてDeleteUserUseCaseを呼び出す'User not found.'exception is thrownLog::errorDELETE /api/v1/users/{id}Test Results / テスト結果
Infra層
test_deleteUser_removes_user_when_existstest_deleteUser_throws_exception_when_user_not_foundApplication層
test_handle_calls_repository_deleteUser_with_given_idtest_handle_propagates_exception_when_user_not_foundPresentation層
test_delete_user_returns_200_when_user_existstest_delete_user_returns_404_when_user_not_foundCloses #514