Description
Create a shared common utility module that provides reusable pagination, filtering, and sorting helpers. Rather than each module implementing its own pagination logic inconsistently, a centralised utility ensures uniform API behaviour, consistent response shapes, and less duplicated code. This will be imported by puzzles, leaderboard, users, and sessions modules.
Acceptance Criteria
Description
Create a shared
commonutility module that provides reusable pagination, filtering, and sorting helpers. Rather than each module implementing its own pagination logic inconsistently, a centralised utility ensures uniform API behaviour, consistent response shapes, and less duplicated code. This will be imported by puzzles, leaderboard, users, and sessions modules.Acceptance Criteria
commonmodule is scaffolded atsrc/common/PaginationDtoclass providespage,limit, and optionalsortBy/orderfieldspaginate()utility wraps TypeORM queries and returns{ data, total, page, limit, totalPages }FilterDtobase class supportssearchand date range fields (from,to)pagedefaults to 1 andlimitdefaults to 20 with a max of 100