feat: add User registration application layer - #491
Merged
zigzagdev merged 6 commits intoJun 28, 2026
Conversation
…eateUserCommand and UserDtoFactory
3 tasks
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
With the infrastructure layer in place, the application layer is needed to orchestrate user creation. This PR introduces the command/use-case structure that sits between the presentation layer and the repository, providing input validation and a clear entry point for the create-user flow.
What I have done
CreateUserCommand— validates that all required keys (first_name,last_name,email,age_range,subscription_tier) are present in the incoming array; exposes data via public readonly propertiesCreateUserUseCase— receives aCreateUserCommandand delegates toUserRepositoryInterface, returning aUserDtoUserDtoFactory— follows the existing factory pattern underQueryUseCases/Factory/Dto/; builds aUserDtofrom a raw attribute arrayUserDto— replaced the empty stub with typed public readonly propertiesUserRepositoryInterfaceandUserRepository— changed the signature fromUserEntitytoCreateUserCommand; the repository now converts the command to DB columns directly and usesUserDtoFactoryto build the return valueUserRepositoryTest— aligned with the newCreateUserCommand-based signature; mockstoArray()on the inserted model to feedUserDtoFactoryTest Results