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

@@ -12,7 +12,7 @@ function createPendingBankTransferPayment(id = 'pay-bt-1'): PaymentEntity {
return payment;
}
function createCompletedBankTransferPayment(): PaymentEntity {
function _createCompletedBankTransferPayment(): PaymentEntity {
const money = Money.create(1_000_000n).unwrap();
const payment = PaymentEntity.createNew('pay-bt-done', 'user-1', 'BANK_TRANSFER', 'SUBSCRIPTION', money);
payment.markProcessing('BT-pay-bt-done');

View File

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

View File

@@ -1,11 +1,11 @@
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 { ConflictException, DomainException, ValidationException, LoggerService } from '@modules/shared';
import { ConflictException, DomainException, ValidationException, type LoggerService } from '@modules/shared';
import { EscrowEntity } from '../../../domain/entities/escrow.entity';
import { OrderEntity } from '../../../domain/entities/order.entity';
import { ESCROW_REPOSITORY, IEscrowRepository } from '../../../domain/repositories/escrow.repository';
import { ORDER_REPOSITORY, IOrderRepository } from '../../../domain/repositories/order.repository';
import { ESCROW_REPOSITORY, type IEscrowRepository } from '../../../domain/repositories/escrow.repository';
import { ORDER_REPOSITORY, type IOrderRepository } from '../../../domain/repositories/order.repository';
import { Money } from '../../../domain/value-objects/money.vo';
import { PlatformFee } from '../../../domain/value-objects/platform-fee.vo';
import { CreateOrderCommand } from './create-order.command';

View File

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

View File

@@ -1,16 +1,16 @@
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 { ConflictException, DomainException, ValidationException, LoggerService } from '@modules/shared';
import { ConflictException, DomainException, ValidationException, type LoggerService } from '@modules/shared';
import { PaymentEntity } from '../../../domain/entities/payment.entity';
import {
PAYMENT_REPOSITORY,
IPaymentRepository,
type IPaymentRepository,
} from '../../../domain/repositories/payment.repository';
import { Money } from '../../../domain/value-objects/money.vo';
import {
PAYMENT_GATEWAY_FACTORY,
IPaymentGatewayFactory,
type IPaymentGatewayFactory,
} from '../../../infrastructure/services/payment-gateway.interface';
import { CreatePaymentCommand } from './create-payment.command';

View File

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

View File

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

View File

@@ -1,13 +1,13 @@
import { Inject, InternalServerErrorException } from '@nestjs/common';
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared';
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
import { DomainException, NotFoundException, ValidationException, type LoggerService } from '@modules/shared';
import {
PAYMENT_REPOSITORY,
IPaymentRepository,
type IPaymentRepository,
} from '../../../domain/repositories/payment.repository';
import {
PAYMENT_GATEWAY_FACTORY,
IPaymentGatewayFactory,
type IPaymentGatewayFactory,
} from '../../../infrastructure/services/payment-gateway.interface';
import { RefundPaymentCommand } from './refund-payment.command';

View File

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

View File

@@ -1,8 +1,8 @@
import { HttpStatus, Inject } from '@nestjs/common';
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { DomainException, ErrorCode } from '@modules/shared';
import { ESCROW_REPOSITORY, IEscrowRepository } from '../../../domain/repositories/escrow.repository';
import { ORDER_REPOSITORY, IOrderRepository } from '../../../domain/repositories/order.repository';
import { ESCROW_REPOSITORY, type IEscrowRepository } from '../../../domain/repositories/escrow.repository';
import { ORDER_REPOSITORY, type IOrderRepository } from '../../../domain/repositories/order.repository';
import { GetOrderStatusQuery } from './get-order-status.query';
export interface OrderStatusDto {

View File

@@ -1,9 +1,9 @@
import { Inject, InternalServerErrorException } from '@nestjs/common';
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { DomainException, ForbiddenException, LoggerService, NotFoundException } from '@modules/shared';
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { DomainException, ForbiddenException, type LoggerService, NotFoundException } from '@modules/shared';
import {
PAYMENT_REPOSITORY,
IPaymentRepository,
type IPaymentRepository,
} from '../../../domain/repositories/payment.repository';
import { GetPaymentStatusQuery } from './get-payment-status.query';

View File

@@ -1,9 +1,9 @@
import { Inject, InternalServerErrorException } from '@nestjs/common';
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { DomainException, LoggerService } from '@modules/shared';
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import { DomainException, type LoggerService } from '@modules/shared';
import {
PAYMENT_REPOSITORY,
IPaymentRepository,
type IPaymentRepository,
} from '../../../domain/repositories/payment.repository';
import { ListTransactionsQuery } from './list-transactions.query';

View File

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