This repository was archived by the owner on Jul 6, 2025. It is now read-only.
Reworking order flow with as a guest user #85
Merged
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.
This pull request includes several changes to the user registration, authentication, and order management functionalities. The key updates involve refactoring the registration process, enhancing the security configuration, and improving role management for users.
Refactoring and Enhancements:
src/main/java/com/zenfulcode/commercify/commercify/api/requests/RegisterUserRequest.java: Removed theisGuestfield and added a method to convert the request to aUserDTO.src/main/java/com/zenfulcode/commercify/commercify/api/responses/orders/GetOrderResponse.java: Added new fields for customer details and updated thefrommethod to include these fields. [1] [2]Security Configuration:
src/main/java/com/zenfulcode/commercify/commercify/config/SecurityConfig.java: Modified security settings to restrict access to certain endpoints.Controller Updates:
src/main/java/com/zenfulcode/commercify/commercify/controller/AuthenticationController.java: Refactored the registration method, removed guest-specific logic, and added a new endpoint for guest registration. [1] [2]src/main/java/com/zenfulcode/commercify/commercify/controller/OrderController.java: Updated role-based access control annotations to simplify role checks. [1] [2] [3]User Management:
src/main/java/com/zenfulcode/commercify/commercify/entity/UserEntity.java: Added methods to manage user roles and initialized the roles list. [1] [2]src/main/java/com/zenfulcode/commercify/commercify/service/UserManagementService.java: Added a method to update guest users and handle exceptions more robustly. [1] [2]These changes collectively improve the user registration process, enhance security configurations, and streamline role management within the application.