Skip to content

[BE-90] Standardize pagination across all list endpoints #1478

Description

@yusuftomilola

Overview

List endpoints across modules use differing (or no) pagination conventions. Unbounded lists will eventually time out, and the frontend has to special-case each endpoint.

Tasks

  • Define a shared PaginationQueryDto (page, limit with a hard max, sortBy, sortOrder) in common/.
  • Define a shared PaginatedResponse<T>{ data, meta: { page, limit, total, totalPages, hasNext, hasPrev } }.
  • Apply to every list endpoint; enforce a maximum page size (e.g. 100) server-side.
  • Add @ApiOkResponse generic schemas so Swagger renders the wrapper correctly.
  • Update frontend/lib/apiClient.ts and callers to the shared shape.

Acceptance Criteria

  • Every list endpoint accepts ?page=&limit= and returns the standard envelope.
  • Requesting limit=100000 is clamped, not honoured.
  • Swagger shows the paginated wrapper for list routes.

Notes for Contributors

Comment below to be assigned.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions