Feature/cursor pagination demo#598
Open
OsejiFabian wants to merge 3 commits intoStreamFi-x:devfrom
Open
Conversation
added 3 commits
April 24, 2026 12:46
- Implement GET /api/routes-f/units endpoint for unit conversions - Support length, mass, volume, and temperature conversions - Add comprehensive type definitions and helper utilities - Include full test coverage for all conversion categories - Reject cross-category conversions with proper error handling - Round results to 6 decimal places as specified All files are scoped to app/api/routes-f/units/ as required.
- Implement POST /api/routes-f/dice endpoint - Support standard dice notation: XdY, XdY+Z, XdY-Z, XdYkN, XdYdlN - Add seeded random number generation for deterministic results - Enforce limits: max 100 dice, max 1000 sides - Include comprehensive unit tests covering all notation variants - All files scoped to app/api/routes-f/dice/ as required Acceptance Criteria: - All notation variants parsed correctly - Limits enforced (100 dice max, 1000 sides max) - Seeded rolls are deterministic - Tests cover every notation type - All files inside app/api/routes-f/dice/
- Implement opaque cursor-based pagination with base64 encoding - Generate 500 fake records with composite key ordering (created_at + id) - Support cursor and limit query parameters with validation - Default limit 20, max 100 - Include comprehensive unit tests covering edge cases - All files scoped to app/api/routes-f/paginate-demo/ as required Acceptance Criteria: - Cursor is opaque (base64) and round-trips cleanly - No duplicates or skips across pages - Invalid cursors return 400 - Tests cover full traversal of dataset - All files inside app/api/routes-f/paginate-demo/
|
Someone is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@OsejiFabian Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed
What were you told to do?
Add a cursor-pagination demo at app/api/routes-f/paginate-demo/route.ts. Use a bundled dataset of ~500 fake records to demonstrate opaque cursor pagination.
What did you do?
Files Created
app/api/routes-f/paginate-demo/route.ts- Main API endpoint implementing GET handler with cursor paginationapp/api/routes-f/paginate-demo/_lib/types.ts- TypeScript interfaces for requests, responses, and data structuresapp/api/routes-f/paginate-demo/_lib/helpers.ts- Helper functions for data generation, cursor encoding/decoding, and pagination logicapp/api/routes-f/paginate-demo/__tests__/route.test.ts- Comprehensive unit tests covering all functionalityapp/api/routes-f/paginate-demo/test-manual.js- Manual testing script for validationImplementation Details
GET /api/routes-f/paginate-demo?cursor=...&limit=20returns{ data: [...], next_cursor: string|null, has_more: boolean }Key Features
✅ Cursor is opaque (base64) and round-trips cleanly
✅ No duplicates or skips across pages
✅ Invalid cursors return 400
✅ Tests cover full traversal of dataset
✅ All files scoped to app/api/routes-f/paginate-demo/ as required
[x] - Correct; marked as done
[X] - Correct; marked as done
[ ] - Correct; marked as not done
[] - Not Correct; syntax error
[ x] - Not Correct; space between the brackets
-->
Closes #568