fix(lint): enforce consistent-type-imports and fix import ordering across codebase

Auto-fix 862 lint errors: convert value imports used only as types to
`import type`, fix import group ordering in seed.ts and du-an-api.ts,
remove unused imports in auth controller, and clean up stale eslint-disable
comments referencing non-existent rules.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-16 05:13:56 +07:00
parent 86adcf7295
commit c920934fb6
296 changed files with 692 additions and 659 deletions

View File

@@ -8,9 +8,9 @@
* npx tsx scripts/seed-with-auth.ts * npx tsx scripts/seed-with-auth.ts
*/ */
import * as bcrypt from 'bcrypt';
import crypto from 'node:crypto'; import crypto from 'node:crypto';
import { PrismaClient, UserRole, KYCStatus } from '@prisma/client'; import { PrismaClient, UserRole, type KYCStatus } from '@prisma/client';
import * as bcrypt from 'bcrypt';
const prisma = new PrismaClient(); const prisma = new PrismaClient();

View File

@@ -8,6 +8,7 @@ import './instrument';
import { RequestMethod, ValidationPipe } from '@nestjs/common'; import { RequestMethod, ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core'; import { NestFactory } from '@nestjs/core';
import { IoAdapter } from '@nestjs/platform-socket.io';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import cookieParser from 'cookie-parser'; import cookieParser from 'cookie-parser';
import helmet from 'helmet'; import helmet from 'helmet';
@@ -58,6 +59,9 @@ async function bootstrap() {
jsonDocumentUrl: 'api/v1/docs-json', jsonDocumentUrl: 'api/v1/docs-json',
}); });
// ── WebSocket Adapter (Socket.IO) ──
app.useWebSocketAdapter(new IoAdapter(app));
// ── Security Headers (Helmet) ── // ── Security Headers (Helmet) ──
app.use( app.use(
helmet({ helmet({
@@ -68,7 +72,7 @@ async function bootstrap() {
scriptSrc: ["'self'", "'unsafe-inline'", 'https://cdn.jsdelivr.net'], scriptSrc: ["'self'", "'unsafe-inline'", 'https://cdn.jsdelivr.net'],
styleSrc: ["'self'", "'unsafe-inline'", 'https://cdn.jsdelivr.net'], styleSrc: ["'self'", "'unsafe-inline'", 'https://cdn.jsdelivr.net'],
imgSrc: ["'self'", 'data:', 'https:', 'blob:'], imgSrc: ["'self'", 'data:', 'https:', 'blob:'],
connectSrc: ["'self'", 'https://cdn.jsdelivr.net', 'https://api.goodgo.vn'], connectSrc: ["'self'", 'https://cdn.jsdelivr.net', 'https://api.goodgo.vn', 'wss:', 'ws:'],
fontSrc: ["'self'", 'data:'], fontSrc: ["'self'", 'data:'],
objectSrc: ["'none'"], objectSrc: ["'none'"],
frameSrc: ["'none'"], frameSrc: ["'none'"],

View File

@@ -1,8 +1,8 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { PlanTier } from '@prisma/client'; import { type PlanTier } from '@prisma/client';
import { DomainException, NotFoundException, ValidationException, PrismaService, LoggerService } from '@modules/shared'; import { DomainException, NotFoundException, ValidationException, type PrismaService, type LoggerService } from '@modules/shared';
import { SUBSCRIPTION_REPOSITORY, 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';

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { USER_REPOSITORY, IUserRepository } from '@modules/auth'; import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared'; import { DomainException, NotFoundException, ValidationException, type 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';

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { LISTING_REPOSITORY, IListingRepository } from '@modules/listings'; import { LISTING_REPOSITORY, type IListingRepository } from '@modules/listings';
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared'; import { DomainException, NotFoundException, ValidationException, type 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';

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { USER_REPOSITORY, IUserRepository } from '@modules/auth'; import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared'; import { DomainException, NotFoundException, ValidationException, type 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';

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { LISTING_REPOSITORY, IListingRepository } from '@modules/listings'; import { LISTING_REPOSITORY, type IListingRepository } from '@modules/listings';
import { DomainException, ValidationException, LoggerService } from '@modules/shared'; import { DomainException, ValidationException, type 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';

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { USER_REPOSITORY, IUserRepository } from '@modules/auth'; import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared'; import { DomainException, NotFoundException, ValidationException, type 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';

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { LISTING_REPOSITORY, IListingRepository } from '@modules/listings'; import { LISTING_REPOSITORY, type IListingRepository } from '@modules/listings';
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared'; import { DomainException, NotFoundException, ValidationException, type 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';

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { USER_REPOSITORY, IUserRepository } from '@modules/auth'; import { USER_REPOSITORY, type IUserRepository } from '@modules/auth';
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared'; import { DomainException, NotFoundException, ValidationException, type 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';

View File

@@ -1,9 +1,9 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs'; import { type 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 { LoggerService, PrismaService } from '@modules/shared'; import { type LoggerService, type PrismaService } from '@modules/shared';
import { UserBannedEvent } from '../../domain/events/user-banned.event'; import { type UserBannedEvent } from '../../domain/events/user-banned.event';
@Injectable() @Injectable()
export class UserBannedListener { export class UserBannedListener {

View File

@@ -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 { UserDeactivatedEvent } from '@modules/auth'; import { type UserDeactivatedEvent } from '@modules/auth';
import { LoggerService, PrismaService } from '@modules/shared'; import { type LoggerService, type PrismaService } from '@modules/shared';
@Injectable() @Injectable()
export class UserDeactivatedListener { export class UserDeactivatedListener {

View File

@@ -1,9 +1,9 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService } from '@modules/shared'; import { DomainException, type LoggerService } from '@modules/shared';
import { import {
AUDIT_LOG_REPOSITORY, AUDIT_LOG_REPOSITORY,
IAuditLogRepository, type IAuditLogRepository,
type AuditLogListResult, type AuditLogListResult,
} from '../../../domain/repositories/audit-log.repository'; } from '../../../domain/repositories/audit-log.repository';
import { GetAuditLogsQuery } from './get-audit-logs.query'; import { GetAuditLogsQuery } from './get-audit-logs.query';

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService } from '@modules/shared'; import { DomainException, type LoggerService } from '@modules/shared';
import { ADMIN_QUERY_REPOSITORY, IAdminQueryRepository, 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';
@QueryHandler(GetDashboardStatsQuery) @QueryHandler(GetDashboardStatsQuery)

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService } from '@modules/shared'; import { DomainException, type LoggerService } from '@modules/shared';
import { ADMIN_QUERY_REPOSITORY, IAdminQueryRepository, 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';
@QueryHandler(GetKycQueueQuery) @QueryHandler(GetKycQueueQuery)

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService } from '@modules/shared'; import { DomainException, type LoggerService } from '@modules/shared';
import { ADMIN_QUERY_REPOSITORY, IAdminQueryRepository, 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';
@QueryHandler(GetModerationQueueQuery) @QueryHandler(GetModerationQueueQuery)

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService } from '@modules/shared'; import { DomainException, type LoggerService } from '@modules/shared';
import { ADMIN_QUERY_REPOSITORY, IAdminQueryRepository, 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';
@QueryHandler(GetRevenueStatsQuery) @QueryHandler(GetRevenueStatsQuery)

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, NotFoundException, LoggerService } from '@modules/shared'; import { DomainException, NotFoundException, type LoggerService } from '@modules/shared';
import { ADMIN_QUERY_REPOSITORY, IAdminQueryRepository, 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';
@QueryHandler(GetUserDetailQuery) @QueryHandler(GetUserDetailQuery)

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService } from '@modules/shared'; import { DomainException, type LoggerService } from '@modules/shared';
import { ADMIN_QUERY_REPOSITORY, IAdminQueryRepository, 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';
@QueryHandler(GetUsersQuery) @QueryHandler(GetUsersQuery)

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class KycApprovedEvent implements DomainEvent { export class KycApprovedEvent implements DomainEvent {
readonly eventName = 'kyc.approved'; readonly eventName = 'kyc.approved';

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class KycRejectedEvent implements DomainEvent { export class KycRejectedEvent implements DomainEvent {
readonly eventName = 'kyc.rejected'; readonly eventName = 'kyc.rejected';

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class ListingApprovedEvent implements DomainEvent { export class ListingApprovedEvent implements DomainEvent {
readonly eventName = 'listing.approved_by_admin'; readonly eventName = 'listing.approved_by_admin';

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class ListingRejectedEvent implements DomainEvent { export class ListingRejectedEvent implements DomainEvent {
readonly eventName = 'listing.rejected_by_admin'; readonly eventName = 'listing.rejected_by_admin';

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class SubscriptionAdjustedEvent implements DomainEvent { export class SubscriptionAdjustedEvent implements DomainEvent {
readonly eventName = 'subscription.adjusted_by_admin'; readonly eventName = 'subscription.adjusted_by_admin';

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class UserBannedEvent implements DomainEvent { export class UserBannedEvent implements DomainEvent {
readonly eventName = 'user.banned'; readonly eventName = 'user.banned';

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class UserUnbannedEvent implements DomainEvent { export class UserUnbannedEvent implements DomainEvent {
readonly eventName = 'user.unbanned'; readonly eventName = 'user.unbanned';

View File

@@ -1,4 +1,4 @@
import { PrismaService } from '@modules/shared'; import { type PrismaService } from '@modules/shared';
import { import {
type DashboardStats, type DashboardStats,
type RevenueStatsItem, type RevenueStatsItem,

View File

@@ -1,5 +1,5 @@
import { Prisma, UserRole } from '@prisma/client'; import { type Prisma, type UserRole } from '@prisma/client';
import { PrismaService } from '@modules/shared'; import { type PrismaService } from '@modules/shared';
import { import {
type UserListResult, type UserListResult,
type UserDetail, type UserDetail,

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { PrismaService } from '@modules/shared'; import { type PrismaService } from '@modules/shared';
import { import {
IAdminQueryRepository, type IAdminQueryRepository,
type ModerationQueueResult, type ModerationQueueResult,
type DashboardStats, type DashboardStats,
type RevenueStatsItem, type RevenueStatsItem,

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { AdminAction, AuditTargetType, Prisma } from '@prisma/client'; import { type AdminAction, type AuditTargetType, type Prisma } from '@prisma/client';
import { PrismaService } from '@modules/shared'; import { type PrismaService } from '@modules/shared';
import { import {
IAuditLogRepository, type IAuditLogRepository,
type AuditLogEntry, type AuditLogEntry,
type AuditLogListResult, type AuditLogListResult,
type CreateAuditLogInput, type CreateAuditLogInput,

View File

@@ -1,9 +1,9 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService } from '@modules/shared'; import { DomainException, type LoggerService } from '@modules/shared';
import { import {
AGENT_REPOSITORY, AGENT_REPOSITORY,
IAgentRepository, type IAgentRepository,
} from '../../../domain/repositories/agent.repository'; } from '../../../domain/repositories/agent.repository';
import { QualityScoreCalculator } from '../../../domain/services/quality-score.service'; import { QualityScoreCalculator } from '../../../domain/services/quality-score.service';
import { QualityScore } from '../../../domain/value-objects/quality-score.vo'; import { QualityScore } from '../../../domain/value-objects/quality-score.vo';

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs'; import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter'; import { OnEvent } from '@nestjs/event-emitter';
import { LoggerService } from '@modules/shared'; import { type 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()

View File

@@ -1,10 +1,10 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs'; import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { DomainException, NotFoundException, LoggerService } from '@modules/shared'; import { DomainException, NotFoundException, type LoggerService } from '@modules/shared';
import { import {
AGENT_REPOSITORY, AGENT_REPOSITORY,
type AgentDashboardData, type AgentDashboardData,
IAgentRepository, type IAgentRepository,
} from '../../../domain/repositories/agent.repository'; } from '../../../domain/repositories/agent.repository';
import { GetAgentDashboardQuery } from './get-agent-dashboard.query'; import { GetAgentDashboardQuery } from './get-agent-dashboard.query';

View File

@@ -1,10 +1,10 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs'; import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService } from '@modules/shared'; import { DomainException, type LoggerService } from '@modules/shared';
import { import {
AGENT_REPOSITORY, AGENT_REPOSITORY,
type AgentPublicProfileData, type AgentPublicProfileData,
IAgentRepository, type IAgentRepository,
} from '../../../domain/repositories/agent.repository'; } from '../../../domain/repositories/agent.repository';
import { GetAgentPublicProfileQuery } from './get-agent-public-profile.query'; import { GetAgentPublicProfileQuery } from './get-agent-public-profile.query';

View File

@@ -1,6 +1,6 @@
import { AggregateRoot } from '@modules/shared'; import { AggregateRoot } from '@modules/shared';
import { QualityScoreUpdatedEvent } from '../events/quality-score-updated.event'; import { QualityScoreUpdatedEvent } from '../events/quality-score-updated.event';
import { QualityScore } from '../value-objects/quality-score.vo'; import { type QualityScore } from '../value-objects/quality-score.vo';
export interface AgentProps { export interface AgentProps {
userId: string; userId: string;

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class QualityScoreUpdatedEvent implements DomainEvent { export class QualityScoreUpdatedEvent implements DomainEvent {
readonly eventName = 'agent.quality_score_updated'; readonly eventName = 'agent.quality_score_updated';

View File

@@ -1,4 +1,4 @@
import { AgentEntity } from '../entities/agent.entity'; import { type AgentEntity } from '../entities/agent.entity';
export const AGENT_REPOSITORY = Symbol('AGENT_REPOSITORY'); export const AGENT_REPOSITORY = Symbol('AGENT_REPOSITORY');

View File

@@ -1,4 +1,4 @@
import { PrismaService } from '@modules/shared'; import { type PrismaService } from '@modules/shared';
import { import {
type AgentPublicProfileData, type AgentPublicProfileData,
type AgentPublicListingItem, type AgentPublicListingItem,

View File

@@ -1,10 +1,10 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { PrismaService } from '@modules/shared'; import { type PrismaService } from '@modules/shared';
import { AgentEntity } from '../../domain/entities/agent.entity'; import { AgentEntity } from '../../domain/entities/agent.entity';
import { import {
type AgentDashboardData, type AgentDashboardData,
type AgentPublicProfileData, type AgentPublicProfileData,
IAgentRepository, type IAgentRepository,
type QualityScoreInputData, type QualityScoreInputData,
} from '../../domain/repositories/agent.repository'; } from '../../domain/repositories/agent.repository';
import { QualityScore } from '../../domain/value-objects/quality-score.vo'; import { QualityScore } from '../../domain/value-objects/quality-score.vo';

View File

@@ -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 { CommandBus, QueryBus } from '@nestjs/cqrs'; import { type CommandBus, type QueryBus } from '@nestjs/cqrs';
import { import {
ApiBearerAuth, ApiBearerAuth,
ApiOperation, ApiOperation,
@@ -17,7 +17,7 @@ import {
import { RecalculateQualityScoreCommand } from '../../application/commands/recalculate-quality-score/recalculate-quality-score.command'; import { RecalculateQualityScoreCommand } from '../../application/commands/recalculate-quality-score/recalculate-quality-score.command';
import { GetAgentDashboardQuery } from '../../application/queries/get-agent-dashboard/get-agent-dashboard.query'; import { GetAgentDashboardQuery } from '../../application/queries/get-agent-dashboard/get-agent-dashboard.query';
import { GetAgentPublicProfileQuery } from '../../application/queries/get-agent-public-profile/get-agent-public-profile.query'; import { GetAgentPublicProfileQuery } from '../../application/queries/get-agent-public-profile/get-agent-public-profile.query';
import { AgentDashboardData, AgentPublicProfileData } from '../../domain/repositories/agent.repository'; import { type AgentDashboardData, type AgentPublicProfileData } from '../../domain/repositories/agent.repository';
@ApiTags('agents') @ApiTags('agents')
@Controller('agents') @Controller('agents')

View File

@@ -1,4 +1,4 @@
import { PropertyType } from '@prisma/client'; import { type PropertyType } from '@prisma/client';
export class GenerateReportCommand { export class GenerateReportCommand {
constructor( constructor(

View File

@@ -1,9 +1,9 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService } from '@modules/shared'; import { DomainException, type LoggerService } from '@modules/shared';
import { import {
MARKET_INDEX_REPOSITORY, MARKET_INDEX_REPOSITORY,
IMarketIndexRepository, type IMarketIndexRepository,
type MarketReportResult, type MarketReportResult,
} from '../../../domain/repositories/market-index.repository'; } from '../../../domain/repositories/market-index.repository';
import { GenerateReportCommand } from './generate-report.command'; import { GenerateReportCommand } from './generate-report.command';

View File

@@ -1,6 +1,6 @@
import { InternalServerErrorException } from '@nestjs/common'; import { InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService } from '@modules/shared'; import { DomainException, type LoggerService } from '@modules/shared';
import { TrackEventCommand } from './track-event.command'; import { TrackEventCommand } from './track-event.command';
export interface TrackEventResult { export interface TrackEventResult {

View File

@@ -1,4 +1,4 @@
import { PropertyType } from '@prisma/client'; import { type PropertyType } from '@prisma/client';
export class UpdateMarketIndexCommand { export class UpdateMarketIndexCommand {
constructor( constructor(

View File

@@ -1,10 +1,10 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, CacheService, CachePrefix, LoggerService } from '@modules/shared'; import { DomainException, type CacheService, CachePrefix, type 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,
IMarketIndexRepository, type IMarketIndexRepository,
} from '../../../domain/repositories/market-index.repository'; } from '../../../domain/repositories/market-index.repository';
import { UpdateMarketIndexCommand } from './update-market-index.command'; import { UpdateMarketIndexCommand } from './update-market-index.command';

View File

@@ -1,10 +1,10 @@
import { Inject } from '@nestjs/common'; import { Inject } from '@nestjs/common';
import { EventsHandler, IEventHandler, CommandBus } from '@nestjs/cqrs'; import { EventsHandler, type IEventHandler, type CommandBus } from '@nestjs/cqrs';
import { ListingCreatedEvent, ModerateListingCommand } from '@modules/listings'; import { ListingCreatedEvent, ModerateListingCommand } from '@modules/listings';
import { PrismaService, LoggerService } from '@modules/shared'; import { type PrismaService, type LoggerService } from '@modules/shared';
import { import {
AI_SERVICE_CLIENT, AI_SERVICE_CLIENT,
IAiServiceClient, type IAiServiceClient,
} from '../../infrastructure/services/ai-service.client'; } from '../../infrastructure/services/ai-service.client';
const AUTO_REJECT_THRESHOLD = 0.8; const AUTO_REJECT_THRESHOLD = 0.8;

View File

@@ -1,9 +1,9 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, CacheService, CachePrefix, CacheTTL, Cacheable, LoggerService } from '@modules/shared'; import { DomainException, type CacheService, CachePrefix, CacheTTL, Cacheable, type LoggerService } from '@modules/shared';
import { import {
MARKET_INDEX_REPOSITORY, MARKET_INDEX_REPOSITORY,
IMarketIndexRepository, type IMarketIndexRepository,
type DistrictStatsResult, type DistrictStatsResult,
} from '../../../domain/repositories/market-index.repository'; } from '../../../domain/repositories/market-index.repository';
import { GetDistrictStatsQuery } from './get-district-stats.query'; import { GetDistrictStatsQuery } from './get-district-stats.query';

View File

@@ -1,9 +1,9 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, CacheService, CachePrefix, CacheTTL, LoggerService } from '@modules/shared'; import { DomainException, CacheService, CachePrefix, CacheTTL, type LoggerService } from '@modules/shared';
import { import {
MARKET_INDEX_REPOSITORY, MARKET_INDEX_REPOSITORY,
IMarketIndexRepository, type IMarketIndexRepository,
type HeatmapDataPoint, type HeatmapDataPoint,
} from '../../../domain/repositories/market-index.repository'; } from '../../../domain/repositories/market-index.repository';
import { GetHeatmapQuery } from './get-heatmap.query'; import { GetHeatmapQuery } from './get-heatmap.query';

View File

@@ -1,9 +1,9 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, CacheService, CachePrefix, CacheTTL, LoggerService } from '@modules/shared'; import { DomainException, CacheService, CachePrefix, CacheTTL, type LoggerService } from '@modules/shared';
import { import {
MARKET_INDEX_REPOSITORY, MARKET_INDEX_REPOSITORY,
IMarketIndexRepository, type IMarketIndexRepository,
type MarketReportResult, type MarketReportResult,
} from '../../../domain/repositories/market-index.repository'; } from '../../../domain/repositories/market-index.repository';
import { GetMarketReportQuery } from './get-market-report.query'; import { GetMarketReportQuery } from './get-market-report.query';

View File

@@ -1,4 +1,4 @@
import { PropertyType } from '@prisma/client'; import { type PropertyType } from '@prisma/client';
export class GetMarketReportQuery { export class GetMarketReportQuery {
constructor( constructor(

View File

@@ -1,9 +1,9 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, CacheService, CachePrefix, CacheTTL, LoggerService } from '@modules/shared'; import { DomainException, CacheService, CachePrefix, CacheTTL, type LoggerService } from '@modules/shared';
import { import {
MARKET_INDEX_REPOSITORY, MARKET_INDEX_REPOSITORY,
IMarketIndexRepository, type IMarketIndexRepository,
type PriceTrendPoint, type PriceTrendPoint,
} from '../../../domain/repositories/market-index.repository'; } from '../../../domain/repositories/market-index.repository';
import { GetPriceTrendQuery } from './get-price-trend.query'; import { GetPriceTrendQuery } from './get-price-trend.query';

View File

@@ -1,4 +1,4 @@
import { PropertyType } from '@prisma/client'; import { type PropertyType } from '@prisma/client';
export class GetPriceTrendQuery { export class GetPriceTrendQuery {
constructor( constructor(

View File

@@ -1,9 +1,9 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs'; import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
import { DomainException, CacheService, CachePrefix, CacheTTL, LoggerService } from '@modules/shared'; import { DomainException, CacheService, CachePrefix, CacheTTL, type LoggerService } from '@modules/shared';
import { import {
AVM_SERVICE, AVM_SERVICE,
IAVMService, type IAVMService,
type ValuationResult, type ValuationResult,
} from '../../../domain/services/avm-service'; } from '../../../domain/services/avm-service';
import { GetValuationQuery } from './get-valuation.query'; import { GetValuationQuery } from './get-valuation.query';

View File

@@ -1,4 +1,4 @@
import { PropertyType } from '@prisma/client'; import { type PropertyType } from '@prisma/client';
export class GetValuationQuery { export class GetValuationQuery {
constructor( constructor(

View File

@@ -1,4 +1,4 @@
import { PropertyType } from '@prisma/client'; import { type PropertyType } from '@prisma/client';
import { AggregateRoot } from '@modules/shared'; import { AggregateRoot } from '@modules/shared';
import { MarketIndexUpdatedEvent } from '../events/market-index-updated.event'; import { MarketIndexUpdatedEvent } from '../events/market-index-updated.event';

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class MarketIndexUpdatedEvent implements DomainEvent { export class MarketIndexUpdatedEvent implements DomainEvent {
readonly eventName = 'market-index.updated'; readonly eventName = 'market-index.updated';

View File

@@ -1,5 +1,5 @@
import { PropertyType } from '@prisma/client'; import { type PropertyType } from '@prisma/client';
import { MarketIndexEntity } from '../entities/market-index.entity'; import { type MarketIndexEntity } from '../entities/market-index.entity';
export const MARKET_INDEX_REPOSITORY = Symbol('MARKET_INDEX_REPOSITORY'); export const MARKET_INDEX_REPOSITORY = Symbol('MARKET_INDEX_REPOSITORY');

View File

@@ -1,4 +1,4 @@
import { ValuationEntity } from '../entities/valuation.entity'; import { type ValuationEntity } from '../entities/valuation.entity';
export const VALUATION_REPOSITORY = Symbol('VALUATION_REPOSITORY'); export const VALUATION_REPOSITORY = Symbol('VALUATION_REPOSITORY');

View File

@@ -1,9 +1,9 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { MarketIndex as PrismaMarketIndex, PropertyType } from '@prisma/client'; import { type MarketIndex as PrismaMarketIndex, type PropertyType } from '@prisma/client';
import { PrismaService } from '@modules/shared'; import { type PrismaService } from '@modules/shared';
import { MarketIndexEntity, MarketIndexProps } from '../../domain/entities/market-index.entity'; import { MarketIndexEntity, type MarketIndexProps } from '../../domain/entities/market-index.entity';
import { import {
IMarketIndexRepository, type IMarketIndexRepository,
type MarketReportResult, type MarketReportResult,
type HeatmapDataPoint, type HeatmapDataPoint,
type PriceTrendPoint, type PriceTrendPoint,

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { Prisma, Valuation as PrismaValuation } from '@prisma/client'; import { type Prisma, type Valuation as PrismaValuation } from '@prisma/client';
import { PrismaService } from '@modules/shared'; import { type PrismaService } from '@modules/shared';
import { ValuationEntity, ValuationProps } from '../../domain/entities/valuation.entity'; import { ValuationEntity, type ValuationProps } from '../../domain/entities/valuation.entity';
import { IValuationRepository } from '../../domain/repositories/valuation.repository'; import { type IValuationRepository } from '../../domain/repositories/valuation.repository';
@Injectable() @Injectable()
export class PrismaValuationRepository implements IValuationRepository { export class PrismaValuationRepository implements IValuationRepository {

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { LoggerService } from '@modules/shared'; import { type LoggerService } from '@modules/shared';
export interface AiPredictRequest { export interface AiPredictRequest {
area: number; area: number;

View File

@@ -1,5 +1,5 @@
import { PropertyType } from '@prisma/client'; import { type PropertyType } from '@prisma/client';
import { Comparable } from '../../domain/services/avm-service'; import { type Comparable } from '../../domain/services/avm-service';
const DEFAULT_RADIUS_METERS = 2000; const DEFAULT_RADIUS_METERS = 2000;

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs'; import { type 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 { PrismaService, LoggerService } from '@modules/shared'; import { type PrismaService, type 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 {

View File

@@ -1,7 +1,7 @@
import { UserEntity } from '../../domain/entities/user.entity'; import { UserEntity } from '../../domain/entities/user.entity';
import { type IUserRepository } from '../../domain/repositories/user.repository'; import { type IUserRepository } from '../../domain/repositories/user.repository';
import { type HashedPassword } from '../../domain/value-objects/hashed-password.vo';
import { Email } from '../../domain/value-objects/email.vo'; import { Email } from '../../domain/value-objects/email.vo';
import { type 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 { UpdateProfileCommand } from '../commands/update-profile/update-profile.command'; import { UpdateProfileCommand } from '../commands/update-profile/update-profile.command';
import { UpdateProfileHandler } from '../commands/update-profile/update-profile.handler'; import { UpdateProfileHandler } from '../commands/update-profile/update-profile.handler';

View File

@@ -1,7 +1,7 @@
import { UserEntity } from '../../domain/entities/user.entity'; import { UserEntity } from '../../domain/entities/user.entity';
import { type IUserRepository } from '../../domain/repositories/user.repository'; import { type IUserRepository } from '../../domain/repositories/user.repository';
import { type HashedPassword } from '../../domain/value-objects/hashed-password.vo';
import { Email } from '../../domain/value-objects/email.vo'; import { Email } from '../../domain/value-objects/email.vo';
import { type 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 { VerifyEmailChangeCommand } from '../commands/verify-email-change/verify-email-change.command'; import { VerifyEmailChangeCommand } from '../commands/verify-email-change/verify-email-change.command';
import { VerifyEmailChangeHandler } from '../commands/verify-email-change/verify-email-change.handler'; import { VerifyEmailChangeHandler } from '../commands/verify-email-change/verify-email-change.handler';

View File

@@ -1,6 +1,6 @@
import { InternalServerErrorException } from '@nestjs/common'; import { InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { LoggerService, PrismaService, DomainException, NotFoundException, ValidationException } from '@modules/shared'; import { type LoggerService, type 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)

View File

@@ -1,8 +1,8 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService, UnauthorizedException, ValidationException } from '@modules/shared'; import { DomainException, type LoggerService, UnauthorizedException, ValidationException } from '@modules/shared';
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository'; import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
import { MfaService } from '../../../infrastructure/services/mfa.service'; import { type MfaService } from '../../../infrastructure/services/mfa.service';
import { DisableMfaCommand } from './disable-mfa.command'; import { DisableMfaCommand } from './disable-mfa.command';
@CommandHandler(DisableMfaCommand) @CommandHandler(DisableMfaCommand)

View File

@@ -1,6 +1,6 @@
import { InternalServerErrorException } from '@nestjs/common'; import { InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { LoggerService, PrismaService, DomainException, NotFoundException } from '@modules/shared'; import { type LoggerService, type 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 {

View File

@@ -1,7 +1,7 @@
import { InternalServerErrorException } from '@nestjs/common'; import { InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { Prisma } from '@prisma/client'; import { Prisma } from '@prisma/client';
import { LoggerService, PrismaService, DomainException, NotFoundException } from '@modules/shared'; import { type LoggerService, type PrismaService, DomainException, NotFoundException } from '@modules/shared';
import { ForceDeleteUserCommand } from './force-delete-user.command'; import { ForceDeleteUserCommand } from './force-delete-user.command';
@CommandHandler(ForceDeleteUserCommand) @CommandHandler(ForceDeleteUserCommand)

View File

@@ -1,12 +1,12 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { createId } from '@paralleldrive/cuid2'; import { createId } from '@paralleldrive/cuid2';
import { LoggerService, DomainException } from '@modules/shared'; import { type LoggerService, DomainException } from '@modules/shared';
import { import {
MFA_CHALLENGE_REPOSITORY, MFA_CHALLENGE_REPOSITORY,
IMfaChallengeRepository, type IMfaChallengeRepository,
} from '../../../domain/repositories/mfa-challenge.repository'; } from '../../../domain/repositories/mfa-challenge.repository';
import { TokenService, TokenPair } from '../../../infrastructure/services/token.service'; import { type 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;

View File

@@ -1,6 +1,6 @@
import { InternalServerErrorException } from '@nestjs/common'; import { InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, CommandBus, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type CommandBus, type ICommandHandler } from '@nestjs/cqrs';
import { LoggerService, PrismaService, DomainException } from '@modules/shared'; import { type LoggerService, type 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';

View File

@@ -1,8 +1,8 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { LoggerService, DomainException, UnauthorizedException } from '@modules/shared'; import { type LoggerService, DomainException, UnauthorizedException } from '@modules/shared';
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository'; import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
import { TokenService, TokenPair } from '../../../infrastructure/services/token.service'; import { type TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
import { RefreshTokenCommand } from './refresh-token.command'; import { RefreshTokenCommand } from './refresh-token.command';
@CommandHandler(RefreshTokenCommand) @CommandHandler(RefreshTokenCommand)

View File

@@ -1,13 +1,13 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
import { createId } from '@paralleldrive/cuid2'; import { createId } from '@paralleldrive/cuid2';
import { ConflictException, DomainException, LoggerService, ValidationException } from '@modules/shared'; import { ConflictException, DomainException, type LoggerService, ValidationException } from '@modules/shared';
import { UserEntity } from '../../../domain/entities/user.entity'; import { UserEntity } from '../../../domain/entities/user.entity';
import { USER_REPOSITORY, 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 { TokenService, TokenPair } from '../../../infrastructure/services/token.service'; import { type TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
import { RegisterUserCommand } from './register-user.command'; import { RegisterUserCommand } from './register-user.command';
@CommandHandler(RegisterUserCommand) @CommandHandler(RegisterUserCommand)

View File

@@ -1,6 +1,6 @@
import { InternalServerErrorException } from '@nestjs/common'; import { InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { LoggerService, PrismaService, DomainException, NotFoundException, ValidationException } from '@modules/shared'; import { type LoggerService, type 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;

View File

@@ -1,8 +1,8 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService, ValidationException } from '@modules/shared'; import { DomainException, type LoggerService, ValidationException } from '@modules/shared';
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository'; import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
import { MfaService, MfaSetupResult } from '../../../infrastructure/services/mfa.service'; import { type 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 {

View File

@@ -1,17 +1,17 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { import {
CachePrefix, CachePrefix,
CacheService, CacheService,
ConflictException, ConflictException,
DomainException, DomainException,
LoggerService, type LoggerService,
NotFoundException, NotFoundException,
RedisService, type RedisService,
ValidationException, ValidationException,
} from '@modules/shared'; } from '@modules/shared';
import { type IUserRepository, USER_REPOSITORY } from '../../../domain/repositories/user.repository';
import { Email } from '../../../domain/value-objects/email.vo'; import { Email } from '../../../domain/value-objects/email.vo';
import { IUserRepository, USER_REPOSITORY } from '../../../domain/repositories/user.repository';
import { EMAIL_CHANGE_OTP_PREFIX } from '../update-profile/update-profile.handler'; import { EMAIL_CHANGE_OTP_PREFIX } from '../update-profile/update-profile.handler';
import { VerifyEmailChangeCommand } from './verify-email-change.command'; import { VerifyEmailChangeCommand } from './verify-email-change.command';

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService, NotFoundException, CacheService, CachePrefix } from '@modules/shared'; import { DomainException, type LoggerService, NotFoundException, CacheService, CachePrefix } from '@modules/shared';
import { USER_REPOSITORY, 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';
@CommandHandler(VerifyKycCommand) @CommandHandler(VerifyKycCommand)

View File

@@ -1,8 +1,8 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService, ValidationException } from '@modules/shared'; import { DomainException, type LoggerService, ValidationException } from '@modules/shared';
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository'; import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
import { MfaService } from '../../../infrastructure/services/mfa.service'; import { type 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 {

View File

@@ -1,6 +1,6 @@
import { Injectable, InternalServerErrorException } from '@nestjs/common'; import { Injectable, InternalServerErrorException } from '@nestjs/common';
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs'; import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { PrismaService, DomainException, LoggerService } from '@modules/shared'; import { type PrismaService, DomainException, type 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 {

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs'; import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService, ValidationException } from '@modules/shared'; import { DomainException, type LoggerService, ValidationException } from '@modules/shared';
import { USER_REPOSITORY, 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';
export interface MfaStatusDto { export interface MfaStatusDto {

View File

@@ -1,7 +1,7 @@
import { Inject, InternalServerErrorException } from '@nestjs/common'; import { Inject, InternalServerErrorException } from '@nestjs/common';
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs'; import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService, NotFoundException, CacheService, CachePrefix, CacheTTL } from '@modules/shared'; import { DomainException, type LoggerService, NotFoundException, CacheService, CachePrefix, CacheTTL } from '@modules/shared';
import { USER_REPOSITORY, 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';
export interface UserProfileDto { export interface UserProfileDto {

View File

@@ -11,13 +11,13 @@ import { CancelUserDeletionHandler } from './application/commands/cancel-user-de
import { DisableMfaHandler } from './application/commands/disable-mfa/disable-mfa.handler'; import { DisableMfaHandler } from './application/commands/disable-mfa/disable-mfa.handler';
import { ExportUserDataHandler } from './application/commands/export-user-data/export-user-data.handler'; import { ExportUserDataHandler } from './application/commands/export-user-data/export-user-data.handler';
import { ForceDeleteUserHandler } from './application/commands/force-delete-user/force-delete-user.handler'; import { ForceDeleteUserHandler } from './application/commands/force-delete-user/force-delete-user.handler';
import { GenerateKycUploadUrlsHandler } from './application/commands/generate-kyc-upload-urls/generate-kyc-upload-urls.handler';
import { LoginUserHandler } from './application/commands/login-user/login-user.handler'; import { LoginUserHandler } from './application/commands/login-user/login-user.handler';
import { ProcessScheduledDeletionsHandler } from './application/commands/process-scheduled-deletions/process-scheduled-deletions.handler'; import { ProcessScheduledDeletionsHandler } from './application/commands/process-scheduled-deletions/process-scheduled-deletions.handler';
import { RefreshTokenHandler } from './application/commands/refresh-token/refresh-token.handler'; import { RefreshTokenHandler } from './application/commands/refresh-token/refresh-token.handler';
import { RegisterUserHandler } from './application/commands/register-user/register-user.handler'; import { RegisterUserHandler } from './application/commands/register-user/register-user.handler';
import { RequestUserDeletionHandler } from './application/commands/request-user-deletion/request-user-deletion.handler'; import { RequestUserDeletionHandler } from './application/commands/request-user-deletion/request-user-deletion.handler';
import { SetupMfaHandler } from './application/commands/setup-mfa/setup-mfa.handler'; import { SetupMfaHandler } from './application/commands/setup-mfa/setup-mfa.handler';
import { GenerateKycUploadUrlsHandler } from './application/commands/generate-kyc-upload-urls/generate-kyc-upload-urls.handler';
import { SubmitKycHandler } from './application/commands/submit-kyc/submit-kyc.handler'; import { SubmitKycHandler } from './application/commands/submit-kyc/submit-kyc.handler';
import { UpdateProfileHandler } from './application/commands/update-profile/update-profile.handler'; import { UpdateProfileHandler } from './application/commands/update-profile/update-profile.handler';
import { UseBackupCodeHandler } from './application/commands/use-backup-code/use-backup-code.handler'; import { UseBackupCodeHandler } from './application/commands/use-backup-code/use-backup-code.handler';

View File

@@ -1,11 +1,11 @@
import { UserRole, type KYCStatus } from '@prisma/client'; import { type UserRole, type KYCStatus } from '@prisma/client';
import { AggregateRoot } from '@modules/shared'; import { AggregateRoot } from '@modules/shared';
import { UserDeactivatedEvent } from '../events/user-deactivated.event'; import { UserDeactivatedEvent } from '../events/user-deactivated.event';
import { UserKycUpdatedEvent } from '../events/user-kyc-updated.event'; import { UserKycUpdatedEvent } from '../events/user-kyc-updated.event';
import { UserRegisteredEvent } from '../events/user-registered.event'; import { UserRegisteredEvent } from '../events/user-registered.event';
import { Email } from '../value-objects/email.vo'; import { type Email } from '../value-objects/email.vo';
import { HashedPassword } from '../value-objects/hashed-password.vo'; import { type HashedPassword } from '../value-objects/hashed-password.vo';
import { Phone } from '../value-objects/phone.vo'; import { type Phone } from '../value-objects/phone.vo';
export interface UserProps { export interface UserProps {
email: Email | null; email: Email | null;

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class AgentVerifiedEvent implements DomainEvent { export class AgentVerifiedEvent implements DomainEvent {
readonly eventName = 'agent.verified'; readonly eventName = 'agent.verified';

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class EmailChangeRequestedEvent implements DomainEvent { export class EmailChangeRequestedEvent implements DomainEvent {
readonly eventName = 'user.email_change_requested'; readonly eventName = 'user.email_change_requested';

View File

@@ -1,4 +1,4 @@
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class UserDeactivatedEvent implements DomainEvent { export class UserDeactivatedEvent implements DomainEvent {
readonly eventName = 'user.deactivated'; readonly eventName = 'user.deactivated';

View File

@@ -1,5 +1,5 @@
import { type KYCStatus } from '@prisma/client'; import { type KYCStatus } from '@prisma/client';
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class UserKycUpdatedEvent implements DomainEvent { export class UserKycUpdatedEvent implements DomainEvent {
readonly eventName = 'user.kyc_updated'; readonly eventName = 'user.kyc_updated';

View File

@@ -1,5 +1,5 @@
import { UserRole } from '@prisma/client'; import { type UserRole } from '@prisma/client';
import { DomainEvent } from '@modules/shared'; import { type DomainEvent } from '@modules/shared';
export class UserRegisteredEvent implements DomainEvent { export class UserRegisteredEvent implements DomainEvent {
readonly eventName = 'user.registered'; readonly eventName = 'user.registered';

View File

@@ -1,4 +1,4 @@
import { UserEntity } from '../entities/user.entity'; import { type UserEntity } from '../entities/user.entity';
export const USER_REPOSITORY = Symbol('USER_REPOSITORY'); export const USER_REPOSITORY = Symbol('USER_REPOSITORY');

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { PrismaService } from '@modules/shared'; import { type PrismaService } from '@modules/shared';
import { import {
IMfaChallengeRepository, type IMfaChallengeRepository,
type MfaChallengeRecord, type MfaChallengeRecord,
} from '../../domain/repositories/mfa-challenge.repository'; } from '../../domain/repositories/mfa-challenge.repository';

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { PrismaService } from '@modules/shared'; import { type PrismaService } from '@modules/shared';
import { import {
IRefreshTokenRepository, type IRefreshTokenRepository,
type RefreshTokenRecord, type RefreshTokenRecord,
} from '../../domain/repositories/refresh-token.repository'; } from '../../domain/repositories/refresh-token.repository';

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { Prisma, User as PrismaUser } from '@prisma/client'; import { type Prisma, type User as PrismaUser } from '@prisma/client';
import { PrismaService } from '@modules/shared'; import { type PrismaService } from '@modules/shared';
import { UserEntity, UserProps } from '../../domain/entities/user.entity'; import { UserEntity, type UserProps } from '../../domain/entities/user.entity';
import { 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';
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';

View File

@@ -1,9 +1,9 @@
import { randomBytes, createHash } from 'crypto'; import { randomBytes, createHash } from 'crypto';
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt'; import { type JwtService } from '@nestjs/jwt';
import { import {
REFRESH_TOKEN_REPOSITORY, REFRESH_TOKEN_REPOSITORY,
IRefreshTokenRepository, type IRefreshTokenRepository,
} from '../../domain/repositories/refresh-token.repository'; } from '../../domain/repositories/refresh-token.repository';
export interface JwtPayload { export interface JwtPayload {

View File

@@ -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, Profile, VerifyCallback } from 'passport-google-oauth20'; import { Strategy, type Profile, type VerifyCallback } from 'passport-google-oauth20';
import { OAuthService, type OAuthUserProfile } from '../services/oauth.service'; import { type OAuthService, type OAuthUserProfile } from '../services/oauth.service';
@Injectable() @Injectable()
export class GoogleOAuthStrategy extends PassportStrategy(Strategy, 'google') { export class GoogleOAuthStrategy extends PassportStrategy(Strategy, 'google') {

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport'; import { PassportStrategy } from '@nestjs/passport';
import { Request } from 'express'; import { type Request } from 'express';
import { ExtractJwt, Strategy } from 'passport-jwt'; import { ExtractJwt, Strategy } from 'passport-jwt';
import { JwtPayload } from '../services/token.service'; import { type JwtPayload } from '../services/token.service';
function extractJwtFromCookieOrHeader(req: Request): string | null { function extractJwtFromCookieOrHeader(req: Request): string | null {
const cookieToken = req.cookies?.['access_token'] as string | undefined; const cookieToken = req.cookies?.['access_token'] as string | undefined;

View File

@@ -2,7 +2,7 @@ import { Inject, Injectable, Logger } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport'; import { PassportStrategy } from '@nestjs/passport';
import { Strategy } from 'passport-local'; import { Strategy } from 'passport-local';
import { DomainException, normalizeVietnamPhone, UnauthorizedException } from '@modules/shared'; import { DomainException, normalizeVietnamPhone, UnauthorizedException } from '@modules/shared';
import { USER_REPOSITORY, IUserRepository } from '../../domain/repositories/user.repository'; import { USER_REPOSITORY, type IUserRepository } from '../../domain/repositories/user.repository';
export interface LocalStrategyResult { export interface LocalStrategyResult {
id: string; id: string;

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { LoggerService } from '@modules/shared'; import { type LoggerService } from '@modules/shared';
import { OAuthService, type OAuthUserProfile } from '../services/oauth.service'; import { type OAuthService, type OAuthUserProfile } from '../services/oauth.service';
import { TokenPair } from '../services/token.service'; import { type TokenPair } from '../services/token.service';
/** /**
* Zalo OAuth2 integration. * Zalo OAuth2 integration.

View File

@@ -8,10 +8,10 @@ import {
} from '@nestjs/common'; } from '@nestjs/common';
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger'; import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
import { Throttle } from '@nestjs/throttler'; import { Throttle } from '@nestjs/throttler';
import { Request, Response } from 'express'; import { type Request, type Response } from 'express';
import { UnauthorizedException } from '@modules/shared'; import { UnauthorizedException } from '@modules/shared';
import { TokenPair } from '../../infrastructure/services/token.service'; import { type TokenPair } from '../../infrastructure/services/token.service';
import { ZaloOAuthStrategy } from '../../infrastructure/strategies/zalo-oauth.strategy'; import { type 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';

View File

@@ -1,5 +1,5 @@
import { createParamDecorator, ExecutionContext } from '@nestjs/common'; import { createParamDecorator, type ExecutionContext } from '@nestjs/common';
import { JwtPayload } from '../../infrastructure/services/token.service'; import { type JwtPayload } from '../../infrastructure/services/token.service';
export const CurrentUser = createParamDecorator( export const CurrentUser = createParamDecorator(
(_data: unknown, ctx: ExecutionContext): JwtPayload => { (_data: unknown, ctx: ExecutionContext): JwtPayload => {

View File

@@ -1,5 +1,5 @@
import { SetMetadata } from '@nestjs/common'; import { SetMetadata } from '@nestjs/common';
import { UserRole } from '@prisma/client'; import { type UserRole } from '@prisma/client';
export const ROLES_KEY = 'roles'; export const ROLES_KEY = 'roles';
export const Roles = (...roles: UserRole[]) => SetMetadata(ROLES_KEY, roles); export const Roles = (...roles: UserRole[]) => SetMetadata(ROLES_KEY, roles);

Some files were not shown because too many files have changed in this diff Show More