Skip to content

Implement "Delete User Account" in UserController #36

Open
@AhmedFatthy1040

Description

@AhmedFatthy1040

Issue Title: Implement "Delete User Account" in UserController

Issue Description:

As an admin, I want to be able to permanently delete a user account from the platform so that I can manage users effectively and remove any accounts that violate our policies.

Tasks:

  1. Create an endpoint in the UserController that allows the admin to delete a user account by their user ID.
  2. Ensure that when a user account is deleted, all associated data (e.g., user profile, jobs posted, reviews) is also removed from the database.
  3. Implement security measures to ensure only admin users can access this endpoint.

Acceptance Criteria:

  • Admin should be able to make a DELETE request to /api/users/{userId} to delete a user account.
  • Return 204 No Content if the deletion is successful.
  • Return 404 Not Found if the user does not exist.
  • Ensure proper error handling and validation.
  • Apply proper authorization so that only users with the "admin" role can access this endpoint.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions