feat(analytics): AVM v2 batch valuation, comparison, history + frontend upgrade
Add batch valuation (POST /analytics/valuation/batch, max 50 properties), valuation comparison (POST /analytics/valuation/compare, 2-5 properties), and history endpoint (GET /analytics/valuation/history/:propertyId) with confidence explanation helper. Frontend: enhanced valuation form with project autocomplete and deep analysis toggle, results with confidence badges and price range visualization, comparables table, history chart, market context card, and PDF export. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const VALUATION_PROPERTY_TYPES = [
|
||||
{ value: 'APARTMENT', label: 'Can ho' },
|
||||
{ value: 'HOUSE', label: 'Nha rieng' },
|
||||
{ value: 'VILLA', label: 'Biet thu' },
|
||||
{ value: 'LAND', label: 'Dat nen' },
|
||||
{ value: 'OFFICE', label: 'Van phong' },
|
||||
{ value: 'APARTMENT', label: 'Căn hộ' },
|
||||
{ value: 'HOUSE', label: 'Nhà riêng' },
|
||||
{ value: 'VILLA', label: 'Biệt thự' },
|
||||
{ value: 'LAND', label: 'Đất nền' },
|
||||
{ value: 'OFFICE', label: 'Văn phòng' },
|
||||
{ value: 'SHOPHOUSE', label: 'Shophouse' },
|
||||
] as const;
|
||||
|
||||
export const CITIES = [
|
||||
{ value: 'Ho Chi Minh', label: 'TP. Ho Chi Minh' },
|
||||
{ value: 'Ha Noi', label: 'Ha Noi' },
|
||||
{ value: 'Da Nang', label: 'Da Nang' },
|
||||
{ value: 'Ho Chi Minh', label: 'TP. Hồ Chí Minh' },
|
||||
{ value: 'Ha Noi', label: 'Hà Nội' },
|
||||
{ value: 'Da Nang', label: 'Đà Nẵng' },
|
||||
] as const;
|
||||
|
||||
export const valuationFormSchema = z.object({
|
||||
propertyType: z.string().min(1, 'Vui long chon loai bat dong san'),
|
||||
area: z.string().min(1, 'Vui long nhap dien tich').refine(
|
||||
propertyType: z.string().min(1, 'Vui lòng chọn loại bất động sản'),
|
||||
area: z.string().min(1, 'Vui lòng nhập diện tích').refine(
|
||||
(val) => !isNaN(Number(val)) && Number(val) > 0,
|
||||
'Dien tich phai lon hon 0',
|
||||
'Diện tích phải lớn hơn 0',
|
||||
),
|
||||
district: z.string().min(1, 'Vui long nhap quan/huyen'),
|
||||
city: z.string().min(1, 'Vui long chon tinh/thanh pho'),
|
||||
district: z.string().min(1, 'Vui lòng nhập quận/huyện'),
|
||||
city: z.string().min(1, 'Vui lòng chọn tỉnh/thành phố'),
|
||||
bedrooms: z.string().optional(),
|
||||
bathrooms: z.string().optional(),
|
||||
floors: z.string().optional(),
|
||||
@@ -30,6 +30,10 @@ export const valuationFormSchema = z.object({
|
||||
roadWidth: z.string().optional(),
|
||||
yearBuilt: z.string().optional(),
|
||||
hasLegalPaper: z.boolean().optional(),
|
||||
/** New fields for enhanced form */
|
||||
projectId: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
deepAnalysis: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export type ValuationFormData = z.infer<typeof valuationFormSchema>;
|
||||
|
||||
Reference in New Issue
Block a user