Skip to content

Add helper for building paginated list response envelope with metadata fields #508

Description

@Chucks1093

Summary

All paginated list endpoints return a response envelope containing the data array alongside metadata like total, hasMore, and nextCursor. This envelope shape is currently assembled inline in each handler. A shared builder helper should be used everywhere to keep the shape consistent.

Scope

  • Add buildListResponse<T>(data: T[], meta: { total: number, hasMore: boolean, nextCursor?: string }) helper
  • Returns { data, meta: { total, hasMore, nextCursor } }
  • nextCursor omitted from output when undefined
  • Add unit tests confirming shape for: with cursor, without cursor, empty data array

Acceptance Criteria

  • Returns correct envelope shape with all meta fields
  • nextCursor absent when not provided
  • Empty data array returns correct shape with total: 0 and hasMore: false

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions