lucoenergia / conluz

Conluz is an API-driven application designed for the efficient management of an energy community,enabling the administration of community members and their corresponding supply points and the retrieval of consumption, production data.
Apache License 2.0
0 stars 0 forks source link

Implement endpoint to delete users #42

Closed viktorKhan closed 9 months ago

viktorKhan commented 9 months ago

Authentication and Authorization:

The endpoint should be protected and only accessible to authorized users or administrators. Attempting to delete a user without proper authentication or authorization should result in an error response.

Endpoint URL and Method:

The endpoint URL and HTTP method should be DELETE /api/v2/users/{userId}

User Existence:

If the specified user ID exists, the deletion should be successful. If the user ID does not exist, the endpoint should return an appropriate error response (404 Not Found).

Data Consistency:

Deleting a user should remove their data from the system. Ensure that associated data is appropriately handled.

Response Status Code:

The endpoint should return a status code 200 indicating the success of the deletion.

Response Body:

A successful deletion must not include a response body. An error response should include relevant information about the failure.

Error Handling:

Handle potential errors gracefully, providing meaningful error messages for common issues (e.g., insufficient permissions, server errors).