feat: implement Application layer for User Update API / ユーザー更新APIのApplication層実装#518
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/user_update #518 +/- ##
======================================================
+ Coverage 59.06% 59.47% +0.41%
- Complexity 1488 1503 +15
======================================================
Files 115 119 +4
Lines 7575 7675 +100
======================================================
+ Hits 4474 4565 +91
- Misses 3101 3110 +9
🚀 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 Application layer for the User Update API as part of #500.
Also refactors
UserViewModelandUserViewModelFactoryfromCommandUseCasestoQueryUseCasesfollowing the CQS principle.ユーザー更新APIのApplication層(#500)を実装しました。
またCQS原則に基づき、
UserViewModelとUserViewModelFactoryをCommandUseCasesからQueryUseCasesへ移動しました。What I have done / 実施内容
Application層
UpdateUserCommand: required fields areid,first_name,last_name,email,age_range,subscription_tier— password is intentionally excluded (password change is a separate API)UpdateUserUseCase: buildUserEntityfrom command viaUserEntityFactory, callUserRepositroyInterface::updateUser(), returnUserDtoCQS リファクタリング
UserViewModel→QueryUseCases/ViewModel/User/UserViewModelFactory→QueryUseCases/Factory/ViewModel/QueryUseCases/Tests/ViewModel/UserControllerimport accordinglyWhy:
UserViewModelis a read/presentation object used in bothcreateUser(Command) andgetUserById(Query). Placing it inQueryUseCasescorrectly reflects its read-side nature per CQS.Test Results / テスト結果
test_fromArray_creates_command_with_valid_datatest_fromArray_sets_subscription_expires_at_when_providedtest_fromArray_throws_when_required_key_is_missing(6 cases)test_handle_passes_entity_to_repository_and_returns_dtoCloses #502