Open Laban254 opened 1 month ago
Description: Implement filtering for members in an organization based on their status (all, members, suspended, left workspace).
Acceptance Criteria:
Filtering:
User Preferences:
Error Handling:
Security Measures:
Purpose: To filter members securely and efficiently, ensuring accurate and safe members management.
Requirements:
Expected Outcome:
Endpoints:
Fetch members in Organization:
Description: Provide a list of members based on filter criteria within a specific organization with pagination support.
Endpoint: GET /api/v1/organizations/{organization_id}/members
GET /api/v1/organizations/{organization_id}/members
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/members?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
Response Body:
{ "total": "integer", "page": "integer", "limit": "integer", "prev": "string or null", "next": "string or null", "users": [ { "user_id": "string", "organization_id": "string", "user_email": "string", "organization_name": "string" } ] }
Response (No members Found):
404 Not Found
{ "message": "No members found", "statusCode": 404 }
Response (Invalid Status):
400 Bad Request
{ "message": "Invalid status value", "statusCode": 400 }
Response (Unauthorized):
401 Unauthorized
{ "message": "Unauthorized", "statusCode": 401 }
Response (Internal Server Error):
500 Internal Server Error
{ "message": "Internal server error", "statusCode": 500 }
Tasks:
Testing:
Duplicated from approved Issue: Issue #95
slack ID: @kibe
Description: Implement filtering for members in an organization based on their status (all, members, suspended, left workspace).
Acceptance Criteria:
Filtering:
User Preferences:
Error Handling:
Security Measures:
Purpose: To filter members securely and efficiently, ensuring accurate and safe members management.
Requirements:
Expected Outcome:
Endpoints:
Fetch members in Organization:
Description: Provide a list of members based on filter criteria within a specific organization with pagination support.
Endpoint:
GET /api/v1/organizations/{organization_id}/members
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 (Success):
200 OK
Response Body:
Response (No members Found):
404 Not Found
Response Body:
Response (Invalid Status):
400 Bad Request
Response Body:
Response (Unauthorized):
401 Unauthorized
Response Body:
Response (Internal Server Error):
500 Internal Server Error
Response Body:
Tasks:
GET /api/v1/organizations/{organization_id}/members
to fetch members based on filter criteria.Testing: