feat(analytics): add valuation handler, AVM service, and market index improvements
Add property valuation query handler with AVM (Automated Valuation Model) service integration. Improve market index, heatmap, and price trend handlers with proper dependency injection and error handling. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { PropertyType } from '@prisma/client';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsEnum, IsNumber, IsOptional, IsString, ValidateIf } from 'class-validator';
|
||||
|
||||
export class GetValuationDto {
|
||||
@ApiPropertyOptional({ description: 'Property ID for valuation' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
propertyId?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Latitude (required if no propertyId)' })
|
||||
@ValidateIf((o) => !o.propertyId)
|
||||
@IsNumber()
|
||||
@Transform(({ value }) => (value != null ? parseFloat(value) : undefined))
|
||||
latitude?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Longitude (required if no propertyId)' })
|
||||
@ValidateIf((o) => !o.propertyId)
|
||||
@IsNumber()
|
||||
@Transform(({ value }) => (value != null ? parseFloat(value) : undefined))
|
||||
longitude?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Area in square meters (required if no propertyId)' })
|
||||
@ValidateIf((o) => !o.propertyId)
|
||||
@IsNumber()
|
||||
@Transform(({ value }) => (value != null ? parseFloat(value) : undefined))
|
||||
areaM2?: number;
|
||||
|
||||
@ApiPropertyOptional({ enum: PropertyType, description: 'Property type filter' })
|
||||
@IsOptional()
|
||||
@IsEnum(PropertyType)
|
||||
propertyType?: PropertyType;
|
||||
}
|
||||
@@ -2,3 +2,4 @@ export { GetMarketReportDto } from './get-market-report.dto';
|
||||
export { GetHeatmapDto } from './get-heatmap.dto';
|
||||
export { GetPriceTrendDto } from './get-price-trend.dto';
|
||||
export { GetDistrictStatsDto } from './get-district-stats.dto';
|
||||
export { GetValuationDto } from './get-valuation.dto';
|
||||
|
||||
Reference in New Issue
Block a user