Skip to content

Add address management and user details retrieval functionality#24

Merged
NourAlPha merged 4 commits intoadd-actuatorfrom
add-user-info
May 14, 2025
Merged

Add address management and user details retrieval functionality#24
NourAlPha merged 4 commits intoadd-actuatorfrom
add-user-info

Conversation

@NourAlPha
Copy link
Copy Markdown
Contributor

This pull request introduces several updates to enhance user profile management, including support for address handling, mobile number validation, and improved user details retrieval. The changes span multiple files and involve updates to the data model, service logic, and controller endpoints.

Enhancements to User Profile Management:

  1. Address and Mobile Number Support:

    • Added a new Address entity with fields for street, city, state, country, and postal code, along with a one-to-one relationship with the User entity (src/main/java/com/podzilla/auth/model/Address.java).
    • Updated the User entity to include a mobileNumber field and a one-to-one relationship with the Address entity (src/main/java/com/podzilla/auth/model/User.java).
    • Introduced validation for unique mobile numbers in the UserRepository (src/main/java/com/podzilla/auth/repository/UserRepository.java).
  2. Controller Updates:

    • Modified the /update endpoint to accept an UpdateRequest object for updating user name, mobile number, and address (src/main/java/com/podzilla/auth/controller/UserController.java).
    • Added a new /details endpoint to fetch user details, including address and mobile number (src/main/java/com/podzilla/auth/controller/UserController.java).
  3. Service Layer Enhancements:

    • Refactored UserService to handle updates for name, mobile number, and address, with validation for address fields and mobile number uniqueness (src/main/java/com/podzilla/auth/service/UserService.java). [1] [2]
    • Added a method to retrieve user details, including address, in the UserService (src/main/java/com/podzilla/auth/service/UserService.java).

DTO and Utility Updates:

  1. New and Updated DTOs:

    • Added UpdateRequest and UserDetailsRequest DTOs to encapsulate update and user details payloads (src/main/java/com/podzilla/auth/dto/UpdateRequest.java, src/main/java/com/podzilla/auth/dto/UserDetailsRequest.java). [1] [2]
    • Updated SignupRequest to include mobileNumber and address fields (src/main/java/com/podzilla/auth/dto/SignupRequest.java).
  2. Custom User Details:

    • Enhanced CustomUserDetails to include a UUID id field for better identification (src/main/java/com/podzilla/auth/dto/CustomUserDetails.java).

Authentication Improvements:

  1. Header Enhancements:
    • Updated AuthenticationService to include the user ID in response headers (src/main/java/com/podzilla/auth/service/AuthenticationService.java). [1] [2]
    • Added a utility method to retrieve the current user's details (src/main/java/com/podzilla/auth/service/AuthenticationService.java).

Dependency Updates:

  1. Library Version Update:
    • Upgraded podzilla-utils-lib dependency to version v1.1.6 in the pom.xml file for compatibility with new features (pom.xml).

@NourAlPha NourAlPha requested a review from a team May 14, 2025 12:42
@NourAlPha NourAlPha self-assigned this May 14, 2025
@NourAlPha NourAlPha merged commit 24d615f into add-actuator May 14, 2025
5 checks passed
NourAlPha added a commit that referenced this pull request May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants