Compare commits
3 Commits
a6d1ef307c
...
b4ef4fc81c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4ef4fc81c | ||
|
|
312532b1cb | ||
|
|
4143c4dcb9 |
@@ -19,6 +19,7 @@ import { MessagingModule } from '@modules/messaging';
|
|||||||
import { HttpMetricsInterceptor, MetricsModule } from '@modules/metrics';
|
import { HttpMetricsInterceptor, MetricsModule } from '@modules/metrics';
|
||||||
import { NotificationsModule } from '@modules/notifications';
|
import { NotificationsModule } from '@modules/notifications';
|
||||||
import { PaymentsModule } from '@modules/payments';
|
import { PaymentsModule } from '@modules/payments';
|
||||||
|
import { ProjectsModule } from '@modules/projects';
|
||||||
import { ReportsModule } from '@modules/reports';
|
import { ReportsModule } from '@modules/reports';
|
||||||
import { ReviewsModule } from '@modules/reviews';
|
import { ReviewsModule } from '@modules/reviews';
|
||||||
import { SearchModule } from '@modules/search';
|
import { SearchModule } from '@modules/search';
|
||||||
@@ -60,6 +61,7 @@ import { AppController } from './app.controller';
|
|||||||
McpIntegrationModule,
|
McpIntegrationModule,
|
||||||
MessagingModule,
|
MessagingModule,
|
||||||
ReportsModule,
|
ReportsModule,
|
||||||
|
ProjectsModule,
|
||||||
IndustrialModule,
|
IndustrialModule,
|
||||||
TransferModule,
|
TransferModule,
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
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 PlanTier } from '@prisma/client';
|
import { type PlanTier } from '@prisma/client';
|
||||||
import { DomainException, NotFoundException, ValidationException, type PrismaService, type LoggerService } from '@modules/shared';
|
import { DomainException, NotFoundException, ValidationException, PrismaService, LoggerService } from '@modules/shared';
|
||||||
import { SUBSCRIPTION_REPOSITORY, type ISubscriptionRepository } from '@modules/subscriptions';
|
import { SUBSCRIPTION_REPOSITORY, type ISubscriptionRepository } from '@modules/subscriptions';
|
||||||
import { SubscriptionAdjustedEvent } from '../../../domain/events/subscription-adjusted.event';
|
import { SubscriptionAdjustedEvent } from '../../../domain/events/subscription-adjusted.event';
|
||||||
import { AdjustSubscriptionCommand } from './adjust-subscription.command';
|
import { AdjustSubscriptionCommand } from './adjust-subscription.command';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
|
import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
|
||||||
import { DomainException, NotFoundException, ValidationException, type LoggerService } from '@modules/shared';
|
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared';
|
||||||
import { KycApprovedEvent } from '../../../domain/events/kyc-approved.event';
|
import { KycApprovedEvent } from '../../../domain/events/kyc-approved.event';
|
||||||
import { ApproveKycCommand } from './approve-kyc.command';
|
import { ApproveKycCommand } from './approve-kyc.command';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { LISTING_REPOSITORY, type IListingRepository } from '@modules/listings';
|
import { LISTING_REPOSITORY, type IListingRepository } from '@modules/listings';
|
||||||
import { DomainException, NotFoundException, ValidationException, type LoggerService } from '@modules/shared';
|
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared';
|
||||||
import { ListingApprovedEvent } from '../../../domain/events/listing-approved.event';
|
import { ListingApprovedEvent } from '../../../domain/events/listing-approved.event';
|
||||||
import { ApproveListingCommand } from './approve-listing.command';
|
import { ApproveListingCommand } from './approve-listing.command';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
|
import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
|
||||||
import { DomainException, NotFoundException, ValidationException, type LoggerService } from '@modules/shared';
|
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared';
|
||||||
import { UserBannedEvent } from '../../../domain/events/user-banned.event';
|
import { UserBannedEvent } from '../../../domain/events/user-banned.event';
|
||||||
import { UserUnbannedEvent } from '../../../domain/events/user-unbanned.event';
|
import { UserUnbannedEvent } from '../../../domain/events/user-unbanned.event';
|
||||||
import { BanUserCommand } from './ban-user.command';
|
import { BanUserCommand } from './ban-user.command';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { LISTING_REPOSITORY, type IListingRepository } from '@modules/listings';
|
import { LISTING_REPOSITORY, type IListingRepository } from '@modules/listings';
|
||||||
import { DomainException, ValidationException, type LoggerService } from '@modules/shared';
|
import { DomainException, ValidationException, LoggerService } from '@modules/shared';
|
||||||
import { ListingApprovedEvent } from '../../../domain/events/listing-approved.event';
|
import { ListingApprovedEvent } from '../../../domain/events/listing-approved.event';
|
||||||
import { ListingRejectedEvent } from '../../../domain/events/listing-rejected.event';
|
import { ListingRejectedEvent } from '../../../domain/events/listing-rejected.event';
|
||||||
import { BulkModerateListingsCommand } from './bulk-moderate-listings.command';
|
import { BulkModerateListingsCommand } from './bulk-moderate-listings.command';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
|
import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
|
||||||
import { DomainException, NotFoundException, ValidationException, type LoggerService } from '@modules/shared';
|
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared';
|
||||||
import { KycRejectedEvent } from '../../../domain/events/kyc-rejected.event';
|
import { KycRejectedEvent } from '../../../domain/events/kyc-rejected.event';
|
||||||
import { RejectKycCommand } from './reject-kyc.command';
|
import { RejectKycCommand } from './reject-kyc.command';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { LISTING_REPOSITORY, type IListingRepository } from '@modules/listings';
|
import { LISTING_REPOSITORY, type IListingRepository } from '@modules/listings';
|
||||||
import { DomainException, NotFoundException, ValidationException, type LoggerService } from '@modules/shared';
|
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared';
|
||||||
import { ListingRejectedEvent } from '../../../domain/events/listing-rejected.event';
|
import { ListingRejectedEvent } from '../../../domain/events/listing-rejected.event';
|
||||||
import { RejectListingCommand } from './reject-listing.command';
|
import { RejectListingCommand } from './reject-listing.command';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
|
import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
|
||||||
import { DomainException, NotFoundException, ValidationException, type LoggerService } from '@modules/shared';
|
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared';
|
||||||
import { UserBannedEvent } from '../../../domain/events/user-banned.event';
|
import { UserBannedEvent } from '../../../domain/events/user-banned.event';
|
||||||
import { UserUnbannedEvent } from '../../../domain/events/user-unbanned.event';
|
import { UserUnbannedEvent } from '../../../domain/events/user-unbanned.event';
|
||||||
import { UpdateUserStatusCommand } from './update-user-status.command';
|
import { UpdateUserStatusCommand } from './update-user-status.command';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { OnEvent } from '@nestjs/event-emitter';
|
import { OnEvent } from '@nestjs/event-emitter';
|
||||||
import { type LoggerService } from '@modules/shared';
|
import { LoggerService } from '@modules/shared';
|
||||||
import { type KycApprovedEvent } from '../../domain/events/kyc-approved.event';
|
import { type KycApprovedEvent } from '../../domain/events/kyc-approved.event';
|
||||||
import { type KycRejectedEvent } from '../../domain/events/kyc-rejected.event';
|
import { type KycRejectedEvent } from '../../domain/events/kyc-rejected.event';
|
||||||
import { type ListingApprovedEvent } from '../../domain/events/listing-approved.event';
|
import { type ListingApprovedEvent } from '../../domain/events/listing-approved.event';
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type CommandBus } from '@nestjs/cqrs';
|
import { CommandBus } from '@nestjs/cqrs';
|
||||||
import { OnEvent } from '@nestjs/event-emitter';
|
import { OnEvent } from '@nestjs/event-emitter';
|
||||||
import { SendNotificationCommand } from '@modules/notifications';
|
import { SendNotificationCommand } from '@modules/notifications';
|
||||||
import { type LoggerService, type PrismaService } from '@modules/shared';
|
import { LoggerService, PrismaService } from '@modules/shared';
|
||||||
import { type UserBannedEvent } from '../../domain/events/user-banned.event';
|
import { type UserBannedEvent } from '../../domain/events/user-banned.event';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { OnEvent } from '@nestjs/event-emitter';
|
import { OnEvent } from '@nestjs/event-emitter';
|
||||||
import { type UserDeactivatedEvent } from '@modules/auth';
|
import { type UserDeactivatedEvent } from '@modules/auth';
|
||||||
import { type LoggerService, type PrismaService } from '@modules/shared';
|
import { LoggerService, PrismaService } from '@modules/shared';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class UserDeactivatedListener {
|
export class UserDeactivatedListener {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService } from '@modules/shared';
|
import { DomainException, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
AUDIT_LOG_REPOSITORY,
|
AUDIT_LOG_REPOSITORY,
|
||||||
type IAuditLogRepository,
|
type IAuditLogRepository,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService } from '@modules/shared';
|
import { DomainException, LoggerService } from '@modules/shared';
|
||||||
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type DashboardStats } from '../../../domain/repositories/admin-query.repository';
|
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type DashboardStats } from '../../../domain/repositories/admin-query.repository';
|
||||||
import { GetDashboardStatsQuery } from './get-dashboard-stats.query';
|
import { GetDashboardStatsQuery } from './get-dashboard-stats.query';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService } from '@modules/shared';
|
import { DomainException, LoggerService } from '@modules/shared';
|
||||||
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type KycQueueResult } from '../../../domain/repositories/admin-query.repository';
|
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type KycQueueResult } from '../../../domain/repositories/admin-query.repository';
|
||||||
import { GetKycQueueQuery } from './get-kyc-queue.query';
|
import { GetKycQueueQuery } from './get-kyc-queue.query';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService } from '@modules/shared';
|
import { DomainException, LoggerService } from '@modules/shared';
|
||||||
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type ModerationQueueResult } from '../../../domain/repositories/admin-query.repository';
|
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type ModerationQueueResult } from '../../../domain/repositories/admin-query.repository';
|
||||||
import { GetModerationQueueQuery } from './get-moderation-queue.query';
|
import { GetModerationQueueQuery } from './get-moderation-queue.query';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService } from '@modules/shared';
|
import { DomainException, LoggerService } from '@modules/shared';
|
||||||
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type RevenueStatsItem } from '../../../domain/repositories/admin-query.repository';
|
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type RevenueStatsItem } from '../../../domain/repositories/admin-query.repository';
|
||||||
import { GetRevenueStatsQuery } from './get-revenue-stats.query';
|
import { GetRevenueStatsQuery } from './get-revenue-stats.query';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, NotFoundException, type LoggerService } from '@modules/shared';
|
import { DomainException, NotFoundException, LoggerService } from '@modules/shared';
|
||||||
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type UserDetail } from '../../../domain/repositories/admin-query.repository';
|
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type UserDetail } from '../../../domain/repositories/admin-query.repository';
|
||||||
import { GetUserDetailQuery } from './get-user-detail.query';
|
import { GetUserDetailQuery } from './get-user-detail.query';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService } from '@modules/shared';
|
import { DomainException, LoggerService } from '@modules/shared';
|
||||||
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type UserListResult } from '../../../domain/repositories/admin-query.repository';
|
import { ADMIN_QUERY_REPOSITORY, type IAdminQueryRepository, type UserListResult } from '../../../domain/repositories/admin-query.repository';
|
||||||
import { GetUsersQuery } from './get-users.query';
|
import { GetUsersQuery } from './get-users.query';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type PrismaService } from '@modules/shared';
|
import { PrismaService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
type IAdminQueryRepository,
|
type IAdminQueryRepository,
|
||||||
type ModerationQueueResult,
|
type ModerationQueueResult,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type AdminAction, type AuditTargetType, type Prisma } from '@prisma/client';
|
import { type AdminAction, type AuditTargetType, type Prisma } from '@prisma/client';
|
||||||
import { type PrismaService } from '@modules/shared';
|
import { PrismaService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
type IAuditLogRepository,
|
type IAuditLogRepository,
|
||||||
type AuditLogEntry,
|
type AuditLogEntry,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
Query,
|
Query,
|
||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { type CommandBus, type QueryBus } from '@nestjs/cqrs';
|
import { CommandBus, QueryBus } from '@nestjs/cqrs';
|
||||||
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiParam, ApiQuery } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiParam, ApiQuery } from '@nestjs/swagger';
|
||||||
import { type JwtPayload, CurrentUser, Roles, JwtAuthGuard, RolesGuard } from '@modules/auth';
|
import { type JwtPayload, CurrentUser, Roles, JwtAuthGuard, RolesGuard } from '@modules/auth';
|
||||||
import {
|
import {
|
||||||
@@ -31,12 +31,12 @@ import {
|
|||||||
type ModerationQueueResult,
|
type ModerationQueueResult,
|
||||||
type KycQueueResult,
|
type KycQueueResult,
|
||||||
} from '../../domain/repositories/admin-query.repository';
|
} from '../../domain/repositories/admin-query.repository';
|
||||||
import { type AdminFeatureListingDto } from '../dto/admin-feature-listing.dto';
|
import { AdminFeatureListingDto } from '../dto/admin-feature-listing.dto';
|
||||||
import { type ApproveKycDto } from '../dto/approve-kyc.dto';
|
import { ApproveKycDto } from '../dto/approve-kyc.dto';
|
||||||
import { type ApproveListingDto } from '../dto/approve-listing.dto';
|
import { ApproveListingDto } from '../dto/approve-listing.dto';
|
||||||
import { type BulkModerateDto } from '../dto/bulk-moderate.dto';
|
import { BulkModerateDto } from '../dto/bulk-moderate.dto';
|
||||||
import { type RejectKycDto } from '../dto/reject-kyc.dto';
|
import { RejectKycDto } from '../dto/reject-kyc.dto';
|
||||||
import { type RejectListingDto } from '../dto/reject-listing.dto';
|
import { RejectListingDto } from '../dto/reject-listing.dto';
|
||||||
|
|
||||||
@ApiTags('admin')
|
@ApiTags('admin')
|
||||||
@ApiBearerAuth('JWT')
|
@ApiBearerAuth('JWT')
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
Query,
|
Query,
|
||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { type CommandBus, type QueryBus } from '@nestjs/cqrs';
|
import { CommandBus, QueryBus } from '@nestjs/cqrs';
|
||||||
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiQuery, ApiParam } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiQuery, ApiParam } from '@nestjs/swagger';
|
||||||
import { type JwtPayload, CurrentUser, Roles, JwtAuthGuard, RolesGuard } from '@modules/auth';
|
import { type JwtPayload, CurrentUser, Roles, JwtAuthGuard, RolesGuard } from '@modules/auth';
|
||||||
import { AdjustSubscriptionCommand } from '../../application/commands/adjust-subscription/adjust-subscription.command';
|
import { AdjustSubscriptionCommand } from '../../application/commands/adjust-subscription/adjust-subscription.command';
|
||||||
@@ -29,12 +29,12 @@ import {
|
|||||||
type UserDetail,
|
type UserDetail,
|
||||||
} from '../../domain/repositories/admin-query.repository';
|
} from '../../domain/repositories/admin-query.repository';
|
||||||
import { type AuditLogListResult } from '../../domain/repositories/audit-log.repository';
|
import { type AuditLogListResult } from '../../domain/repositories/audit-log.repository';
|
||||||
import { type AdjustSubscriptionDto } from '../dto/adjust-subscription.dto';
|
import { AdjustSubscriptionDto } from '../dto/adjust-subscription.dto';
|
||||||
import { type BanUserDto } from '../dto/ban-user.dto';
|
import { BanUserDto } from '../dto/ban-user.dto';
|
||||||
import { type GetAuditLogsQueryDto } from '../dto/get-audit-logs-query.dto';
|
import { GetAuditLogsQueryDto } from '../dto/get-audit-logs-query.dto';
|
||||||
import { type GetUsersQueryDto } from '../dto/get-users-query.dto';
|
import { GetUsersQueryDto } from '../dto/get-users-query.dto';
|
||||||
import { type RevenueStatsDto } from '../dto/revenue-stats.dto';
|
import { RevenueStatsDto } from '../dto/revenue-stats.dto';
|
||||||
import { type UpdateUserStatusDto } from '../dto/update-user-status.dto';
|
import { UpdateUserStatusDto } from '../dto/update-user-status.dto';
|
||||||
|
|
||||||
@ApiTags('admin')
|
@ApiTags('admin')
|
||||||
@ApiBearerAuth('JWT')
|
@ApiBearerAuth('JWT')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService } from '@modules/shared';
|
import { DomainException, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
AGENT_REPOSITORY,
|
AGENT_REPOSITORY,
|
||||||
type IAgentRepository,
|
type IAgentRepository,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type CommandBus } from '@nestjs/cqrs';
|
import { CommandBus } from '@nestjs/cqrs';
|
||||||
import { OnEvent } from '@nestjs/event-emitter';
|
import { OnEvent } from '@nestjs/event-emitter';
|
||||||
import { type LoggerService } from '@modules/shared';
|
import { LoggerService } from '@modules/shared';
|
||||||
import { RecalculateQualityScoreCommand } from '../commands/recalculate-quality-score/recalculate-quality-score.command';
|
import { RecalculateQualityScoreCommand } from '../commands/recalculate-quality-score/recalculate-quality-score.command';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, NotFoundException, type LoggerService } from '@modules/shared';
|
import { DomainException, NotFoundException, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
AGENT_REPOSITORY,
|
AGENT_REPOSITORY,
|
||||||
type AgentDashboardData,
|
type AgentDashboardData,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService } from '@modules/shared';
|
import { DomainException, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
AGENT_REPOSITORY,
|
AGENT_REPOSITORY,
|
||||||
type AgentPublicProfileData,
|
type AgentPublicProfileData,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type PrismaService } from '@modules/shared';
|
import { PrismaService } from '@modules/shared';
|
||||||
import { AgentEntity } from '../../domain/entities/agent.entity';
|
import { AgentEntity } from '../../domain/entities/agent.entity';
|
||||||
import {
|
import {
|
||||||
type AgentDashboardData,
|
type AgentDashboardData,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Controller, Get, NotFoundException, Param, Post, UseGuards } from '@nestjs/common';
|
import { Controller, Get, NotFoundException, Param, Post, UseGuards } from '@nestjs/common';
|
||||||
import { type CommandBus, type QueryBus } from '@nestjs/cqrs';
|
import { CommandBus, QueryBus } from '@nestjs/cqrs';
|
||||||
import {
|
import {
|
||||||
ApiBearerAuth,
|
ApiBearerAuth,
|
||||||
ApiOperation,
|
ApiOperation,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService } from '@modules/shared';
|
import { DomainException, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
MARKET_INDEX_REPOSITORY,
|
MARKET_INDEX_REPOSITORY,
|
||||||
type IMarketIndexRepository,
|
type IMarketIndexRepository,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { InternalServerErrorException } from '@nestjs/common';
|
import { InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService } from '@modules/shared';
|
import { DomainException, LoggerService } from '@modules/shared';
|
||||||
import { TrackEventCommand } from './track-event.command';
|
import { TrackEventCommand } from './track-event.command';
|
||||||
|
|
||||||
export interface TrackEventResult {
|
export interface TrackEventResult {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type CacheService, CachePrefix, type LoggerService } from '@modules/shared';
|
import { DomainException, CacheService, CachePrefix, LoggerService } from '@modules/shared';
|
||||||
import { MarketIndexEntity } from '../../../domain/entities/market-index.entity';
|
import { MarketIndexEntity } from '../../../domain/entities/market-index.entity';
|
||||||
import {
|
import {
|
||||||
MARKET_INDEX_REPOSITORY,
|
MARKET_INDEX_REPOSITORY,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Inject } from '@nestjs/common';
|
import { Inject } from '@nestjs/common';
|
||||||
import { EventsHandler, type IEventHandler, type CommandBus } from '@nestjs/cqrs';
|
import { EventsHandler, type IEventHandler, CommandBus } from '@nestjs/cqrs';
|
||||||
import { ListingCreatedEvent, ModerateListingCommand } from '@modules/listings';
|
import { ListingCreatedEvent, ModerateListingCommand } from '@modules/listings';
|
||||||
import { type PrismaService, type LoggerService } from '@modules/shared';
|
import { PrismaService, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
AI_SERVICE_CLIENT,
|
AI_SERVICE_CLIENT,
|
||||||
type IAiServiceClient,
|
type IAiServiceClient,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { CacheService, CachePrefix, CacheTTL, DomainException, type LoggerService } from '@modules/shared';
|
import { CacheService, CachePrefix, CacheTTL, DomainException, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
AVM_SERVICE,
|
AVM_SERVICE,
|
||||||
type IAVMService,
|
type IAVMService,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type CacheService, CachePrefix, CacheTTL, Cacheable, type LoggerService } from '@modules/shared';
|
import { DomainException, CacheService, CachePrefix, CacheTTL, Cacheable, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
MARKET_INDEX_REPOSITORY,
|
MARKET_INDEX_REPOSITORY,
|
||||||
type IMarketIndexRepository,
|
type IMarketIndexRepository,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, CacheService, CachePrefix, CacheTTL, type LoggerService } from '@modules/shared';
|
import { DomainException, CacheService, CachePrefix, CacheTTL, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
MARKET_INDEX_REPOSITORY,
|
MARKET_INDEX_REPOSITORY,
|
||||||
type IMarketIndexRepository,
|
type IMarketIndexRepository,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, CacheService, CachePrefix, CacheTTL, type LoggerService } from '@modules/shared';
|
import { DomainException, CacheService, CachePrefix, CacheTTL, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
MARKET_INDEX_REPOSITORY,
|
MARKET_INDEX_REPOSITORY,
|
||||||
type IMarketIndexRepository,
|
type IMarketIndexRepository,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, CacheService, CachePrefix, CacheTTL, type LoggerService } from '@modules/shared';
|
import { DomainException, CacheService, CachePrefix, CacheTTL, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
MARKET_INDEX_REPOSITORY,
|
MARKET_INDEX_REPOSITORY,
|
||||||
type IMarketIndexRepository,
|
type IMarketIndexRepository,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, CacheService, CachePrefix, CacheTTL, type LoggerService } from '@modules/shared';
|
import { DomainException, CacheService, CachePrefix, CacheTTL, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
AVM_SERVICE,
|
AVM_SERVICE,
|
||||||
type IAVMService,
|
type IAVMService,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService } from '@modules/shared';
|
import { DomainException, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
AI_SERVICE_CLIENT,
|
AI_SERVICE_CLIENT,
|
||||||
type IAiServiceClient,
|
type IAiServiceClient,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { CacheService, CachePrefix, CacheTTL, DomainException, type LoggerService, type PrismaService } from '@modules/shared';
|
import { CacheService, CachePrefix, CacheTTL, DomainException, LoggerService, PrismaService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
AVM_SERVICE,
|
AVM_SERVICE,
|
||||||
type IAVMService,
|
type IAVMService,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||||
import { CacheService, CachePrefix, CacheTTL, DomainException, type LoggerService } from '@modules/shared';
|
import { CacheService, CachePrefix, CacheTTL, DomainException, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
VALUATION_REPOSITORY,
|
VALUATION_REPOSITORY,
|
||||||
type IValuationRepository,
|
type IValuationRepository,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type MarketIndex as PrismaMarketIndex, type PropertyType } from '@prisma/client';
|
import { type MarketIndex as PrismaMarketIndex, type PropertyType } from '@prisma/client';
|
||||||
import { type PrismaService } from '@modules/shared';
|
import { PrismaService } from '@modules/shared';
|
||||||
import { MarketIndexEntity, type MarketIndexProps } from '../../domain/entities/market-index.entity';
|
import { MarketIndexEntity, type MarketIndexProps } from '../../domain/entities/market-index.entity';
|
||||||
import {
|
import {
|
||||||
type IMarketIndexRepository,
|
type IMarketIndexRepository,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type Prisma, type Valuation as PrismaValuation } from '@prisma/client';
|
import { type Prisma, type Valuation as PrismaValuation } from '@prisma/client';
|
||||||
import { type PrismaService } from '@modules/shared';
|
import { PrismaService } from '@modules/shared';
|
||||||
import { ValuationEntity, type ValuationProps } from '../../domain/entities/valuation.entity';
|
import { ValuationEntity, type ValuationProps } from '../../domain/entities/valuation.entity';
|
||||||
import { type IValuationRepository } from '../../domain/repositories/valuation.repository';
|
import { type IValuationRepository } from '../../domain/repositories/valuation.repository';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type LoggerService } from '@modules/shared';
|
import { LoggerService } from '@modules/shared';
|
||||||
|
|
||||||
export interface AiPredictRequest {
|
export interface AiPredictRequest {
|
||||||
area: number;
|
area: number;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { Cron } from '@nestjs/schedule';
|
import { Cron } from '@nestjs/schedule';
|
||||||
import { type PrismaService, type LoggerService } from '@modules/shared';
|
import { PrismaService, LoggerService } from '@modules/shared';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AvmRetrainCronService {
|
export class AvmRetrainCronService {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { type PrismaService, type LoggerService } from '@modules/shared';
|
import { PrismaService, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
type IAVMService,
|
type IAVMService,
|
||||||
type AVMParams,
|
type AVMParams,
|
||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
type IAiServiceClient,
|
type IAiServiceClient,
|
||||||
type AiPredictRequest,
|
type AiPredictRequest,
|
||||||
} from './ai-service.client';
|
} from './ai-service.client';
|
||||||
import { type PrismaAVMService } from './prisma-avm.service';
|
import { PrismaAVMService } from './prisma-avm.service';
|
||||||
|
|
||||||
/** Max concurrency for batch AI calls to avoid overloading the Python service. */
|
/** Max concurrency for batch AI calls to avoid overloading the Python service. */
|
||||||
const BATCH_CONCURRENCY = 5;
|
const BATCH_CONCURRENCY = 5;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type CommandBus } from '@nestjs/cqrs';
|
import { CommandBus } from '@nestjs/cqrs';
|
||||||
import { Cron, CronExpression } from '@nestjs/schedule';
|
import { Cron, CronExpression } from '@nestjs/schedule';
|
||||||
import { PropertyType } from '@prisma/client';
|
import { PropertyType } from '@prisma/client';
|
||||||
import { type PrismaService, type LoggerService } from '@modules/shared';
|
import { PrismaService, LoggerService } from '@modules/shared';
|
||||||
import { UpdateMarketIndexCommand } from '../../application/commands/update-market-index/update-market-index.command';
|
import { UpdateMarketIndexCommand } from '../../application/commands/update-market-index/update-market-index.command';
|
||||||
|
|
||||||
interface MarketStats {
|
interface MarketStats {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { POIType } from '@prisma/client';
|
import { POIType } from '@prisma/client';
|
||||||
import { type PrismaService, type LoggerService } from '@modules/shared';
|
import { PrismaService, LoggerService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
type INeighborhoodScoreService,
|
type INeighborhoodScoreService,
|
||||||
type NeighborhoodScoreResult,
|
type NeighborhoodScoreResult,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type PropertyType } from '@prisma/client';
|
import { type PropertyType } from '@prisma/client';
|
||||||
import { type PrismaService } from '@modules/shared';
|
import { PrismaService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
type IAVMService,
|
type IAVMService,
|
||||||
type AVMParams,
|
type AVMParams,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
Query,
|
Query,
|
||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { type QueryBus } from '@nestjs/cqrs';
|
import { QueryBus } from '@nestjs/cqrs';
|
||||||
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiParam } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiParam } from '@nestjs/swagger';
|
||||||
import { JwtAuthGuard } from '@modules/auth';
|
import { JwtAuthGuard } from '@modules/auth';
|
||||||
import { EndpointRateLimit, EndpointRateLimitGuard } from '@modules/shared';
|
import { EndpointRateLimit, EndpointRateLimitGuard } from '@modules/shared';
|
||||||
@@ -30,14 +30,14 @@ import { ValuationComparisonQuery } from '../../application/queries/valuation-co
|
|||||||
import { type ValuationHistoryDto as ValuationHistoryResultDto } from '../../application/queries/valuation-history/valuation-history.handler';
|
import { type ValuationHistoryDto as ValuationHistoryResultDto } from '../../application/queries/valuation-history/valuation-history.handler';
|
||||||
import { ValuationHistoryQuery } from '../../application/queries/valuation-history/valuation-history.query';
|
import { ValuationHistoryQuery } from '../../application/queries/valuation-history/valuation-history.query';
|
||||||
import { type NeighborhoodScoreResult } from '../../domain/services/neighborhood-score.service';
|
import { type NeighborhoodScoreResult } from '../../domain/services/neighborhood-score.service';
|
||||||
import { type BatchValuationDto } from '../dto/batch-valuation.dto';
|
import { BatchValuationDto } from '../dto/batch-valuation.dto';
|
||||||
import { type GetDistrictStatsDto } from '../dto/get-district-stats.dto';
|
import { GetDistrictStatsDto } from '../dto/get-district-stats.dto';
|
||||||
import { type GetHeatmapDto } from '../dto/get-heatmap.dto';
|
import { GetHeatmapDto } from '../dto/get-heatmap.dto';
|
||||||
import { type GetMarketReportDto } from '../dto/get-market-report.dto';
|
import { GetMarketReportDto } from '../dto/get-market-report.dto';
|
||||||
import { type GetPriceTrendDto } from '../dto/get-price-trend.dto';
|
import { GetPriceTrendDto } from '../dto/get-price-trend.dto';
|
||||||
import { type GetValuationDto } from '../dto/get-valuation.dto';
|
import { GetValuationDto } from '../dto/get-valuation.dto';
|
||||||
import { type ValuationComparisonDto } from '../dto/valuation-comparison.dto';
|
import { ValuationComparisonDto } from '../dto/valuation-comparison.dto';
|
||||||
import { type ValuationHistoryDto } from '../dto/valuation-history.dto';
|
import { ValuationHistoryDto } from '../dto/valuation-history.dto';
|
||||||
|
|
||||||
@ApiTags('analytics')
|
@ApiTags('analytics')
|
||||||
@Controller('analytics')
|
@Controller('analytics')
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
Query,
|
Query,
|
||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { type QueryBus } from '@nestjs/cqrs';
|
import { QueryBus } from '@nestjs/cqrs';
|
||||||
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiParam, ApiQuery } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiParam, ApiQuery } from '@nestjs/swagger';
|
||||||
import { JwtAuthGuard } from '@modules/auth';
|
import { JwtAuthGuard } from '@modules/auth';
|
||||||
import { EndpointRateLimit, EndpointRateLimitGuard } from '@modules/shared';
|
import { EndpointRateLimit, EndpointRateLimitGuard } from '@modules/shared';
|
||||||
@@ -20,10 +20,10 @@ import { type ValuationComparisonDto as ValuationComparisonResultDto } from '../
|
|||||||
import { ValuationComparisonQuery } from '../../application/queries/valuation-comparison/valuation-comparison.query';
|
import { ValuationComparisonQuery } from '../../application/queries/valuation-comparison/valuation-comparison.query';
|
||||||
import { type ValuationHistoryDto as ValuationHistoryResultDto } from '../../application/queries/valuation-history/valuation-history.handler';
|
import { type ValuationHistoryDto as ValuationHistoryResultDto } from '../../application/queries/valuation-history/valuation-history.handler';
|
||||||
import { ValuationHistoryQuery } from '../../application/queries/valuation-history/valuation-history.query';
|
import { ValuationHistoryQuery } from '../../application/queries/valuation-history/valuation-history.query';
|
||||||
import { type AvmCompareQueryDto } from '../dto/avm-compare-query.dto';
|
import { AvmCompareQueryDto } from '../dto/avm-compare-query.dto';
|
||||||
import { type BatchValuationDto } from '../dto/batch-valuation.dto';
|
import { BatchValuationDto } from '../dto/batch-valuation.dto';
|
||||||
import { type IndustrialValuationDto } from '../dto/industrial-valuation.dto';
|
import { IndustrialValuationDto } from '../dto/industrial-valuation.dto';
|
||||||
import { type ValuationHistoryDto } from '../dto/valuation-history.dto';
|
import { ValuationHistoryDto } from '../dto/valuation-history.dto';
|
||||||
|
|
||||||
@ApiTags('avm')
|
@ApiTags('avm')
|
||||||
@Controller('avm')
|
@Controller('avm')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { InternalServerErrorException } from '@nestjs/common';
|
import { InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { type LoggerService, type PrismaService, DomainException, NotFoundException, ValidationException } from '@modules/shared';
|
import { LoggerService, PrismaService, DomainException, NotFoundException, ValidationException } from '@modules/shared';
|
||||||
import { CancelUserDeletionCommand } from './cancel-user-deletion.command';
|
import { CancelUserDeletionCommand } from './cancel-user-deletion.command';
|
||||||
|
|
||||||
@CommandHandler(CancelUserDeletionCommand)
|
@CommandHandler(CancelUserDeletionCommand)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService, UnauthorizedException, ValidationException } from '@modules/shared';
|
import { DomainException, LoggerService, UnauthorizedException, ValidationException } from '@modules/shared';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||||
import { type MfaService } from '../../../infrastructure/services/mfa.service';
|
import { MfaService } from '../../../infrastructure/services/mfa.service';
|
||||||
import { DisableMfaCommand } from './disable-mfa.command';
|
import { DisableMfaCommand } from './disable-mfa.command';
|
||||||
|
|
||||||
@CommandHandler(DisableMfaCommand)
|
@CommandHandler(DisableMfaCommand)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { InternalServerErrorException } from '@nestjs/common';
|
import { InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { type LoggerService, type PrismaService, DomainException, NotFoundException } from '@modules/shared';
|
import { LoggerService, PrismaService, DomainException, NotFoundException } from '@modules/shared';
|
||||||
import { ExportUserDataCommand } from './export-user-data.command';
|
import { ExportUserDataCommand } from './export-user-data.command';
|
||||||
|
|
||||||
export interface UserDataExport {
|
export interface UserDataExport {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { InternalServerErrorException } from '@nestjs/common';
|
import { InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { Prisma } from '@prisma/client';
|
import { Prisma } from '@prisma/client';
|
||||||
import { type LoggerService, type PrismaService, DomainException, NotFoundException } from '@modules/shared';
|
import { LoggerService, PrismaService, DomainException, NotFoundException } from '@modules/shared';
|
||||||
import { ForceDeleteUserCommand } from './force-delete-user.command';
|
import { ForceDeleteUserCommand } from './force-delete-user.command';
|
||||||
|
|
||||||
@CommandHandler(ForceDeleteUserCommand)
|
@CommandHandler(ForceDeleteUserCommand)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
|||||||
import {
|
import {
|
||||||
NotFoundException,
|
NotFoundException,
|
||||||
ValidationException,
|
ValidationException,
|
||||||
type LoggerService,
|
LoggerService,
|
||||||
} from '@modules/shared';
|
} from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
MEDIA_STORAGE_SERVICE,
|
MEDIA_STORAGE_SERVICE,
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { createId } from '@paralleldrive/cuid2';
|
import { createId } from '@paralleldrive/cuid2';
|
||||||
import { type LoggerService, DomainException } from '@modules/shared';
|
import { LoggerService, DomainException } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
MFA_CHALLENGE_REPOSITORY,
|
MFA_CHALLENGE_REPOSITORY,
|
||||||
type IMfaChallengeRepository,
|
type IMfaChallengeRepository,
|
||||||
} from '../../../domain/repositories/mfa-challenge.repository';
|
} from '../../../domain/repositories/mfa-challenge.repository';
|
||||||
import { type TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
import { TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
||||||
import { LoginUserCommand } from './login-user.command';
|
import { LoginUserCommand } from './login-user.command';
|
||||||
|
|
||||||
const MFA_CHALLENGE_TTL_MINUTES = 5;
|
const MFA_CHALLENGE_TTL_MINUTES = 5;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { InternalServerErrorException } from '@nestjs/common';
|
import { InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type CommandBus, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, CommandBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { type LoggerService, type PrismaService, DomainException } from '@modules/shared';
|
import { LoggerService, PrismaService, DomainException } from '@modules/shared';
|
||||||
import { ForceDeleteUserCommand } from '../force-delete-user/force-delete-user.command';
|
import { ForceDeleteUserCommand } from '../force-delete-user/force-delete-user.command';
|
||||||
import { ProcessScheduledDeletionsCommand } from './process-scheduled-deletions.command';
|
import { ProcessScheduledDeletionsCommand } from './process-scheduled-deletions.command';
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { type LoggerService, DomainException, UnauthorizedException } from '@modules/shared';
|
import { LoggerService, DomainException, UnauthorizedException } from '@modules/shared';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||||
import { type TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
import { TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
||||||
import { RefreshTokenCommand } from './refresh-token.command';
|
import { RefreshTokenCommand } from './refresh-token.command';
|
||||||
|
|
||||||
@CommandHandler(RefreshTokenCommand)
|
@CommandHandler(RefreshTokenCommand)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
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 { createId } from '@paralleldrive/cuid2';
|
||||||
import { ConflictException, DomainException, type LoggerService, ValidationException } from '@modules/shared';
|
import { ConflictException, DomainException, LoggerService, ValidationException } from '@modules/shared';
|
||||||
import { UserEntity } from '../../../domain/entities/user.entity';
|
import { UserEntity } from '../../../domain/entities/user.entity';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||||
import { Email } from '../../../domain/value-objects/email.vo';
|
import { Email } from '../../../domain/value-objects/email.vo';
|
||||||
import { HashedPassword } from '../../../domain/value-objects/hashed-password.vo';
|
import { HashedPassword } from '../../../domain/value-objects/hashed-password.vo';
|
||||||
import { Phone } from '../../../domain/value-objects/phone.vo';
|
import { Phone } from '../../../domain/value-objects/phone.vo';
|
||||||
import { type TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
import { TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
||||||
import { RegisterUserCommand } from './register-user.command';
|
import { RegisterUserCommand } from './register-user.command';
|
||||||
|
|
||||||
@CommandHandler(RegisterUserCommand)
|
@CommandHandler(RegisterUserCommand)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { InternalServerErrorException } from '@nestjs/common';
|
import { InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { type LoggerService, type PrismaService, DomainException, NotFoundException, ValidationException } from '@modules/shared';
|
import { LoggerService, PrismaService, DomainException, NotFoundException, ValidationException } from '@modules/shared';
|
||||||
import { RequestUserDeletionCommand } from './request-user-deletion.command';
|
import { RequestUserDeletionCommand } from './request-user-deletion.command';
|
||||||
|
|
||||||
const DELETION_GRACE_PERIOD_DAYS = 30;
|
const DELETION_GRACE_PERIOD_DAYS = 30;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService, ValidationException } from '@modules/shared';
|
import { DomainException, LoggerService, ValidationException } from '@modules/shared';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||||
import { type MfaService, type MfaSetupResult } from '../../../infrastructure/services/mfa.service';
|
import { MfaService, type MfaSetupResult } from '../../../infrastructure/services/mfa.service';
|
||||||
import { SetupMfaCommand } from './setup-mfa.command';
|
import { SetupMfaCommand } from './setup-mfa.command';
|
||||||
|
|
||||||
export interface SetupMfaResultDto {
|
export interface SetupMfaResultDto {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Inject, InternalServerErrorException } from '@nestjs/common';
|
|||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import {
|
import {
|
||||||
DomainException,
|
DomainException,
|
||||||
type LoggerService,
|
LoggerService,
|
||||||
NotFoundException,
|
NotFoundException,
|
||||||
ValidationException,
|
ValidationException,
|
||||||
CacheService,
|
CacheService,
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { randomInt } from 'crypto';
|
import { randomInt } from 'crypto';
|
||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import {
|
import {
|
||||||
CachePrefix,
|
CachePrefix,
|
||||||
CacheService,
|
CacheService,
|
||||||
ConflictException,
|
ConflictException,
|
||||||
DomainException,
|
DomainException,
|
||||||
type LoggerService,
|
LoggerService,
|
||||||
NotFoundException,
|
NotFoundException,
|
||||||
type RedisService,
|
RedisService,
|
||||||
ValidationException,
|
ValidationException,
|
||||||
} from '@modules/shared';
|
} from '@modules/shared';
|
||||||
import { EmailChangeRequestedEvent } from '../../../domain/events/email-change-requested.event';
|
import { EmailChangeRequestedEvent } from '../../../domain/events/email-change-requested.event';
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService, UnauthorizedException } from '@modules/shared';
|
import { DomainException, LoggerService, UnauthorizedException } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
MFA_CHALLENGE_REPOSITORY,
|
MFA_CHALLENGE_REPOSITORY,
|
||||||
type IMfaChallengeRepository,
|
type IMfaChallengeRepository,
|
||||||
} from '../../../domain/repositories/mfa-challenge.repository';
|
} from '../../../domain/repositories/mfa-challenge.repository';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||||
import { type MfaService } from '../../../infrastructure/services/mfa.service';
|
import { MfaService } from '../../../infrastructure/services/mfa.service';
|
||||||
import { type TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
import { TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
||||||
import { UseBackupCodeCommand } from './use-backup-code.command';
|
import { UseBackupCodeCommand } from './use-backup-code.command';
|
||||||
|
|
||||||
@CommandHandler(UseBackupCodeCommand)
|
@CommandHandler(UseBackupCodeCommand)
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import {
|
|||||||
CacheService,
|
CacheService,
|
||||||
ConflictException,
|
ConflictException,
|
||||||
DomainException,
|
DomainException,
|
||||||
type LoggerService,
|
LoggerService,
|
||||||
NotFoundException,
|
NotFoundException,
|
||||||
type RedisService,
|
RedisService,
|
||||||
ValidationException,
|
ValidationException,
|
||||||
} from '@modules/shared';
|
} from '@modules/shared';
|
||||||
import { type IUserRepository, USER_REPOSITORY } from '../../../domain/repositories/user.repository';
|
import { type IUserRepository, USER_REPOSITORY } from '../../../domain/repositories/user.repository';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService, NotFoundException, CacheService, CachePrefix } from '@modules/shared';
|
import { DomainException, LoggerService, NotFoundException, CacheService, CachePrefix } from '@modules/shared';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||||
import { VerifyKycCommand } from './verify-kyc.command';
|
import { VerifyKycCommand } from './verify-kyc.command';
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService, UnauthorizedException } from '@modules/shared';
|
import { DomainException, LoggerService, UnauthorizedException } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
MFA_CHALLENGE_REPOSITORY,
|
MFA_CHALLENGE_REPOSITORY,
|
||||||
type IMfaChallengeRepository,
|
type IMfaChallengeRepository,
|
||||||
} from '../../../domain/repositories/mfa-challenge.repository';
|
} from '../../../domain/repositories/mfa-challenge.repository';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||||
import { type MfaService } from '../../../infrastructure/services/mfa.service';
|
import { MfaService } from '../../../infrastructure/services/mfa.service';
|
||||||
import { type TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
import { TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
||||||
import { VerifyMfaChallengeCommand } from './verify-mfa-challenge.command';
|
import { VerifyMfaChallengeCommand } from './verify-mfa-challenge.command';
|
||||||
|
|
||||||
@CommandHandler(VerifyMfaChallengeCommand)
|
@CommandHandler(VerifyMfaChallengeCommand)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService, ValidationException } from '@modules/shared';
|
import { DomainException, LoggerService, ValidationException } from '@modules/shared';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||||
import { type MfaService } from '../../../infrastructure/services/mfa.service';
|
import { MfaService } from '../../../infrastructure/services/mfa.service';
|
||||||
import { VerifyMfaSetupCommand } from './verify-mfa-setup.command';
|
import { VerifyMfaSetupCommand } from './verify-mfa-setup.command';
|
||||||
|
|
||||||
export interface VerifyMfaSetupResultDto {
|
export interface VerifyMfaSetupResultDto {
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import {
|
|||||||
CacheService,
|
CacheService,
|
||||||
ConflictException,
|
ConflictException,
|
||||||
DomainException,
|
DomainException,
|
||||||
type LoggerService,
|
LoggerService,
|
||||||
NotFoundException,
|
NotFoundException,
|
||||||
type RedisService,
|
RedisService,
|
||||||
ValidationException,
|
ValidationException,
|
||||||
} from '@modules/shared';
|
} from '@modules/shared';
|
||||||
import { type IUserRepository, USER_REPOSITORY } from '../../../domain/repositories/user.repository';
|
import { type IUserRepository, USER_REPOSITORY } from '../../../domain/repositories/user.repository';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable, InternalServerErrorException } from '@nestjs/common';
|
import { Injectable, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||||
import { type PrismaService, DomainException, type LoggerService } from '@modules/shared';
|
import { PrismaService, DomainException, LoggerService } from '@modules/shared';
|
||||||
import { GetAgentByUserIdQuery } from './get-agent-by-user-id.query';
|
import { GetAgentByUserIdQuery } from './get-agent-by-user-id.query';
|
||||||
|
|
||||||
export interface AgentDto {
|
export interface AgentDto {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService, ValidationException } from '@modules/shared';
|
import { DomainException, LoggerService, ValidationException } from '@modules/shared';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||||
import { GetMfaStatusQuery } from './get-mfa-status.query';
|
import { GetMfaStatusQuery } from './get-mfa-status.query';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, type LoggerService, NotFoundException, CacheService, CachePrefix, CacheTTL } from '@modules/shared';
|
import { DomainException, LoggerService, NotFoundException, CacheService, CachePrefix, CacheTTL } from '@modules/shared';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||||
import { GetProfileQuery } from './get-profile.query';
|
import { GetProfileQuery } from './get-profile.query';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type PrismaService } from '@modules/shared';
|
import { PrismaService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
type IMfaChallengeRepository,
|
type IMfaChallengeRepository,
|
||||||
type MfaChallengeRecord,
|
type MfaChallengeRecord,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type PrismaService } from '@modules/shared';
|
import { PrismaService } from '@modules/shared';
|
||||||
import {
|
import {
|
||||||
type IRefreshTokenRepository,
|
type IRefreshTokenRepository,
|
||||||
type RefreshTokenRecord,
|
type RefreshTokenRecord,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type Prisma, type User as PrismaUser } from '@prisma/client';
|
import { type Prisma, type User as PrismaUser } from '@prisma/client';
|
||||||
import { type PrismaService } from '@modules/shared';
|
import { PrismaService } from '@modules/shared';
|
||||||
import { UserEntity, type UserProps } from '../../domain/entities/user.entity';
|
import { UserEntity, type UserProps } from '../../domain/entities/user.entity';
|
||||||
import { type IUserRepository } from '../../domain/repositories/user.repository';
|
import { type IUserRepository } from '../../domain/repositories/user.repository';
|
||||||
import { Email } from '../../domain/value-objects/email.vo';
|
import { Email } from '../../domain/value-objects/email.vo';
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { type EventBus } from '@nestjs/cqrs';
|
import { EventBus } from '@nestjs/cqrs';
|
||||||
import { createId } from '@paralleldrive/cuid2';
|
import { createId } from '@paralleldrive/cuid2';
|
||||||
import { type OAuthProvider, type Prisma } from '@prisma/client';
|
import { type OAuthProvider, type Prisma } from '@prisma/client';
|
||||||
import { type PrismaService, type LoggerService } from '@modules/shared';
|
import { PrismaService, LoggerService } from '@modules/shared';
|
||||||
import { UserEntity } from '../../domain/entities/user.entity';
|
import { UserEntity } from '../../domain/entities/user.entity';
|
||||||
import { UserRegisteredEvent } from '../../domain/events/user-registered.event';
|
import { UserRegisteredEvent } from '../../domain/events/user-registered.event';
|
||||||
import { USER_REPOSITORY, type IUserRepository } from '../../domain/repositories/user.repository';
|
import { USER_REPOSITORY, type IUserRepository } from '../../domain/repositories/user.repository';
|
||||||
import { Email } from '../../domain/value-objects/email.vo';
|
import { Email } from '../../domain/value-objects/email.vo';
|
||||||
import { Phone } from '../../domain/value-objects/phone.vo';
|
import { Phone } from '../../domain/value-objects/phone.vo';
|
||||||
import { type TokenService, type TokenPair } from './token.service';
|
import { TokenService, type TokenPair } from './token.service';
|
||||||
|
|
||||||
export interface OAuthUserProfile {
|
export interface OAuthUserProfile {
|
||||||
provider: OAuthProvider;
|
provider: OAuthProvider;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { randomBytes, createHash } from 'crypto';
|
import { randomBytes, createHash } from 'crypto';
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { type JwtService } from '@nestjs/jwt';
|
import { JwtService } from '@nestjs/jwt';
|
||||||
import {
|
import {
|
||||||
REFRESH_TOKEN_REPOSITORY,
|
REFRESH_TOKEN_REPOSITORY,
|
||||||
type IRefreshTokenRepository,
|
type IRefreshTokenRepository,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { PassportStrategy } from '@nestjs/passport';
|
import { PassportStrategy } from '@nestjs/passport';
|
||||||
import { Strategy, type Profile, type VerifyCallback } from 'passport-google-oauth20';
|
import { Strategy, type Profile, type VerifyCallback } from 'passport-google-oauth20';
|
||||||
import { type OAuthService, type OAuthUserProfile } from '../services/oauth.service';
|
import { OAuthService, type OAuthUserProfile } from '../services/oauth.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class GoogleOAuthStrategy extends PassportStrategy(Strategy, 'google') {
|
export class GoogleOAuthStrategy extends PassportStrategy(Strategy, 'google') {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { type LoggerService } from '@modules/shared';
|
import { LoggerService } from '@modules/shared';
|
||||||
import { type OAuthService, type OAuthUserProfile } from '../services/oauth.service';
|
import { OAuthService, type OAuthUserProfile } from '../services/oauth.service';
|
||||||
import { type TokenPair } from '../services/token.service';
|
import { type TokenPair } from '../services/token.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,140 @@
|
|||||||
|
import { plainToInstance } from 'class-transformer';
|
||||||
|
import { validate } from 'class-validator';
|
||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
import {
|
||||||
|
GenerateKycUploadUrlsDto,
|
||||||
|
KycFileRequestDto,
|
||||||
|
} from '../dto/generate-kyc-upload-urls.dto';
|
||||||
|
|
||||||
|
const validFile = (): KycFileRequestDto => {
|
||||||
|
const file = new KycFileRequestDto();
|
||||||
|
file.field = 'frontImage';
|
||||||
|
file.mimeType = 'image/jpeg';
|
||||||
|
file.fileName = 'cccd-front.jpg';
|
||||||
|
return file;
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('KycFileRequestDto', () => {
|
||||||
|
it('accepts valid payload', async () => {
|
||||||
|
const errors = await validate(validFile());
|
||||||
|
expect(errors).toHaveLength(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each(['frontImage', 'backImage', 'selfieImage'] as const)(
|
||||||
|
'accepts allowed field value: %s',
|
||||||
|
async (value) => {
|
||||||
|
const file = validFile();
|
||||||
|
file.field = value;
|
||||||
|
const errors = await validate(file);
|
||||||
|
expect(errors).toHaveLength(0);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
it('rejects unknown field enum value', async () => {
|
||||||
|
const file = validFile();
|
||||||
|
(file as unknown as { field: string }).field = 'backgroundImage';
|
||||||
|
const errors = await validate(file);
|
||||||
|
expect(errors.some((e) => e.property === 'field')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects empty mimeType', async () => {
|
||||||
|
const file = validFile();
|
||||||
|
file.mimeType = '';
|
||||||
|
const errors = await validate(file);
|
||||||
|
expect(errors.some((e) => e.property === 'mimeType')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects non-string mimeType', async () => {
|
||||||
|
const file = validFile();
|
||||||
|
(file as unknown as { mimeType: unknown }).mimeType = 123;
|
||||||
|
const errors = await validate(file);
|
||||||
|
expect(errors.some((e) => e.property === 'mimeType')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects empty fileName', async () => {
|
||||||
|
const file = validFile();
|
||||||
|
file.fileName = '';
|
||||||
|
const errors = await validate(file);
|
||||||
|
expect(errors.some((e) => e.property === 'fileName')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects non-string fileName', async () => {
|
||||||
|
const file = validFile();
|
||||||
|
(file as unknown as { fileName: unknown }).fileName = null;
|
||||||
|
const errors = await validate(file);
|
||||||
|
expect(errors.some((e) => e.property === 'fileName')).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('GenerateKycUploadUrlsDto', () => {
|
||||||
|
const validPayload = (fileCount: 1 | 2 | 3 = 1): unknown => {
|
||||||
|
const fields = ['frontImage', 'backImage', 'selfieImage'] as const;
|
||||||
|
return {
|
||||||
|
files: Array.from({ length: fileCount }, (_, i) => ({
|
||||||
|
field: fields[i],
|
||||||
|
mimeType: 'image/jpeg',
|
||||||
|
fileName: `kyc-${fields[i]}.jpg`,
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
it('accepts single-file payload', async () => {
|
||||||
|
const dto = plainToInstance(GenerateKycUploadUrlsDto, validPayload(1));
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors).toHaveLength(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('accepts three-file payload', async () => {
|
||||||
|
const dto = plainToInstance(GenerateKycUploadUrlsDto, validPayload(3));
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors).toHaveLength(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects missing files array', async () => {
|
||||||
|
const dto = plainToInstance(GenerateKycUploadUrlsDto, {});
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some((e) => e.property === 'files')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects empty files array (below ArrayMinSize)', async () => {
|
||||||
|
const dto = plainToInstance(GenerateKycUploadUrlsDto, { files: [] });
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some((e) => e.property === 'files')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects more than three files (above ArrayMaxSize)', async () => {
|
||||||
|
const payload = validPayload(3) as { files: unknown[] };
|
||||||
|
payload.files.push({
|
||||||
|
field: 'frontImage',
|
||||||
|
mimeType: 'image/jpeg',
|
||||||
|
fileName: 'extra.jpg',
|
||||||
|
});
|
||||||
|
const dto = plainToInstance(GenerateKycUploadUrlsDto, payload);
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some((e) => e.property === 'files')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects non-array files value', async () => {
|
||||||
|
const dto = plainToInstance(GenerateKycUploadUrlsDto, {
|
||||||
|
files: 'not-an-array',
|
||||||
|
});
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some((e) => e.property === 'files')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('validates nested KycFileRequestDto entries', async () => {
|
||||||
|
const dto = plainToInstance(GenerateKycUploadUrlsDto, {
|
||||||
|
files: [
|
||||||
|
{
|
||||||
|
field: 'invalidField',
|
||||||
|
mimeType: '',
|
||||||
|
fileName: '',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
const errors = await validate(dto);
|
||||||
|
const filesError = errors.find((e) => e.property === 'files');
|
||||||
|
expect(filesError).toBeDefined();
|
||||||
|
expect(filesError?.children?.length ?? 0).toBeGreaterThan(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
import { validate } from 'class-validator';
|
||||||
|
import { SubmitKycDto } from '../../presentation/dto/submit-kyc.dto';
|
||||||
|
|
||||||
|
describe('SubmitKycDto', () => {
|
||||||
|
const validDto = (): SubmitKycDto => {
|
||||||
|
const dto = new SubmitKycDto();
|
||||||
|
dto.documentType = 'CCCD';
|
||||||
|
dto.documentNumber = '001234567890';
|
||||||
|
dto.frontImageUrl = 'https://cdn.goodgo.vn/kyc/front-123.jpg';
|
||||||
|
return dto;
|
||||||
|
};
|
||||||
|
|
||||||
|
it('accepts valid required fields only', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors).toHaveLength(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('accepts all fields together', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
dto.backImageUrl = 'https://cdn.goodgo.vn/kyc/back-123.jpg';
|
||||||
|
dto.selfieUrl = 'https://cdn.goodgo.vn/kyc/selfie-123.jpg';
|
||||||
|
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors).toHaveLength(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects empty documentType', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
dto.documentType = '';
|
||||||
|
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some(e => e.property === 'documentType')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects missing documentType', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
(dto as any).documentType = undefined;
|
||||||
|
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some(e => e.property === 'documentType')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects empty documentNumber', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
dto.documentNumber = '';
|
||||||
|
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some(e => e.property === 'documentNumber')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects missing documentNumber', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
(dto as any).documentNumber = undefined;
|
||||||
|
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some(e => e.property === 'documentNumber')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects empty frontImageUrl', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
dto.frontImageUrl = '';
|
||||||
|
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some(e => e.property === 'frontImageUrl')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects invalid frontImageUrl format', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
dto.frontImageUrl = 'not-a-url';
|
||||||
|
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some(e => e.property === 'frontImageUrl')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects missing frontImageUrl', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
(dto as any).frontImageUrl = undefined;
|
||||||
|
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some(e => e.property === 'frontImageUrl')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects invalid backImageUrl format', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
dto.backImageUrl = 'not-a-url';
|
||||||
|
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some(e => e.property === 'backImageUrl')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects invalid selfieUrl format', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
dto.selfieUrl = 'not-a-url';
|
||||||
|
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some(e => e.property === 'selfieUrl')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects non-string documentType', async () => {
|
||||||
|
const dto = validDto();
|
||||||
|
(dto as any).documentType = 123;
|
||||||
|
|
||||||
|
const errors = await validate(dto);
|
||||||
|
expect(errors.some(e => e.property === 'documentType')).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
Res,
|
Res,
|
||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { type CommandBus, type QueryBus } from '@nestjs/cqrs';
|
import { CommandBus, QueryBus } from '@nestjs/cqrs';
|
||||||
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiBody } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiBody } from '@nestjs/swagger';
|
||||||
import { Throttle } from '@nestjs/throttler';
|
import { Throttle } from '@nestjs/throttler';
|
||||||
import { type Request, type Response } from 'express';
|
import { type Request, type Response } from 'express';
|
||||||
@@ -34,19 +34,19 @@ import { type AgentDto } from '../../application/queries/get-agent-by-user-id/ge
|
|||||||
import { GetAgentByUserIdQuery } from '../../application/queries/get-agent-by-user-id/get-agent-by-user-id.query';
|
import { GetAgentByUserIdQuery } from '../../application/queries/get-agent-by-user-id/get-agent-by-user-id.query';
|
||||||
import { type UserProfileDto } from '../../application/queries/get-profile/get-profile.handler';
|
import { type UserProfileDto } from '../../application/queries/get-profile/get-profile.handler';
|
||||||
import { GetProfileQuery } from '../../application/queries/get-profile/get-profile.query';
|
import { GetProfileQuery } from '../../application/queries/get-profile/get-profile.query';
|
||||||
import { type TokenService, type JwtPayload, type TokenPair } from '../../infrastructure/services/token.service';
|
import { TokenService, type JwtPayload, type TokenPair } from '../../infrastructure/services/token.service';
|
||||||
import { type LocalStrategyResult } from '../../infrastructure/strategies/local.strategy';
|
import { type LocalStrategyResult } from '../../infrastructure/strategies/local.strategy';
|
||||||
import { CurrentUser } from '../decorators/current-user.decorator';
|
import { CurrentUser } from '../decorators/current-user.decorator';
|
||||||
import { Roles } from '../decorators/roles.decorator';
|
import { Roles } from '../decorators/roles.decorator';
|
||||||
import { type GenerateKycUploadUrlsDto } from '../dto/generate-kyc-upload-urls.dto';
|
import { GenerateKycUploadUrlsDto } from '../dto/generate-kyc-upload-urls.dto';
|
||||||
import { LoginDto } from '../dto/login.dto';
|
import { LoginDto } from '../dto/login.dto';
|
||||||
import { type RefreshTokenDto } from '../dto/refresh-token.dto';
|
import { RefreshTokenDto } from '../dto/refresh-token.dto';
|
||||||
import { type RegisterDto } from '../dto/register.dto';
|
import { RegisterDto } from '../dto/register.dto';
|
||||||
import { type SubmitKycDto } from '../dto/submit-kyc.dto';
|
import { SubmitKycDto } from '../dto/submit-kyc.dto';
|
||||||
import { type UpdateProfileDto } from '../dto/update-profile.dto';
|
import { UpdateProfileDto } from '../dto/update-profile.dto';
|
||||||
import { type VerifyEmailChangeDto } from '../dto/verify-email-change.dto';
|
import { VerifyEmailChangeDto } from '../dto/verify-email-change.dto';
|
||||||
import { type VerifyKycDto } from '../dto/verify-kyc.dto';
|
import { VerifyKycDto } from '../dto/verify-kyc.dto';
|
||||||
import { type VerifyPhoneChangeDto } from '../dto/verify-phone-change.dto';
|
import { VerifyPhoneChangeDto } from '../dto/verify-phone-change.dto';
|
||||||
import { JwtAuthGuard } from '../guards/jwt-auth.guard';
|
import { JwtAuthGuard } from '../guards/jwt-auth.guard';
|
||||||
import { LocalAuthGuard } from '../guards/local-auth.guard';
|
import { LocalAuthGuard } from '../guards/local-auth.guard';
|
||||||
import { RolesGuard } from '../guards/roles.guard';
|
import { RolesGuard } from '../guards/roles.guard';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
Res,
|
Res,
|
||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { type CommandBus, type QueryBus } from '@nestjs/cqrs';
|
import { CommandBus, QueryBus } from '@nestjs/cqrs';
|
||||||
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';
|
||||||
import { Throttle } from '@nestjs/throttler';
|
import { Throttle } from '@nestjs/throttler';
|
||||||
import { type Response } from 'express';
|
import { type Response } from 'express';
|
||||||
@@ -21,13 +21,13 @@ import { VerifyMfaSetupCommand } from '../../application/commands/verify-mfa-set
|
|||||||
import { type VerifyMfaSetupResultDto } from '../../application/commands/verify-mfa-setup/verify-mfa-setup.handler';
|
import { type VerifyMfaSetupResultDto } from '../../application/commands/verify-mfa-setup/verify-mfa-setup.handler';
|
||||||
import { type MfaStatusDto } from '../../application/queries/get-mfa-status/get-mfa-status.handler';
|
import { type MfaStatusDto } from '../../application/queries/get-mfa-status/get-mfa-status.handler';
|
||||||
import { GetMfaStatusQuery } from '../../application/queries/get-mfa-status/get-mfa-status.query';
|
import { GetMfaStatusQuery } from '../../application/queries/get-mfa-status/get-mfa-status.query';
|
||||||
import { type TokenService, type JwtPayload, type TokenPair } from '../../infrastructure/services/token.service';
|
import { TokenService, type JwtPayload, type TokenPair } from '../../infrastructure/services/token.service';
|
||||||
import { CurrentUser } from '../decorators/current-user.decorator';
|
import { CurrentUser } from '../decorators/current-user.decorator';
|
||||||
import {
|
import {
|
||||||
type VerifyMfaSetupDto,
|
VerifyMfaSetupDto,
|
||||||
type VerifyMfaChallengeDto,
|
VerifyMfaChallengeDto,
|
||||||
type UseBackupCodeDto,
|
UseBackupCodeDto,
|
||||||
type DisableMfaDto,
|
DisableMfaDto,
|
||||||
} from '../dto/mfa.dto';
|
} from '../dto/mfa.dto';
|
||||||
import { JwtAuthGuard } from '../guards/jwt-auth.guard';
|
import { JwtAuthGuard } from '../guards/jwt-auth.guard';
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { Throttle } from '@nestjs/throttler';
|
|||||||
import { type Request, type Response } from 'express';
|
import { type Request, type Response } from 'express';
|
||||||
import { UnauthorizedException } from '@modules/shared';
|
import { UnauthorizedException } from '@modules/shared';
|
||||||
import { type TokenPair } from '../../infrastructure/services/token.service';
|
import { type TokenPair } from '../../infrastructure/services/token.service';
|
||||||
import { type ZaloOAuthStrategy } from '../../infrastructure/strategies/zalo-oauth.strategy';
|
import { ZaloOAuthStrategy } from '../../infrastructure/strategies/zalo-oauth.strategy';
|
||||||
import { GoogleOAuthGuard } from '../guards/google-oauth.guard';
|
import { GoogleOAuthGuard } from '../guards/google-oauth.guard';
|
||||||
|
|
||||||
const IS_PRODUCTION = process.env['NODE_ENV'] === 'production';
|
const IS_PRODUCTION = process.env['NODE_ENV'] === 'production';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
Post,
|
Post,
|
||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { type CommandBus } from '@nestjs/cqrs';
|
import { CommandBus } from '@nestjs/cqrs';
|
||||||
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';
|
||||||
import { CancelUserDeletionCommand } from '../../application/commands/cancel-user-deletion/cancel-user-deletion.command';
|
import { CancelUserDeletionCommand } from '../../application/commands/cancel-user-deletion/cancel-user-deletion.command';
|
||||||
import { ExportUserDataCommand } from '../../application/commands/export-user-data/export-user-data.command';
|
import { ExportUserDataCommand } from '../../application/commands/export-user-data/export-user-data.command';
|
||||||
@@ -17,8 +17,8 @@ import { RequestUserDeletionCommand } from '../../application/commands/request-u
|
|||||||
import { type JwtPayload } from '../../infrastructure/services/token.service';
|
import { type JwtPayload } from '../../infrastructure/services/token.service';
|
||||||
import { CurrentUser } from '../decorators/current-user.decorator';
|
import { CurrentUser } from '../decorators/current-user.decorator';
|
||||||
import { Roles } from '../decorators/roles.decorator';
|
import { Roles } from '../decorators/roles.decorator';
|
||||||
import { type ForceDeleteUserDto } from '../dto/force-delete-user.dto';
|
import { ForceDeleteUserDto } from '../dto/force-delete-user.dto';
|
||||||
import { type RequestDeletionDto } from '../dto/request-deletion.dto';
|
import { RequestDeletionDto } from '../dto/request-deletion.dto';
|
||||||
import { JwtAuthGuard } from '../guards/jwt-auth.guard';
|
import { JwtAuthGuard } from '../guards/jwt-auth.guard';
|
||||||
import { RolesGuard } from '../guards/roles.guard';
|
import { RolesGuard } from '../guards/roles.guard';
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
|
import { Type } from 'class-transformer';
|
||||||
|
import {
|
||||||
|
ArrayMaxSize,
|
||||||
|
ArrayMinSize,
|
||||||
|
IsArray,
|
||||||
|
IsIn,
|
||||||
|
IsString,
|
||||||
|
MinLength,
|
||||||
|
ValidateNested,
|
||||||
|
} from 'class-validator';
|
||||||
|
|
||||||
|
export class KycFileRequestDto {
|
||||||
|
@ApiProperty({
|
||||||
|
enum: ['frontImage', 'backImage', 'selfieImage'],
|
||||||
|
description: 'KYC image field identifier',
|
||||||
|
})
|
||||||
|
@IsIn(['frontImage', 'backImage', 'selfieImage'])
|
||||||
|
field!: 'frontImage' | 'backImage' | 'selfieImage';
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
description: 'MIME type of the file (image/jpeg, image/png, image/webp)',
|
||||||
|
example: 'image/jpeg',
|
||||||
|
})
|
||||||
|
@IsString()
|
||||||
|
@MinLength(1)
|
||||||
|
mimeType!: string;
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
description: 'Original file name',
|
||||||
|
example: 'cccd-front.jpg',
|
||||||
|
})
|
||||||
|
@IsString()
|
||||||
|
@MinLength(1)
|
||||||
|
fileName!: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GenerateKycUploadUrlsDto {
|
||||||
|
@ApiProperty({
|
||||||
|
type: [KycFileRequestDto],
|
||||||
|
description: 'List of KYC files to generate upload URLs for (1-3)',
|
||||||
|
minItems: 1,
|
||||||
|
maxItems: 3,
|
||||||
|
})
|
||||||
|
@IsArray()
|
||||||
|
@ArrayMinSize(1)
|
||||||
|
@ArrayMaxSize(3)
|
||||||
|
@ValidateNested({ each: true })
|
||||||
|
@Type(() => KycFileRequestDto)
|
||||||
|
files!: KycFileRequestDto[];
|
||||||
|
}
|
||||||
41
apps/api/src/modules/auth/presentation/dto/submit-kyc.dto.ts
Normal file
41
apps/api/src/modules/auth/presentation/dto/submit-kyc.dto.ts
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||||
|
import { IsNotEmpty, IsOptional, IsString, IsUrl } from 'class-validator';
|
||||||
|
|
||||||
|
export class SubmitKycDto {
|
||||||
|
@ApiProperty({ example: 'CCCD', description: 'Document type (CCCD, CMND, passport)' })
|
||||||
|
@IsString()
|
||||||
|
@IsNotEmpty({ message: 'Loại giấy tờ không được để trống' })
|
||||||
|
documentType!: string;
|
||||||
|
|
||||||
|
@ApiProperty({ example: '001234567890', description: 'Document number' })
|
||||||
|
@IsString()
|
||||||
|
@IsNotEmpty({ message: 'Số giấy tờ không được để trống' })
|
||||||
|
documentNumber!: string;
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
example: 'https://cdn.goodgo.vn/kyc/front-123.jpg',
|
||||||
|
description: 'Front image presigned URL',
|
||||||
|
})
|
||||||
|
@IsString()
|
||||||
|
@IsUrl({}, { message: 'URL ảnh mặt trước không hợp lệ' })
|
||||||
|
@IsNotEmpty({ message: 'Vui lòng tải ảnh mặt trước giấy tờ' })
|
||||||
|
frontImageUrl!: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({
|
||||||
|
example: 'https://cdn.goodgo.vn/kyc/back-123.jpg',
|
||||||
|
description: 'Back image presigned URL',
|
||||||
|
})
|
||||||
|
@IsOptional()
|
||||||
|
@IsString()
|
||||||
|
@IsUrl({}, { message: 'URL ảnh mặt sau không hợp lệ' })
|
||||||
|
backImageUrl?: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({
|
||||||
|
example: 'https://cdn.goodgo.vn/kyc/selfie-123.jpg',
|
||||||
|
description: 'Selfie image presigned URL',
|
||||||
|
})
|
||||||
|
@IsOptional()
|
||||||
|
@IsString()
|
||||||
|
@IsUrl({}, { message: 'URL ảnh selfie không hợp lệ' })
|
||||||
|
selfieUrl?: string;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable, type CanActivate, type ExecutionContext } from '@nestjs/common';
|
import { Injectable, type CanActivate, type ExecutionContext } from '@nestjs/common';
|
||||||
import { type Reflector } from '@nestjs/core';
|
import { Reflector } from '@nestjs/core';
|
||||||
import { type UserRole } from '@prisma/client';
|
import { type UserRole } from '@prisma/client';
|
||||||
import { type LoggerService } from '@modules/shared';
|
import { LoggerService } from '@modules/shared';
|
||||||
import { ROLES_KEY } from '../decorators/roles.decorator';
|
import { ROLES_KEY } from '../decorators/roles.decorator';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
type IIndustrialListingRepository,
|
type IIndustrialListingRepository,
|
||||||
} from '../../../domain/repositories/industrial-listing.repository';
|
} from '../../../domain/repositories/industrial-listing.repository';
|
||||||
import { type IIndustrialParkRepository, INDUSTRIAL_PARK_REPOSITORY } from '../../../domain/repositories/industrial-park.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';
|
import { CreateIndustrialListingCommand } from './create-industrial-listing.command';
|
||||||
|
|
||||||
@CommandHandler(CreateIndustrialListingCommand)
|
@CommandHandler(CreateIndustrialListingCommand)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
INDUSTRIAL_LISTING_REPOSITORY,
|
INDUSTRIAL_LISTING_REPOSITORY,
|
||||||
type IIndustrialListingRepository,
|
type IIndustrialListingRepository,
|
||||||
} from '../../../domain/repositories/industrial-listing.repository';
|
} 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';
|
import { DeleteIndustrialListingCommand } from './delete-industrial-listing.command';
|
||||||
|
|
||||||
@CommandHandler(DeleteIndustrialListingCommand)
|
@CommandHandler(DeleteIndustrialListingCommand)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
INDUSTRIAL_LISTING_REPOSITORY,
|
INDUSTRIAL_LISTING_REPOSITORY,
|
||||||
type IIndustrialListingRepository,
|
type IIndustrialListingRepository,
|
||||||
} from '../../../domain/repositories/industrial-listing.repository';
|
} 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';
|
import { UpdateIndustrialListingCommand } from './update-industrial-listing.command';
|
||||||
|
|
||||||
@CommandHandler(UpdateIndustrialListingCommand)
|
@CommandHandler(UpdateIndustrialListingCommand)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import type { IndustrialLeaseType, IndustrialListingStatus, IndustrialPropertyType, Prisma } from '@prisma/client';
|
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 { IndustrialListingEntity } from '../../domain/entities/industrial-listing.entity';
|
||||||
import type {
|
import type {
|
||||||
IIndustrialListingRepository,
|
IIndustrialListingRepository,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import type { Prisma } from '@prisma/client';
|
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 { IndustrialParkEntity } from '../../domain/entities/industrial-park.entity';
|
||||||
import type {
|
import type {
|
||||||
IIndustrialParkRepository,
|
IIndustrialParkRepository,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Injectable, type OnModuleInit } from '@nestjs/common';
|
import { Injectable, type OnModuleInit } from '@nestjs/common';
|
||||||
import { type Client as TypesenseClient } from 'typesense';
|
import { type Client as TypesenseClient } from 'typesense';
|
||||||
import { type CollectionCreateSchema } from 'typesense/lib/Typesense/Collections';
|
import { type CollectionCreateSchema } from 'typesense/lib/Typesense/Collections';
|
||||||
import { type TypesenseClientService } from '@modules/search';
|
import { TypesenseClientService } from '@modules/search';
|
||||||
import { type LoggerService, type PrismaService } from '@modules/shared';
|
import { LoggerService, PrismaService } from '@modules/shared';
|
||||||
|
|
||||||
export const INDUSTRIAL_PARKS_COLLECTION = 'industrial_parks';
|
export const INDUSTRIAL_PARKS_COLLECTION = 'industrial_parks';
|
||||||
export const INDUSTRIAL_LISTINGS_COLLECTION = 'industrial_listings';
|
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 { 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 { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||||
import { CurrentUser, JwtAuthGuard, type JwtPayload } from '@modules/auth';
|
import { CurrentUser, JwtAuthGuard, type JwtPayload } from '@modules/auth';
|
||||||
import { NotFoundException } from '@modules/shared';
|
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 { UpdateIndustrialListingCommand } from '../../application/commands/update-industrial-listing/update-industrial-listing.command';
|
||||||
import { GetIndustrialListingQuery } from '../../application/queries/get-industrial-listing/get-industrial-listing.query';
|
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 { ListIndustrialListingsQuery } from '../../application/queries/list-industrial-listings/list-industrial-listings.query';
|
||||||
import { type CreateIndustrialListingDto } from '../dto/create-industrial-listing.dto';
|
import { CreateIndustrialListingDto } from '../dto/create-industrial-listing.dto';
|
||||||
import { type SearchIndustrialListingsDto } from '../dto/search-industrial-listings.dto';
|
import { SearchIndustrialListingsDto } from '../dto/search-industrial-listings.dto';
|
||||||
import { type UpdateIndustrialListingDto } from '../dto/update-industrial-listing.dto';
|
import { UpdateIndustrialListingDto } from '../dto/update-industrial-listing.dto';
|
||||||
|
|
||||||
@ApiTags('industrial-listings')
|
@ApiTags('industrial-listings')
|
||||||
@Controller('industrial')
|
@Controller('industrial')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Body, Controller, Get, Param, Patch, Post, Query, UseGuards } from '@nestjs/common';
|
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 { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||||
import { UserRole } from '@prisma/client';
|
import { UserRole } from '@prisma/client';
|
||||||
import { JwtAuthGuard, Roles, RolesGuard } from '@modules/auth';
|
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 { IndustrialMarketQuery } from '../../application/queries/industrial-market/industrial-market.query';
|
||||||
import { IndustrialParkStatsQuery } from '../../application/queries/industrial-park-stats/industrial-park-stats.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 { ListIndustrialParksQuery } from '../../application/queries/list-industrial-parks/list-industrial-parks.query';
|
||||||
import { type AnalyzeIndustrialLocationDto } from '../dto/analyze-industrial-location.dto';
|
import { AnalyzeIndustrialLocationDto } from '../dto/analyze-industrial-location.dto';
|
||||||
import { type CompareIndustrialParksDto } from '../dto/compare-industrial-parks.dto';
|
import { CompareIndustrialParksDto } from '../dto/compare-industrial-parks.dto';
|
||||||
import { type CreateIndustrialParkDto } from '../dto/create-industrial-park.dto';
|
import { CreateIndustrialParkDto } from '../dto/create-industrial-park.dto';
|
||||||
import { type EstimateIndustrialRentDto } from '../dto/estimate-industrial-rent.dto';
|
import { EstimateIndustrialRentDto } from '../dto/estimate-industrial-rent.dto';
|
||||||
import { type SearchIndustrialParksDto } from '../dto/search-industrial-parks.dto';
|
import { SearchIndustrialParksDto } from '../dto/search-industrial-parks.dto';
|
||||||
import { type UpdateIndustrialParkDto } from '../dto/update-industrial-park.dto';
|
import { UpdateIndustrialParkDto } from '../dto/update-industrial-park.dto';
|
||||||
|
|
||||||
@ApiTags('industrial-parks')
|
@ApiTags('industrial-parks')
|
||||||
@Controller('industrial')
|
@Controller('industrial')
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
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 { createId } from '@paralleldrive/cuid2';
|
||||||
import { DomainException, NotFoundException, type PrismaService, type LoggerService } from '@modules/shared';
|
import { DomainException, NotFoundException, PrismaService, LoggerService } from '@modules/shared';
|
||||||
import { InquiryEntity } from '../../../domain/entities/inquiry.entity';
|
import { InquiryEntity } from '../../../domain/entities/inquiry.entity';
|
||||||
import { INQUIRY_REPOSITORY, type IInquiryRepository } from '../../../domain/repositories/inquiry.repository';
|
import { INQUIRY_REPOSITORY, type IInquiryRepository } from '../../../domain/repositories/inquiry.repository';
|
||||||
import { CreateInquiryCommand } from './create-inquiry.command';
|
import { CreateInquiryCommand } from './create-inquiry.command';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
import { CommandHandler, EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||||
import { DomainException, ForbiddenException, NotFoundException, type PrismaService, type LoggerService } from '@modules/shared';
|
import { DomainException, ForbiddenException, NotFoundException, PrismaService, LoggerService } from '@modules/shared';
|
||||||
import { INQUIRY_REPOSITORY, type IInquiryRepository } from '../../../domain/repositories/inquiry.repository';
|
import { INQUIRY_REPOSITORY, type IInquiryRepository } from '../../../domain/repositories/inquiry.repository';
|
||||||
import { MarkInquiryReadCommand } from './mark-inquiry-read.command';
|
import { MarkInquiryReadCommand } from './mark-inquiry-read.command';
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user