Open
Description
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:
- Create an endpoint in the UserController that allows the admin to delete a user account by their user ID.
- Ensure that when a user account is deleted, all associated data (e.g., user profile, jobs posted, reviews) is also removed from the database.
- 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.