You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an API endpoint to retrieve the registered user's organizations for the admin user. This endpoint will be part of the administration user management. Admin users can see organizations the user belongs to using this endpoint
Acceptance Criteria
The endpoint should be accessible at GET /api/v1/admin/users/{id}/organizations.
The endpoint should accept HTTP GET requests.
The endpoint should retrieve a registered user's organizations from the database using the provided user's ID.
The endpoint should return a 200 OK status code with the user's organization they belong in the response body
The endpoint returns should improve performance by using pagination
This endpoint should be secured and only accessible to an admin user
GET /api/v1/admin/users/3454/organizations Response:
On a successful retrieval of the user organizations, the API should return a 200 OK status code. The response body should contain the organizations:
If the user's ID is missing or invalid, the API should return a 400 Bad Request status code with appropriate validation error messages:
{
"status": "unsuccessful",
"status_code": 400,
"message": "Valid user ID must be provided"
}
If the user does not exist, the API should return a 404 Not Found status code with an appropriate message:
{
"status": "unsuccessful",
"status_code": 404,
"message": "User not found"
}
Purpose
To provide admin users with information about a registered user's organizations
Requirements
Develop server-side logic to retrieve user's organizations by user ID.
Securely handle the retrieval process and comply with security standards.
Ensure the user's ID is validated and handled correctly.
Expected Outcome
API endpoint allows admin users to retrieve user organizations by user ID with appropriate validation and security measures.
Tasks:
Define the GET /api/v1/admin/users/{id}/organizations route in the server-side application.
Validate that the user's ID is provided and is in a valid format.
Implement logic to retrieve the user organizations from the database using the provided user ID.
Return the user's organizations in the response body if the user ID is valid and the user exists.
Handle cases where the user's ID is invalid or the user does not exist, providing appropriate error messages.
Testing
Write unit tests to validate input validation and the user's organization retrieval logic.
Write integration tests to ensure end-to-end functionality.
Perform security testing to ensure data protection and compliance.
The text was updated successfully, but these errors were encountered:
dmendie
changed the title
[FEAT]; Admin - User Organizations: Implement API Endpoint for user's organization listing for admin
[FEAT]: Admin - User Organizations: Implement API Endpoint for user's organization listing for admin
Jul 27, 2024
Description
Create an API endpoint to retrieve the registered user's organizations for the admin user. This endpoint will be part of the administration user management. Admin users can see organizations the user belongs to using this endpoint
Acceptance Criteria
GET /api/v1/admin/users/3454/organizations
Response:
On a successful retrieval of the user organizations, the API should return a 200 OK status code. The response body should contain the organizations:
Validation:
If the user's ID is missing or invalid, the API should return a 400 Bad Request status code with appropriate validation error messages:
If the user does not exist, the API should return a 404 Not Found status code with an appropriate message:
Purpose
To provide admin users with information about a registered user's organizations
Requirements
Expected Outcome
API endpoint allows admin users to retrieve user organizations by user ID with appropriate validation and security measures.
Tasks:
Testing
The text was updated successfully, but these errors were encountered: