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

Implement User CRUD Operations #25

Open
poksyy opened this issue Mar 3, 2025 · 0 comments
Open

Implement User CRUD Operations #25

poksyy opened this issue Mar 3, 2025 · 0 comments
Labels
⬅️BACKEND ➕features New feature or request. 🧠 logic Handles business rules, data processing, and internal logic.

Comments

@poksyy
Copy link
Owner

poksyy commented Mar 3, 2025

  1. Create UserController:

    • Define a UserController class with the following endpoints:
      • POST /api/users → Create a new user.
      • GET /api/users/{id} → Get user details by ID.
      • PUT /api/users/{id} → Update user information.
      • DELETE /api/users/{id} → Delete a user.
      • GET /api/users → List all users (admin only).
  2. UserService:

    • Implement business logic in the UserService class.
    • Handle user creation, fetching, updating, and deletion logic.
      • Use UserRepository to interact with the database.
      • Make sure to handle scenarios like when a user doesn’t exist (404) or when data is invalid (400).
  3. UserRepository:

    • Include queries for fetching users by ID, updating user info, deleting users, and listing all users.
      • Use findById, save, deleteById, and custom queries where necessary.
  4. Test CRUD Operations in Postman:

    • Test the CRUD endpoints by sending requests to the server and checking the responses.
    • For each endpoint, check for correct status codes (e.g., 201 for creation, 200 for successful update, 404 for non-existing user).
    • Verify that user data is stored in the database after successful creation and update.
@poksyy poksyy added ➕features New feature or request. ⬅️BACKEND 🧠 logic Handles business rules, data processing, and internal logic. labels Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬅️BACKEND ➕features New feature or request. 🧠 logic Handles business rules, data processing, and internal logic.
Projects
None yet
Development

No branches or pull requests

1 participant