fix(api): resolve NestJS DI + ValidationPipe bugs from type-only imports
- Remove `type` modifier from imports used as DI constructor params across ~235 files (@Injectable, @Controller, @Module, @Catch, @CommandHandler, @QueryHandler, @EventsHandler, @WebSocketGateway). TypeScript emitDecoratorMetadata strips type-only imports, leaving Reflect.metadata with Function placeholder and breaking Nest DI. - Fix controllers: DTOs used with @Body/@Query/@Param must be runtime imports so ValidationPipe can whitelist properties. Previously returned 400 "property X should not exist" on every request. - Register ProjectsModule in AppModule (was defined but never wired). - Add approve()/reject() methods to TransferListingEntity referenced by ModerateTransferListingHandler. - Export BankTransferConfirmedEvent from payments barrel for subscription activation handler. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
isEncrypted,
|
||||
type FieldEncryptionConfig,
|
||||
} from './field-encryption';
|
||||
import { type LoggerService } from './logger.service';
|
||||
import { LoggerService } from './logger.service';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Configuration types
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Prisma } from '@prisma/client';
|
||||
import { type Request, type Response } from 'express';
|
||||
import { DomainException, type ErrorResponseBody } from '../../domain/domain-exception';
|
||||
import { ErrorCode } from '../../domain/error-codes';
|
||||
import { type LoggerService } from '../logger.service';
|
||||
import { LoggerService } from '../logger.service';
|
||||
|
||||
@Catch()
|
||||
export class GlobalExceptionFilter implements ExceptionFilter {
|
||||
|
||||
@@ -5,14 +5,14 @@ import {
|
||||
HttpException,
|
||||
HttpStatus,
|
||||
} from '@nestjs/common';
|
||||
import { type Reflector } from '@nestjs/core';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
import { type Request, type Response } from 'express';
|
||||
import {
|
||||
ENDPOINT_RATE_LIMIT_KEY,
|
||||
type EndpointRateLimitOptions,
|
||||
} from '../decorators/endpoint-rate-limit.decorator';
|
||||
import { type LoggerService } from '../logger.service';
|
||||
import { type RedisService } from '../redis.service';
|
||||
import { LoggerService } from '../logger.service';
|
||||
import { RedisService } from '../redis.service';
|
||||
|
||||
/** Express request extended with optional JWT user payload. */
|
||||
interface AuthenticatedRequest extends Request {
|
||||
|
||||
@@ -5,10 +5,10 @@ import {
|
||||
HttpException,
|
||||
HttpStatus,
|
||||
} from '@nestjs/common';
|
||||
import { type Reflector } from '@nestjs/core';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
import { type UserRole } from '@prisma/client';
|
||||
import { type LoggerService } from '../logger.service';
|
||||
import { type RedisService } from '../redis.service';
|
||||
import { LoggerService } from '../logger.service';
|
||||
import { RedisService } from '../redis.service';
|
||||
|
||||
/**
|
||||
* Role-based rate limits (requests per window).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable, type NestMiddleware } from '@nestjs/common';
|
||||
import { type NextFunction, type Request, type Response } from 'express';
|
||||
import { type LoggerService } from '../logger.service';
|
||||
import { LoggerService } from '../logger.service';
|
||||
|
||||
@Injectable()
|
||||
export class RequestLoggingMiddleware implements NestMiddleware {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { PrismaClient } from '@prisma/client';
|
||||
import pg from 'pg';
|
||||
import { createEncryptionExtension } from './encryption-middleware';
|
||||
import { FieldEncryptionService } from './field-encryption.service';
|
||||
import { type LoggerService } from './logger.service';
|
||||
import { LoggerService } from './logger.service';
|
||||
|
||||
@Injectable()
|
||||
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
|
||||
|
||||
Reference in New Issue
Block a user