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:
@@ -8,7 +8,7 @@ import {
|
||||
type IIndustrialListingRepository,
|
||||
} from '../../../domain/repositories/industrial-listing.repository';
|
||||
import { type IIndustrialParkRepository, INDUSTRIAL_PARK_REPOSITORY } from '../../../domain/repositories/industrial-park.repository';
|
||||
import { type TypesenseIndustrialService } from '../../../infrastructure/services/typesense-industrial.service';
|
||||
import { TypesenseIndustrialService } from '../../../infrastructure/services/typesense-industrial.service';
|
||||
import { CreateIndustrialListingCommand } from './create-industrial-listing.command';
|
||||
|
||||
@CommandHandler(CreateIndustrialListingCommand)
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
INDUSTRIAL_LISTING_REPOSITORY,
|
||||
type IIndustrialListingRepository,
|
||||
} from '../../../domain/repositories/industrial-listing.repository';
|
||||
import { type TypesenseIndustrialService } from '../../../infrastructure/services/typesense-industrial.service';
|
||||
import { TypesenseIndustrialService } from '../../../infrastructure/services/typesense-industrial.service';
|
||||
import { DeleteIndustrialListingCommand } from './delete-industrial-listing.command';
|
||||
|
||||
@CommandHandler(DeleteIndustrialListingCommand)
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
INDUSTRIAL_LISTING_REPOSITORY,
|
||||
type IIndustrialListingRepository,
|
||||
} from '../../../domain/repositories/industrial-listing.repository';
|
||||
import { type TypesenseIndustrialService } from '../../../infrastructure/services/typesense-industrial.service';
|
||||
import { TypesenseIndustrialService } from '../../../infrastructure/services/typesense-industrial.service';
|
||||
import { UpdateIndustrialListingCommand } from './update-industrial-listing.command';
|
||||
|
||||
@CommandHandler(UpdateIndustrialListingCommand)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import type { IndustrialLeaseType, IndustrialListingStatus, IndustrialPropertyType, Prisma } from '@prisma/client';
|
||||
import { type PrismaService } from '@modules/shared';
|
||||
import { PrismaService } from '@modules/shared';
|
||||
import { IndustrialListingEntity } from '../../domain/entities/industrial-listing.entity';
|
||||
import type {
|
||||
IIndustrialListingRepository,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import type { Prisma } from '@prisma/client';
|
||||
import { type PrismaService } from '@modules/shared';
|
||||
import { PrismaService } from '@modules/shared';
|
||||
import { IndustrialParkEntity } from '../../domain/entities/industrial-park.entity';
|
||||
import type {
|
||||
IIndustrialParkRepository,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable, type OnModuleInit } from '@nestjs/common';
|
||||
import { type Client as TypesenseClient } from 'typesense';
|
||||
import { type CollectionCreateSchema } from 'typesense/lib/Typesense/Collections';
|
||||
import { type TypesenseClientService } from '@modules/search';
|
||||
import { type LoggerService, type PrismaService } from '@modules/shared';
|
||||
import { TypesenseClientService } from '@modules/search';
|
||||
import { LoggerService, PrismaService } from '@modules/shared';
|
||||
|
||||
export const INDUSTRIAL_PARKS_COLLECTION = 'industrial_parks';
|
||||
export const INDUSTRIAL_LISTINGS_COLLECTION = 'industrial_listings';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Body, Controller, Delete, Get, Param, Patch, Post, Query, UseGuards } from '@nestjs/common';
|
||||
import { type CommandBus, type QueryBus } from '@nestjs/cqrs';
|
||||
import { CommandBus, QueryBus } from '@nestjs/cqrs';
|
||||
import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { CurrentUser, JwtAuthGuard, type JwtPayload } from '@modules/auth';
|
||||
import { NotFoundException } from '@modules/shared';
|
||||
@@ -8,9 +8,9 @@ import { DeleteIndustrialListingCommand } from '../../application/commands/delet
|
||||
import { UpdateIndustrialListingCommand } from '../../application/commands/update-industrial-listing/update-industrial-listing.command';
|
||||
import { GetIndustrialListingQuery } from '../../application/queries/get-industrial-listing/get-industrial-listing.query';
|
||||
import { ListIndustrialListingsQuery } from '../../application/queries/list-industrial-listings/list-industrial-listings.query';
|
||||
import { type CreateIndustrialListingDto } from '../dto/create-industrial-listing.dto';
|
||||
import { type SearchIndustrialListingsDto } from '../dto/search-industrial-listings.dto';
|
||||
import { type UpdateIndustrialListingDto } from '../dto/update-industrial-listing.dto';
|
||||
import { CreateIndustrialListingDto } from '../dto/create-industrial-listing.dto';
|
||||
import { SearchIndustrialListingsDto } from '../dto/search-industrial-listings.dto';
|
||||
import { UpdateIndustrialListingDto } from '../dto/update-industrial-listing.dto';
|
||||
|
||||
@ApiTags('industrial-listings')
|
||||
@Controller('industrial')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Body, Controller, Get, Param, Patch, Post, Query, UseGuards } from '@nestjs/common';
|
||||
import { type CommandBus, type QueryBus } from '@nestjs/cqrs';
|
||||
import { CommandBus, QueryBus } from '@nestjs/cqrs';
|
||||
import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { UserRole } from '@prisma/client';
|
||||
import { JwtAuthGuard, Roles, RolesGuard } from '@modules/auth';
|
||||
@@ -13,12 +13,12 @@ import { GetIndustrialParkQuery } from '../../application/queries/get-industrial
|
||||
import { IndustrialMarketQuery } from '../../application/queries/industrial-market/industrial-market.query';
|
||||
import { IndustrialParkStatsQuery } from '../../application/queries/industrial-park-stats/industrial-park-stats.query';
|
||||
import { ListIndustrialParksQuery } from '../../application/queries/list-industrial-parks/list-industrial-parks.query';
|
||||
import { type AnalyzeIndustrialLocationDto } from '../dto/analyze-industrial-location.dto';
|
||||
import { type CompareIndustrialParksDto } from '../dto/compare-industrial-parks.dto';
|
||||
import { type CreateIndustrialParkDto } from '../dto/create-industrial-park.dto';
|
||||
import { type EstimateIndustrialRentDto } from '../dto/estimate-industrial-rent.dto';
|
||||
import { type SearchIndustrialParksDto } from '../dto/search-industrial-parks.dto';
|
||||
import { type UpdateIndustrialParkDto } from '../dto/update-industrial-park.dto';
|
||||
import { AnalyzeIndustrialLocationDto } from '../dto/analyze-industrial-location.dto';
|
||||
import { CompareIndustrialParksDto } from '../dto/compare-industrial-parks.dto';
|
||||
import { CreateIndustrialParkDto } from '../dto/create-industrial-park.dto';
|
||||
import { EstimateIndustrialRentDto } from '../dto/estimate-industrial-rent.dto';
|
||||
import { SearchIndustrialParksDto } from '../dto/search-industrial-parks.dto';
|
||||
import { UpdateIndustrialParkDto } from '../dto/update-industrial-park.dto';
|
||||
|
||||
@ApiTags('industrial-parks')
|
||||
@Controller('industrial')
|
||||
|
||||
Reference in New Issue
Block a user