-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Enhance the GET /books endpoint to support pagination and basic filtering.
User Story
Given many books exist
When I request books with query params
Then I should receive paginated and filtered results
Query Params
page(default: 1)limit(default: 10)author(optional)minPrice(optional)maxPrice(optional)
Tasks
-
Update
GET /booksendpoint -
Parse query params:
-
page -
limit -
author -
minPrice -
maxPrice
-
-
Implement pagination logic (OFFSET / LIMIT)
-
Implement filtering:
- Filter by author
- Filter by price range
-
Return metadata:
-
total -
page -
limit
-
-
Add Swagger documentation
- Query params
- Example requests
Acceptance Criteria
- Pagination works correctly
- Filtering works independently and combined
- Default values applied if params missing
- Response includes metadata
- Swagger UI supports testing
Testing Steps
-
Add multiple book records
-
Test:
/books?page=1&limit=5 -
Test filtering:
/books?author=John /books?minPrice=50&maxPrice=200 -
Verify results match DB queries
Definition of Done
- Pagination implemented
- Filtering implemented
- Swagger updated
- Code linted and formatted
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Backlog