feat: Goa GEL Blockchain e-Licensing Platform - Full Stack Implementation
Complete implementation of the Goa Government e-Licensing platform with: Backend: - NestJS API with JWT authentication - PostgreSQL database with Knex ORM - Redis caching and session management - MinIO document storage - Hyperledger Besu blockchain integration - Multi-department workflow system - Comprehensive API tests (266/282 passing) Frontend: - Angular 21 with standalone components - Angular Material + TailwindCSS UI - Visual workflow builder - Document upload with progress tracking - Blockchain explorer integration - Role-based dashboards (Admin, Department, Citizen) - E2E tests with Playwright (37 tests) Infrastructure: - Docker Compose orchestration - Blockscout blockchain explorer - Development and production configurations
This commit is contained in:
25
backend/src/common/utils/pagination.util.ts
Normal file
25
backend/src/common/utils/pagination.util.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { QueryBuilder } from 'objection';
|
||||
|
||||
export interface PaginatedResult<T> {
|
||||
results: T[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface PaginationOptions {
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export async function paginate<T>(
|
||||
query: QueryBuilder<any, T[]>,
|
||||
page: number,
|
||||
limit: number,
|
||||
): Promise<PaginatedResult<T>> {
|
||||
const p = page > 0 ? page - 1 : 0;
|
||||
const l = limit > 0 ? limit : 10;
|
||||
|
||||
const { results, total } = await query.page(p, l);
|
||||
return { results, total };
|
||||
}
|
||||
|
||||
export { QueryBuilder };
|
||||
Reference in New Issue
Block a user