Files
goodgo-platform/apps/api/src/modules/analytics/domain/services/avm-service.ts
Ho Ngoc Hai cd25d4df2e 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>
2026-04-09 09:41:46 +07:00

40 lines
883 B
TypeScript

import { type PropertyType } from '@prisma/client';
export const AVM_SERVICE = Symbol('AVM_SERVICE');
export interface AVMParams {
propertyId?: string;
latitude?: number;
longitude?: number;
areaM2?: number;
propertyType?: PropertyType;
yearBuilt?: number;
floor?: number;
totalFloors?: number;
}
export interface Comparable {
propertyId: string;
address: string;
district: string;
priceVND: string;
pricePerM2: number;
areaM2: number;
propertyType: PropertyType;
distanceMeters: number;
soldAt: string;
}
export interface ValuationResult {
estimatedPrice: string;
confidence: number;
pricePerM2: number;
comparables: Comparable[];
modelVersion: string;
}
export interface IAVMService {
estimateValue(params: AVMParams): Promise<ValuationResult>;
getComparables(propertyId: string, radiusMeters: number): Promise<Comparable[]>;
}