Skip to content

Pagination utility service #384

@nafiuishaaq

Description

@nafiuishaaq

Description
Create a reusable pagination utility service that standardizes paginated responses across all list endpoints. Implement PaginatedResponse interface with data, meta: { page, limit, total, totalPages, hasNext, hasPrev }. Create service method paginate(queryBuilder, page, limit, options) that automatically applies skip, take, and returns properly formatted response. Support cursor-based pagination for large datasets (alternative to offset/limit). Include helper for generating pagination links (first, prev, next, last).

Acceptance Criteria
Standardized pagination response format across all list endpoints

Utility method accepts TypeORM QueryBuilder or repository

Offset/limit pagination implemented with proper counting

Cursor-based pagination optional for high-performance scenarios

Max limit enforced (configurable, default 100)

Unit tests for edge cases: page beyond total, negative page, invalid limit

Swagger documentation includes pagination parameters

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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