import type { PaginationMeta } from '@/types/models'; import type { PaginatedResponse } from '@/types/responses'; export const buildPaginationMeta = ( total: number, limit: number, offset: number ): PaginationMeta => { return { total, limit, offset, hasMore: offset + limit < total, }; }; export const buildPaginatedResponse = ( data: T[], total: number, limit: number, offset: number ): PaginatedResponse => { return { success: true, data, pagination: buildPaginationMeta(total, limit, offset), }; };