Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Development) : Implement an API Endpoint to Update User Profile #1

Open
rohit-zip opened this issue May 22, 2024 · 0 comments
Open
Labels
🧑‍💻 Development Development Related Tasks enhancement New feature or request

Comments

@rohit-zip
Copy link
Member

Overview

Implement a PUT endpoint to update user profiles using the CQRS pattern. Data should be persisted in both PostgreSQL and Elasticsearch. Follow the existing project structure without adding new variables to the Profile Entity and Document. Utilize the logged-in user's details from @AuthenticationPrincipal.

###Endpoint Details

Request Body

{
  "name": "string",
  "bio": "string",
  "link": "string",
  "profileTag": "string"
}

Response Body

{
  "message": "string",
  "userId": "string"
}

Validations

  1. Use the same validations as the Profile Create endpoint in the Profile Controller.
    
  2. Ensure the logged-in user can only update their own profile.
    
  3. For validation exceptions, throw a Bad Request exception with the appropriate exception code.
    
  4. Add error messages in error-messages.properties located in the resources directory.
    

Development Requirements

  • Profile Controller: Implement the PUT endpoint to handle profile updates.
    
  • Profile Service: Define the service methods needed for profile updates.
    
  • Profile Implementation: Implement the logic for updating profiles, ensuring persistence in both PostgreSQL and Elasticsearch.
    
  • Profile Dao: Handle the database operations for updating the profile.
    

Authentication

Retrieve the logged-in user's details from @AuthenticationPrincipal AuthenticatedUser authenticatedUser. This will provide the userId, email, username, authorities, etc.

Contact Information

For any questions or clarifications, please reach out:

Email: [email protected]
Discord Link: https://discord.gg/sEerF8HuKC
LinkedIn: https://linkedin.com/in/rohit-zip
Phone: +91-9571406506

Additional Notes

Ensure the changes are consistent with the existing project structure and adhere to the CQRS pattern. No new variables should be added to the Profile Entity and Document.

@rohit-zip rohit-zip added enhancement New feature or request 🧑‍💻 Development Development Related Tasks labels May 22, 2024
@rohit-zip rohit-zip moved this to Backlog in Bloggios - Open Source May 22, 2024
@rohit-zip rohit-zip changed the title Implement an API Endpoint to Update User Profile with (Development) : Implement an API Endpoint to Update User Profile with May 22, 2024
@rohit-zip rohit-zip changed the title (Development) : Implement an API Endpoint to Update User Profile with (Development) : Implement an API Endpoint to Update User Profile May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧑‍💻 Development Development Related Tasks enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

1 participant