Context
src/index.ts only has /requests/:id and /accounts/:address/received. There is no list endpoint, so the dashboard cannot show a user's requests.
Acceptance criteria
GET /api/v1/requests supports query params: payee, payer (optional), status, asset, limit (default 20, max 100), cursor.
- Returns
{ data: PaymentRequest[], meta: { total, limit, cursor } }.
cursor is the id of the last item; subsequent calls pass it to continue.
Technical notes
- Build a Prisma
where from present filters; order by id desc.
- Use
skip/take for pagination keyed on cursor.
- See
src/types.ts for the PaymentRequest shape.
Testing
- Add a vitest route test covering filter + pagination.
Context
src/index.tsonly has/requests/:idand/accounts/:address/received. There is no list endpoint, so the dashboard cannot show a user's requests.Acceptance criteria
GET /api/v1/requestssupports query params:payee,payer(optional),status,asset,limit(default 20, max 100),cursor.{ data: PaymentRequest[], meta: { total, limit, cursor } }.cursoris theidof the last item; subsequent calls pass it to continue.Technical notes
wherefrom present filters; order byiddesc.skip/takefor pagination keyed oncursor.src/types.tsfor thePaymentRequestshape.Testing