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:
Ho Ngoc Hai
2026-04-18 21:50:30 +07:00
parent 4143c4dcb9
commit 312532b1cb
242 changed files with 460 additions and 442 deletions

View File

@@ -1,6 +1,6 @@
import { HttpStatus, Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, ErrorCode, type LoggerService } from '@modules/shared';
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, ErrorCode, LoggerService } from '@modules/shared';
import { ORDER_REPOSITORY, type IOrderRepository } from '../../../domain/repositories/order.repository';
import { CancelOrderCommand } from './cancel-order.command';

View File

@@ -1,17 +1,17 @@
import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { type PaymentStatus } from '@prisma/client';
import {
DomainException,
NotFoundException,
ValidationException,
type LoggerService,
LoggerService,
} from '@modules/shared';
import {
PAYMENT_REPOSITORY,
type IPaymentRepository,
} from '../../../domain/repositories/payment.repository';
import { type BankTransferService } from '../../../infrastructure/services/bank-transfer.service';
import { BankTransferService } from '../../../infrastructure/services/bank-transfer.service';
import { ConfirmBankTransferCommand } from './confirm-bank-transfer.command';
export interface ConfirmBankTransferResult {

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { createId } from '@paralleldrive/cuid2';
import { ConflictException, DomainException, ValidationException, type LoggerService } from '@modules/shared';
import { ConflictException, DomainException, ValidationException, LoggerService } from '@modules/shared';
import { EscrowEntity } from '../../../domain/entities/escrow.entity';
import { OrderEntity } from '../../../domain/entities/order.entity';
import { ESCROW_REPOSITORY, type IEscrowRepository } from '../../../domain/repositories/escrow.repository';

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { createId } from '@paralleldrive/cuid2';
import { ConflictException, DomainException, ValidationException, type LoggerService } from '@modules/shared';
import { ConflictException, DomainException, ValidationException, LoggerService } from '@modules/shared';
import { PaymentEntity } from '../../../domain/entities/payment.entity';
import {
PAYMENT_REPOSITORY,

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { type PaymentStatus } from '@prisma/client';
import { DomainException, NotFoundException, ValidationException, type LoggerService } from '@modules/shared';
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared';
import {
PAYMENT_REPOSITORY,
type IPaymentRepository,

View File

@@ -1,6 +1,6 @@
import { HttpStatus, Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, ErrorCode, type LoggerService } from '@modules/shared';
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, ErrorCode, LoggerService } from '@modules/shared';
import { ESCROW_REPOSITORY, type IEscrowRepository } from '../../../domain/repositories/escrow.repository';
import { ORDER_REPOSITORY, type IOrderRepository } from '../../../domain/repositories/order.repository';
import { HoldEscrowCommand } from './hold-escrow.command';

View File

@@ -1,6 +1,6 @@
import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, NotFoundException, ValidationException, type LoggerService } from '@modules/shared';
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared';
import {
PAYMENT_REPOSITORY,
type IPaymentRepository,

View File

@@ -1,6 +1,6 @@
import { HttpStatus, Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, ErrorCode, type LoggerService } from '@modules/shared';
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, ErrorCode, LoggerService } from '@modules/shared';
import { ESCROW_REPOSITORY, type IEscrowRepository } from '../../../domain/repositories/escrow.repository';
import { ORDER_REPOSITORY, type IOrderRepository } from '../../../domain/repositories/order.repository';
import { ReleaseEscrowCommand } from './release-escrow.command';

View File

@@ -1,6 +1,6 @@
import { Inject, InternalServerErrorException } from '@nestjs/common';
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { DomainException, ForbiddenException, type LoggerService, NotFoundException } from '@modules/shared';
import { DomainException, ForbiddenException, LoggerService, NotFoundException } from '@modules/shared';
import {
PAYMENT_REPOSITORY,
type IPaymentRepository,

View File

@@ -1,6 +1,6 @@
import { Inject, InternalServerErrorException } from '@nestjs/common';
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { DomainException, type LoggerService } from '@modules/shared';
import { DomainException, LoggerService } from '@modules/shared';
import {
PAYMENT_REPOSITORY,
type IPaymentRepository,