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
28 lines
610 B
TypeScript
28 lines
610 B
TypeScript
import {
|
|
Injectable,
|
|
NestInterceptor,
|
|
ExecutionContext,
|
|
CallHandler,
|
|
} from '@nestjs/common';
|
|
import { Observable } from 'rxjs';
|
|
import { map } from 'rxjs/operators';
|
|
|
|
export interface ApiResponse<T> {
|
|
success: boolean;
|
|
data: T;
|
|
timestamp: string;
|
|
}
|
|
|
|
@Injectable()
|
|
export class TransformInterceptor<T> implements NestInterceptor<T, ApiResponse<T>> {
|
|
intercept(context: ExecutionContext, next: CallHandler): Observable<ApiResponse<T>> {
|
|
return next.handle().pipe(
|
|
map(data => ({
|
|
success: true,
|
|
data,
|
|
timestamp: new Date().toISOString(),
|
|
})),
|
|
);
|
|
}
|
|
}
|