Closed droffilc1 closed 1 month ago
Description: Implement filtering for users in an organization based on their status (members, suspended, left workspace).
Acceptance Criteria:
Filtering:
User Preferences:
Error Handling:
Security Measures:
Purpose: To filter users securely and efficiently, ensuring accurate and safe user management.
Requirements:
Expected Outcome:
Endpoints:
Fetch Users in Organization:
Description: Provide a list of users based on filter criteria within a specific organization with pagination support.
Endpoint: GET /api/v1/organizations/{organization_id}/users
GET /api/v1/organizations/{organization_id}/users
Request Headers:
Authorization: Bearer <token>
Content-Type: application/json
Accept: application/json
Request Parameters:
status
string
members
suspended
left
page
integer
default: 1
limit:
default: 10
Request Example:
GET /api/v1/organizations/123/users?status=members&page=1&limit=10 HTTP/1.1 Host: example.com Authorization: Bearer <token> Content-Type: application/json Accept: application/json
Response Example:
Response (Success):
200 OK
{ "total": "integer", "page": "integer", "limit": "integer", "prev": "string or null", "next": "string or null", "users": [ { "id": "String", "email": "String", "name": "String", "role": "String", "signup_type": "String", "is_active": true, "is_verified": true, "created_at": "Date", "updated_at": "Date", "last_login_at": "Date", "status": "String" } ] }
Response (No Users Found):
Status Code: 404 Not Found
404 Not Found
Response Body:
{ "message": "No users found", "statusCode": 404 }
Response (Invalid Status):
Status Code: 400 Bad Request
400 Bad Request
{ "message": "Invalid status value", "statusCode": 400 }
Response (Unauthorized):
Status Code: 401 Unauthorized
401 Unauthorized
{ "message": "Unauthorized", "statusCode": 401 }
Response (Internal Server Error):
Status Code: 500 Internal Server Error
500 Internal Server Error
{ "message": "Internal server error", "statusCode": 500 }
Tasks:
Testing:
This Issue is linked to the approved issue here
Description:
Implement filtering for users in an organization based on their status (members, suspended, left workspace).
Acceptance Criteria:
Filtering:
User Preferences:
Error Handling:
Security Measures:
Purpose:
To filter users securely and efficiently, ensuring accurate and safe user management.
Requirements:
Expected Outcome:
Endpoints:
Fetch Users in Organization:
Description: Provide a list of users based on filter criteria within a specific organization with pagination support.
Endpoint:
GET /api/v1/organizations/{organization_id}/users
Request Headers:
Authorization: Bearer <token>
(required)Content-Type: application/json
Accept: application/json
Request Parameters:
status
:string
(values:members
,suspended
,left
)page
:integer
(optional,default: 1
)limit:
integer
(optional,default: 10
)Request Example:
Response Example:
Response (Success):
200 OK
Response (No Users Found):
Status Code:
404 Not Found
Response Body:
Response (Invalid Status):
Status Code:
400 Bad Request
Response Body:
Response (Unauthorized):
Status Code:
401 Unauthorized
Response Body:
Response (Internal Server Error):
Status Code:
500 Internal Server Error
Response Body:
Tasks:
GET /api/v1/organizations/{organization_id}/users
to fetch users based on filter criteria.Testing: