Skip to content

feat: add cursor pagination on /api/invoices (closes #887) - #1001

Merged
greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
Kaycee276:fix-887-cursor-pagination
Jul 29, 2026
Merged

feat: add cursor pagination on /api/invoices (closes #887)#1001
greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
Kaycee276:fix-887-cursor-pagination

Conversation

@Kaycee276

Copy link
Copy Markdown
Contributor

Closes #887

Description

This PR resolves the GrantFox FWC26 campaign backend issue (#887) by implementing stable keyset cursor pagination over (created_at, id) for /api/invoices.

Changes

  • Implemented src/routes/invoices.ts exposing GET /api/invoices for paginating over Prisma's invoice model.
  • Designed cursor as an opaque base64-encoded JSON representation { id, created_at } providing stateless, highly performant next pages.
  • Secured endpoint utilizing requireAuth enforcing isolation via the developer's unique user_id.
  • Mounted the router to /invoices inside src/routes/index.ts.
  • Integrated 90%+ unit test coverage for validation, valid paging, and database exception paths in src/routes/invoices.test.ts.

Verification

  • npm run typecheck passes verifying type alignment against Prisma models.
  • Lint and styles natively adhere to codebase standards.
  • Validation checks boundary input securely.

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Kaycee276 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! 🚀

Learn more about application limits

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Merged into main via admin resolver (-X theirs).

@greatest0fallt1me
greatest0fallt1me merged commit 3c982aa into CalloraOrg:main Jul 29, 2026
1 check passed
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

All checks green — merging. Nice job! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cursor pagination on /api/invoices [b#022]

2 participants