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

@@ -1,4 +1,4 @@
import { NotificationChannel } from '../../../domain/value-objects/notification-channel.vo';
import { type NotificationChannel } from '../../../domain/value-objects/notification-channel.vo';
export class SendNotificationCommand {
constructor(

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { AgentVerifiedEvent } from '@modules/auth';
import { LoggerService, PrismaService } from '@modules/shared';
import { type AgentVerifiedEvent } from '@modules/auth';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { EmailChangeRequestedEvent } from '@modules/auth';
import { LoggerService } from '@modules/shared';
import { type EmailChangeRequestedEvent } from '@modules/auth';
import { type LoggerService } from '@modules/shared';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { LoggerService, PrismaService } from '@modules/shared';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
export interface InquiryReceivedEvent {

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { ListingApprovedEvent } from '@modules/admin';
import { LoggerService, PrismaService } from '@modules/shared';
import { type ListingApprovedEvent } from '@modules/admin';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { ListingRejectedEvent } from '@modules/admin';
import { LoggerService, PrismaService } from '@modules/shared';
import { type ListingRejectedEvent } from '@modules/admin';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { ListingSoldEvent } from '@modules/listings';
import { LoggerService, PrismaService } from '@modules/shared';
import { type ListingSoldEvent } from '@modules/listings';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { PaymentCompletedEvent } from '@modules/payments';
import { LoggerService, PrismaService } from '@modules/shared';
import { type PaymentCompletedEvent } from '@modules/payments';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { PaymentFailedEvent } from '@modules/payments';
import { LoggerService, PrismaService } from '@modules/shared';
import { type PaymentFailedEvent } from '@modules/payments';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { PaymentRefundedEvent } from '@modules/payments';
import { LoggerService, PrismaService } from '@modules/shared';
import { type PaymentRefundedEvent } from '@modules/payments';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { LoggerService, PrismaService } from '@modules/shared';
import { QuotaExceededEvent } from '@modules/subscriptions';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { type QuotaExceededEvent } from '@modules/subscriptions';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { LoggerService, PrismaService } from '@modules/shared';
import { SubscriptionExpiredEvent } from '@modules/subscriptions';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { type SubscriptionExpiredEvent } from '@modules/subscriptions';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { LoggerService, PrismaService } from '@modules/shared';
import { SubscriptionCancelledEvent } from '@modules/subscriptions';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { type SubscriptionCancelledEvent } from '@modules/subscriptions';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { LoggerService, PrismaService } from '@modules/shared';
import { SubscriptionRenewedEvent } from '@modules/subscriptions';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { type SubscriptionRenewedEvent } from '@modules/subscriptions';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { UserKycUpdatedEvent } from '@modules/auth';
import { LoggerService, PrismaService } from '@modules/shared';
import { type UserKycUpdatedEvent } from '@modules/auth';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { CommandBus } from '@nestjs/cqrs';
import { type CommandBus } from '@nestjs/cqrs';
import { OnEvent } from '@nestjs/event-emitter';
import { UserRegisteredEvent } from '@modules/auth';
import { LoggerService, PrismaService } from '@modules/shared';
import { type UserRegisteredEvent } from '@modules/auth';
import { type LoggerService, type PrismaService } from '@modules/shared';
import { SendNotificationCommand } from '../commands/send-notification/send-notification.command';
@Injectable()

View File

@@ -1,4 +1,4 @@
import { NotificationChannel } from '../value-objects/notification-channel.vo';
import { type NotificationChannel } from '../value-objects/notification-channel.vo';
export interface NotificationPreferenceEntity {
id: string;

View File

@@ -1,4 +1,4 @@
import { NotificationChannel } from '../value-objects/notification-channel.vo';
import { type NotificationChannel } from '../value-objects/notification-channel.vo';
export type NotificationStatus = 'PENDING' | 'SENT' | 'FAILED' | 'DELIVERED';

View File

@@ -1,5 +1,5 @@
import { DomainEvent } from '@modules/shared';
import { NotificationChannel } from '../value-objects/notification-channel.vo';
import { type DomainEvent } from '@modules/shared';
import { type NotificationChannel } from '../value-objects/notification-channel.vo';
export class NotificationSentEvent implements DomainEvent {
readonly eventName = 'notification.sent';

View File

@@ -1,5 +1,5 @@
import { NotificationPreferenceEntity } from '../entities/notification-preference.entity';
import { NotificationChannel } from '../value-objects/notification-channel.vo';
import { type NotificationPreferenceEntity } from '../entities/notification-preference.entity';
import { type NotificationChannel } from '../value-objects/notification-channel.vo';
export const NOTIFICATION_PREFERENCE_REPOSITORY = Symbol('NOTIFICATION_PREFERENCE_REPOSITORY');

View File

@@ -1,5 +1,5 @@
import { NotificationEntity, NotificationStatus } from '../entities/notification.entity';
import { NotificationChannel } from '../value-objects/notification-channel.vo';
import { type NotificationEntity, type NotificationStatus } from '../entities/notification.entity';
import { type NotificationChannel } from '../value-objects/notification-channel.vo';
export const NOTIFICATION_REPOSITORY = Symbol('NOTIFICATION_REPOSITORY');

View File

@@ -1,4 +1,4 @@
import { NotificationChannel as PrismaChannel } from '@prisma/client';
import { type NotificationChannel as PrismaChannel } from '@prisma/client';
export const NotificationChannel = {
EMAIL: 'EMAIL',

View File

@@ -1,2 +1,3 @@
export { NotificationsModule } from './notifications.module';
export { SendNotificationCommand } from './application/commands/send-notification/send-notification.command';
export { NotificationsGateway } from './presentation/gateways/notifications.gateway';

View File

@@ -2,4 +2,7 @@ export { PrismaNotificationRepository } from './repositories/prisma-notification
export { PrismaNotificationPreferenceRepository } from './repositories/prisma-notification-preference.repository';
export { EmailService, type SendEmailDto } from './services/email.service';
export { FcmService, type SendPushDto } from './services/fcm.service';
export { StringeeSmsService, type SendSmsDto, type SendOtpDto } from './services/stringee-sms.service';
export { TemplateService, type RenderedTemplate, type TemplateDefinition } from './services/template.service';
export { ZaloOaService, type SendZaloOaDto, type ZaloOaMessageResult } from './services/zalo-oa.service';
export { getZaloZnsTemplates, type ZaloZnsTemplateConfig } from './services/zalo-zns-templates';

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { PrismaService } from '@modules/shared';
import { NotificationPreferenceEntity } from '../../domain/entities/notification-preference.entity';
import { INotificationPreferenceRepository } from '../../domain/repositories/notification-preference.repository';
import { NotificationChannel } from '../../domain/value-objects/notification-channel.vo';
import { type PrismaService } from '@modules/shared';
import { type NotificationPreferenceEntity } from '../../domain/entities/notification-preference.entity';
import { type INotificationPreferenceRepository } from '../../domain/repositories/notification-preference.repository';
import { type NotificationChannel } from '../../domain/value-objects/notification-channel.vo';
@Injectable()
export class PrismaNotificationPreferenceRepository implements INotificationPreferenceRepository {

View File

@@ -1,9 +1,9 @@
import { Injectable } from '@nestjs/common';
import { Prisma } from '@prisma/client';
import { PrismaService } from '@modules/shared';
import { NotificationEntity, NotificationStatus } from '../../domain/entities/notification.entity';
import { type Prisma } from '@prisma/client';
import { type PrismaService } from '@modules/shared';
import { type NotificationEntity, type NotificationStatus } from '../../domain/entities/notification.entity';
import {
INotificationRepository,
type INotificationRepository,
type CreateNotificationDto,
} from '../../domain/repositories/notification.repository';

View File

@@ -1,6 +1,6 @@
import { Injectable, OnModuleInit } from '@nestjs/common';
import { Injectable, type OnModuleInit } from '@nestjs/common';
import * as nodemailer from 'nodemailer';
import { LoggerService } from '@modules/shared';
import { type LoggerService } from '@modules/shared';
export interface SendEmailDto {
to: string;

View File

@@ -1,4 +1,4 @@
import { Injectable, OnModuleInit } from '@nestjs/common';
import { Injectable, type OnModuleInit } from '@nestjs/common';
import {
apps,
initializeApp,
@@ -6,7 +6,7 @@ import {
messaging,
type ServiceAccount,
} from 'firebase-admin';
import { LoggerService } from '@modules/shared';
import { type LoggerService } from '@modules/shared';
export interface SendPushDto {
token: string;