fix: production readiness — resolve build, lint, and code quality issues
- Fix Next.js build failure: remove duplicate route at (dashboard)/listings/[id] that conflicted with (public)/listings/[id] (same URL path in two route groups) - Fix 772 ESLint errors: auto-fix import ordering (import-x/order), remove unused imports/variables, convert empty interfaces to type aliases, replace require() with ESM imports, fix consistent-type-imports violations - Add CLAUDE.md for developer onboarding documentation - All checks pass: 0 lint errors, typecheck clean, 230 tests passing, build success Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -1,26 +1,16 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { CqrsModule } from '@nestjs/cqrs';
|
||||
|
||||
// Domain
|
||||
import { GenerateReportHandler } from './application/commands/generate-report/generate-report.handler';
|
||||
import { TrackEventHandler } from './application/commands/track-event/track-event.handler';
|
||||
import { UpdateMarketIndexHandler } from './application/commands/update-market-index/update-market-index.handler';
|
||||
import { GetDistrictStatsHandler } from './application/queries/get-district-stats/get-district-stats.handler';
|
||||
import { GetHeatmapHandler } from './application/queries/get-heatmap/get-heatmap.handler';
|
||||
import { GetMarketReportHandler } from './application/queries/get-market-report/get-market-report.handler';
|
||||
import { GetPriceTrendHandler } from './application/queries/get-price-trend/get-price-trend.handler';
|
||||
import { MARKET_INDEX_REPOSITORY } from './domain/repositories/market-index.repository';
|
||||
import { VALUATION_REPOSITORY } from './domain/repositories/valuation.repository';
|
||||
|
||||
// Infrastructure
|
||||
import { PrismaMarketIndexRepository } from './infrastructure/repositories/prisma-market-index.repository';
|
||||
import { PrismaValuationRepository } from './infrastructure/repositories/prisma-valuation.repository';
|
||||
|
||||
// Application — Commands
|
||||
import { TrackEventHandler } from './application/commands/track-event/track-event.handler';
|
||||
import { GenerateReportHandler } from './application/commands/generate-report/generate-report.handler';
|
||||
import { UpdateMarketIndexHandler } from './application/commands/update-market-index/update-market-index.handler';
|
||||
|
||||
// Application — Queries
|
||||
import { GetMarketReportHandler } from './application/queries/get-market-report/get-market-report.handler';
|
||||
import { GetHeatmapHandler } from './application/queries/get-heatmap/get-heatmap.handler';
|
||||
import { GetPriceTrendHandler } from './application/queries/get-price-trend/get-price-trend.handler';
|
||||
import { GetDistrictStatsHandler } from './application/queries/get-district-stats/get-district-stats.handler';
|
||||
|
||||
// Presentation
|
||||
import { AnalyticsController } from './presentation/controllers/analytics.controller';
|
||||
|
||||
const CommandHandlers = [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { GenerateReportHandler } from '../commands/generate-report/generate-report.handler';
|
||||
import { GenerateReportCommand } from '../commands/generate-report/generate-report.command';
|
||||
import { type IMarketIndexRepository, type MarketReportResult } from '../../domain/repositories/market-index.repository';
|
||||
import { GenerateReportCommand } from '../commands/generate-report/generate-report.command';
|
||||
import { GenerateReportHandler } from '../commands/generate-report/generate-report.handler';
|
||||
|
||||
describe('GenerateReportHandler', () => {
|
||||
let handler: GenerateReportHandler;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type CacheService } from '@modules/shared/infrastructure/cache.service';
|
||||
import { type IMarketIndexRepository, type DistrictStatsResult } from '../../domain/repositories/market-index.repository';
|
||||
import { GetDistrictStatsHandler } from '../queries/get-district-stats/get-district-stats.handler';
|
||||
import { GetDistrictStatsQuery } from '../queries/get-district-stats/get-district-stats.query';
|
||||
import { type IMarketIndexRepository, type DistrictStatsResult } from '../../domain/repositories/market-index.repository';
|
||||
import { type CacheService } from '@modules/shared/infrastructure/cache.service';
|
||||
|
||||
describe('GetDistrictStatsHandler', () => {
|
||||
let handler: GetDistrictStatsHandler;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type CacheService } from '@modules/shared/infrastructure/cache.service';
|
||||
import { type IMarketIndexRepository, type HeatmapDataPoint } from '../../domain/repositories/market-index.repository';
|
||||
import { GetHeatmapHandler } from '../queries/get-heatmap/get-heatmap.handler';
|
||||
import { GetHeatmapQuery } from '../queries/get-heatmap/get-heatmap.query';
|
||||
import { type IMarketIndexRepository, type HeatmapDataPoint } from '../../domain/repositories/market-index.repository';
|
||||
import { type CacheService } from '@modules/shared/infrastructure/cache.service';
|
||||
|
||||
describe('GetHeatmapHandler', () => {
|
||||
let handler: GetHeatmapHandler;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type CacheService } from '@modules/shared/infrastructure/cache.service';
|
||||
import { type IMarketIndexRepository, type MarketReportResult } from '../../domain/repositories/market-index.repository';
|
||||
import { GetMarketReportHandler } from '../queries/get-market-report/get-market-report.handler';
|
||||
import { GetMarketReportQuery } from '../queries/get-market-report/get-market-report.query';
|
||||
import { type IMarketIndexRepository, type MarketReportResult } from '../../domain/repositories/market-index.repository';
|
||||
import { type CacheService } from '@modules/shared/infrastructure/cache.service';
|
||||
|
||||
describe('GetMarketReportHandler', () => {
|
||||
let handler: GetMarketReportHandler;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type CacheService } from '@modules/shared/infrastructure/cache.service';
|
||||
import { type IMarketIndexRepository, type PriceTrendPoint } from '../../domain/repositories/market-index.repository';
|
||||
import { GetPriceTrendHandler } from '../queries/get-price-trend/get-price-trend.handler';
|
||||
import { GetPriceTrendQuery } from '../queries/get-price-trend/get-price-trend.query';
|
||||
import { type IMarketIndexRepository, type PriceTrendPoint } from '../../domain/repositories/market-index.repository';
|
||||
import { type CacheService } from '@modules/shared/infrastructure/cache.service';
|
||||
|
||||
describe('GetPriceTrendHandler', () => {
|
||||
let handler: GetPriceTrendHandler;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TrackEventHandler } from '../commands/track-event/track-event.handler';
|
||||
import { TrackEventCommand } from '../commands/track-event/track-event.command';
|
||||
import { TrackEventHandler } from '../commands/track-event/track-event.handler';
|
||||
|
||||
describe('TrackEventHandler', () => {
|
||||
let handler: TrackEventHandler;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { UpdateMarketIndexHandler } from '../commands/update-market-index/update-market-index.handler';
|
||||
import { UpdateMarketIndexCommand } from '../commands/update-market-index/update-market-index.command';
|
||||
import { type IMarketIndexRepository } from '../../domain/repositories/market-index.repository';
|
||||
import { MarketIndexEntity } from '../../domain/entities/market-index.entity';
|
||||
import { type CacheService } from '@modules/shared/infrastructure/cache.service';
|
||||
import { MarketIndexEntity } from '../../domain/entities/market-index.entity';
|
||||
import { type IMarketIndexRepository } from '../../domain/repositories/market-index.repository';
|
||||
import { UpdateMarketIndexCommand } from '../commands/update-market-index/update-market-index.command';
|
||||
import { UpdateMarketIndexHandler } from '../commands/update-market-index/update-market-index.handler';
|
||||
|
||||
function createExistingEntity(): MarketIndexEntity {
|
||||
return new MarketIndexEntity('idx-1', {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { Inject } from '@nestjs/common';
|
||||
import { GenerateReportCommand } from './generate-report.command';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import {
|
||||
MARKET_INDEX_REPOSITORY,
|
||||
type IMarketIndexRepository,
|
||||
type MarketReportResult,
|
||||
} from '../../../domain/repositories/market-index.repository';
|
||||
import { GenerateReportCommand } from './generate-report.command';
|
||||
|
||||
export interface GenerateReportResult {
|
||||
city: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { TrackEventCommand } from './track-event.command';
|
||||
|
||||
export interface TrackEventResult {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { Inject } from '@nestjs/common';
|
||||
import { CacheService, CachePrefix } from '@modules/shared/infrastructure/cache.service';
|
||||
import { UpdateMarketIndexCommand } from './update-market-index.command';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { type CacheService, CachePrefix } from '@modules/shared/infrastructure/cache.service';
|
||||
import { MarketIndexEntity } from '../../../domain/entities/market-index.entity';
|
||||
import {
|
||||
MARKET_INDEX_REPOSITORY,
|
||||
type IMarketIndexRepository,
|
||||
} from '../../../domain/repositories/market-index.repository';
|
||||
import { MarketIndexEntity } from '../../../domain/entities/market-index.entity';
|
||||
import { UpdateMarketIndexCommand } from './update-market-index.command';
|
||||
|
||||
export interface UpdateMarketIndexResult {
|
||||
id: string;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||
import { Inject } from '@nestjs/common';
|
||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||
import { CacheService, CachePrefix, CacheTTL } from '@modules/shared/infrastructure/cache.service';
|
||||
import { GetDistrictStatsQuery } from './get-district-stats.query';
|
||||
import {
|
||||
MARKET_INDEX_REPOSITORY,
|
||||
type IMarketIndexRepository,
|
||||
type DistrictStatsResult,
|
||||
} from '../../../domain/repositories/market-index.repository';
|
||||
import { GetDistrictStatsQuery } from './get-district-stats.query';
|
||||
|
||||
export interface DistrictStatsDto {
|
||||
city: string;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||
import { Inject } from '@nestjs/common';
|
||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||
import { CacheService, CachePrefix, CacheTTL } from '@modules/shared/infrastructure/cache.service';
|
||||
import { GetHeatmapQuery } from './get-heatmap.query';
|
||||
import {
|
||||
MARKET_INDEX_REPOSITORY,
|
||||
type IMarketIndexRepository,
|
||||
type HeatmapDataPoint,
|
||||
} from '../../../domain/repositories/market-index.repository';
|
||||
import { GetHeatmapQuery } from './get-heatmap.query';
|
||||
|
||||
export interface HeatmapDto {
|
||||
city: string;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||
import { Inject } from '@nestjs/common';
|
||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||
import { CacheService, CachePrefix, CacheTTL } from '@modules/shared/infrastructure/cache.service';
|
||||
import { GetMarketReportQuery } from './get-market-report.query';
|
||||
import {
|
||||
MARKET_INDEX_REPOSITORY,
|
||||
type IMarketIndexRepository,
|
||||
type MarketReportResult,
|
||||
} from '../../../domain/repositories/market-index.repository';
|
||||
import { GetMarketReportQuery } from './get-market-report.query';
|
||||
|
||||
export interface MarketReportDto {
|
||||
city: string;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||
import { Inject } from '@nestjs/common';
|
||||
import { QueryHandler, type IQueryHandler } from '@nestjs/cqrs';
|
||||
import { CacheService, CachePrefix, CacheTTL } from '@modules/shared/infrastructure/cache.service';
|
||||
import { GetPriceTrendQuery } from './get-price-trend.query';
|
||||
import {
|
||||
MARKET_INDEX_REPOSITORY,
|
||||
type IMarketIndexRepository,
|
||||
type PriceTrendPoint,
|
||||
} from '../../../domain/repositories/market-index.repository';
|
||||
import { GetPriceTrendQuery } from './get-price-trend.query';
|
||||
|
||||
export interface PriceTrendDto {
|
||||
district: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AggregateRoot } from '@modules/shared/domain/aggregate-root';
|
||||
import { type PropertyType } from '@prisma/client';
|
||||
import { AggregateRoot } from '@modules/shared/domain/aggregate-root';
|
||||
import { MarketIndexUpdatedEvent } from '../events/market-index-updated.event';
|
||||
|
||||
export interface MarketIndexProps {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '@modules/shared/infrastructure/prisma.service';
|
||||
import { type MarketIndex as PrismaMarketIndex, type PropertyType } from '@prisma/client';
|
||||
import { type PrismaService } from '@modules/shared/infrastructure/prisma.service';
|
||||
import { MarketIndexEntity, type MarketIndexProps } from '../../domain/entities/market-index.entity';
|
||||
import {
|
||||
type IMarketIndexRepository,
|
||||
type MarketReportResult,
|
||||
@@ -8,7 +9,6 @@ import {
|
||||
type PriceTrendPoint,
|
||||
type DistrictStatsResult,
|
||||
} from '../../domain/repositories/market-index.repository';
|
||||
import { MarketIndexEntity, type MarketIndexProps } from '../../domain/entities/market-index.entity';
|
||||
|
||||
@Injectable()
|
||||
export class PrismaMarketIndexRepository implements IMarketIndexRepository {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '@modules/shared/infrastructure/prisma.service';
|
||||
import { type Valuation as PrismaValuation } from '@prisma/client';
|
||||
import { type IValuationRepository } from '../../domain/repositories/valuation.repository';
|
||||
import { type PrismaService } from '@modules/shared/infrastructure/prisma.service';
|
||||
import { ValuationEntity, type ValuationProps } from '../../domain/entities/valuation.entity';
|
||||
import { type IValuationRepository } from '../../domain/repositories/valuation.repository';
|
||||
|
||||
@Injectable()
|
||||
export class PrismaValuationRepository implements IValuationRepository {
|
||||
|
||||
@@ -3,20 +3,20 @@ import {
|
||||
Get,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { type QueryBus } from '@nestjs/cqrs';
|
||||
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
|
||||
import { QueryBus } from '@nestjs/cqrs';
|
||||
import { GetMarketReportQuery } from '../../application/queries/get-market-report/get-market-report.query';
|
||||
import { GetHeatmapQuery } from '../../application/queries/get-heatmap/get-heatmap.query';
|
||||
import { GetPriceTrendQuery } from '../../application/queries/get-price-trend/get-price-trend.query';
|
||||
import { GetDistrictStatsQuery } from '../../application/queries/get-district-stats/get-district-stats.query';
|
||||
import { GetMarketReportDto } from '../dto/get-market-report.dto';
|
||||
import { GetHeatmapDto } from '../dto/get-heatmap.dto';
|
||||
import { GetPriceTrendDto } from '../dto/get-price-trend.dto';
|
||||
import { GetDistrictStatsDto } from '../dto/get-district-stats.dto';
|
||||
import { type MarketReportDto } from '../../application/queries/get-market-report/get-market-report.handler';
|
||||
import { type HeatmapDto } from '../../application/queries/get-heatmap/get-heatmap.handler';
|
||||
import { type PriceTrendDto } from '../../application/queries/get-price-trend/get-price-trend.handler';
|
||||
import { type DistrictStatsDto } from '../../application/queries/get-district-stats/get-district-stats.handler';
|
||||
import { GetDistrictStatsQuery } from '../../application/queries/get-district-stats/get-district-stats.query';
|
||||
import { type HeatmapDto } from '../../application/queries/get-heatmap/get-heatmap.handler';
|
||||
import { GetHeatmapQuery } from '../../application/queries/get-heatmap/get-heatmap.query';
|
||||
import { type MarketReportDto } from '../../application/queries/get-market-report/get-market-report.handler';
|
||||
import { GetMarketReportQuery } from '../../application/queries/get-market-report/get-market-report.query';
|
||||
import { type PriceTrendDto } from '../../application/queries/get-price-trend/get-price-trend.handler';
|
||||
import { GetPriceTrendQuery } from '../../application/queries/get-price-trend/get-price-trend.query';
|
||||
import { type GetDistrictStatsDto } from '../dto/get-district-stats.dto';
|
||||
import { type GetHeatmapDto } from '../dto/get-heatmap.dto';
|
||||
import { type GetMarketReportDto } from '../dto/get-market-report.dto';
|
||||
import { type GetPriceTrendDto } from '../dto/get-price-trend.dto';
|
||||
|
||||
@ApiTags('analytics')
|
||||
@Controller('analytics')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString } from 'class-validator';
|
||||
|
||||
export class GetDistrictStatsDto {
|
||||
@ApiProperty({ description: 'City name' })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString } from 'class-validator';
|
||||
|
||||
export class GetHeatmapDto {
|
||||
@ApiProperty({ description: 'City name' })
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsEnum, IsOptional, IsString } from 'class-validator';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { PropertyType } from '@prisma/client';
|
||||
import { IsEnum, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class GetMarketReportDto {
|
||||
@ApiProperty({ description: 'City name' })
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { IsArray, IsEnum, IsString } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { PropertyType } from '@prisma/client';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsArray, IsEnum, IsString } from 'class-validator';
|
||||
|
||||
export class GetPriceTrendDto {
|
||||
@ApiProperty({ description: 'District name' })
|
||||
|
||||
Reference in New Issue
Block a user