-
Notifications
You must be signed in to change notification settings - Fork 219
Open
Labels
Description
Description
Add a new Feature Request API to allow users to submit feature requests for the application. This endpoint will collect feature request details, including title, description, priority, and user information.
Proposed Changes
Endpoint Details
- Method: POST
- URL:
/api/v1/feature-request
Request Body
{
"title": "string",
"description": "string",
"requested_by": "[email protected]",
"priority": "Low | Medium | High"
}
Response
Success (201 Created):
{
"status": "success",
"status_code": 201,
"message": "Feature request submitted successfully",
"data": {
"title": "New Feature Title",
"description": "Feature description",
"requested_by": "[email protected]",
"priority": "Medium",
"status": "Pending",
"created_at": "2025-03-01T10:00:00"
}
}
Error Responses
- 400 BAD REQUEST
{
"status": "failure",
"status_code": 400,
"message": "Invalid request data"
}
- 500 INTERNAL SERVER ERROR
{
"status": "error",
"status_code": 500,
"message": "An unexpected error occurred"
}
Authentication and Authorization
- The endpoint requires authentication.
- All authenticated users can submit feature requests.
Acceptance Criteria
Endpoint Implementation:
- The POST
/api/v1/feature-request
endpoint is implemented and functional. - Request body validation ensures that required fields are provided.
- The endpoint saves feature request data to the database.
Authentication and Authorization:
- Only authenticated users can submit feature requests.
Error Handling:
- Handles missing or invalid request data.
- Returns appropriate status codes and error messages.
Testing:
- Unit tests cover:
- Successful submissions
- Invalid request data
- Internal server errors
Documentation:
- The endpoint is documented in the API documentation (e.g., Swagger/OpenAPI).
- Example requests and responses are provided.