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,7 +1,8 @@
import { ListingStatus, TransactionType } from '@prisma/client';
import { type ListingStatus, type TransactionType } from '@prisma/client';
import { AggregateRoot, ValidationException } from '@modules/shared';
import { ListingApprovedEvent } from '../events/listing-approved.event';
import { ListingCreatedEvent } from '../events/listing-created.event';
import { ListingPriceChangedEvent } from '../events/listing-price-changed.event';
import { ListingSoldEvent } from '../events/listing-sold.event';
import { ListingStatusChangedEvent } from '../events/listing-status-changed.event';
import { ListingUpdatedEvent } from '../events/listing-updated.event';
@@ -208,6 +209,7 @@ export class ListingEntity extends AggregateRoot<string> {
const updatedFields: string[] = [];
if (fields.priceVND !== undefined) {
const oldPriceValue = this._price.amountVND;
const priceResult = Price.create(fields.priceVND);
if (priceResult.isErr) {
throw new ValidationException(priceResult.unwrapErr(), { field: 'priceVND' });
@@ -216,6 +218,9 @@ export class ListingEntity extends AggregateRoot<string> {
if (fields.areaM2 !== undefined) {
this._pricePerM2 = this._price.calculatePerM2(fields.areaM2);
}
if (oldPriceValue !== fields.priceVND) {
this.addDomainEvent(new ListingPriceChangedEvent(this.id, oldPriceValue, fields.priceVND));
}
updatedFields.push('priceVND');
}

View File

@@ -1,7 +1,7 @@
import { PropertyType, Direction } from '@prisma/client';
import { type PropertyType, type Direction } from '@prisma/client';
import { AggregateRoot } from '@modules/shared';
import { Address } from '../value-objects/address.vo';
import { GeoPoint } from '../value-objects/geo-point.vo';
import { type Address } from '../value-objects/address.vo';
import { type GeoPoint } from '../value-objects/geo-point.vo';
export interface PropertyProps {
propertyType: PropertyType;

View File

@@ -1,3 +1,4 @@
export { ListingCreatedEvent } from './listing-created.event';
export { ListingApprovedEvent } from './listing-approved.event';
export { ListingPriceChangedEvent } from './listing-price-changed.event';
export { ListingSoldEvent } from './listing-sold.event';

View File

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

View File

@@ -1,5 +1,5 @@
import { TransactionType } from '@prisma/client';
import { DomainEvent } from '@modules/shared';
import { type TransactionType } from '@prisma/client';
import { type DomainEvent } from '@modules/shared';
export class ListingCreatedEvent implements DomainEvent {
readonly eventName = 'listing.created';

View File

@@ -1,5 +1,5 @@
import { ListingStatus } from '@prisma/client';
import { DomainEvent } from '@modules/shared';
import { type ListingStatus } from '@prisma/client';
import { type DomainEvent } from '@modules/shared';
export class ListingSoldEvent implements DomainEvent {
readonly eventName = 'listing.sold';

View File

@@ -1,5 +1,5 @@
import { ListingStatus } from '@prisma/client';
import { DomainEvent } from '@modules/shared';
import { type ListingStatus } from '@prisma/client';
import { type DomainEvent } from '@modules/shared';
export class ListingStatusChangedEvent implements DomainEvent {
readonly eventName = 'listing.status_changed';

View File

@@ -1,4 +1,4 @@
import { ListingStatus, TransactionType, PropertyType, Direction } from '@prisma/client';
import { type ListingStatus, type TransactionType, type PropertyType, type Direction } from '@prisma/client';
/** Returned by findByIdWithProperty — full listing detail with property, seller, agent */
export interface ListingDetailData {

View File

@@ -1,6 +1,6 @@
import { ListingStatus, TransactionType, PropertyType } from '@prisma/client';
import { ListingEntity } from '../entities/listing.entity';
import { ListingDetailData, ListingSearchItem, ListingSellerItem } from './listing-read.dto';
import { type ListingStatus, type TransactionType, type PropertyType } from '@prisma/client';
import { type ListingEntity } from '../entities/listing.entity';
import { type ListingDetailData, type ListingSearchItem, type ListingSellerItem } from './listing-read.dto';
export const LISTING_REPOSITORY = Symbol('LISTING_REPOSITORY');

View File

@@ -1,5 +1,5 @@
import { PropertyMediaEntity } from '../entities/property-media.entity';
import { PropertyEntity } from '../entities/property.entity';
import { type PropertyMediaEntity } from '../entities/property-media.entity';
import { type PropertyEntity } from '../entities/property.entity';
export const PROPERTY_REPOSITORY = Symbol('PROPERTY_REPOSITORY');

View File

@@ -1,4 +1,4 @@
import { PropertyType } from '@prisma/client';
import { type PropertyType } from '@prisma/client';
export const DUPLICATE_DETECTOR = Symbol('DUPLICATE_DETECTOR');

View File

@@ -1,5 +1,5 @@
import { ListingStatus } from '@prisma/client';
import { ListingEntity } from '../entities/listing.entity';
import { type ListingStatus } from '@prisma/client';
import { type ListingEntity } from '../entities/listing.entity';
export interface ModerationAction {
action: 'approve' | 'reject';

View File

@@ -1,4 +1,4 @@
import { PropertyType } from '@prisma/client';
import { type PropertyType } from '@prisma/client';
export const PRICE_VALIDATOR = Symbol('PRICE_VALIDATOR');