Files
goodgo-platform/apps/web/lib/validations/valuation.ts
Ho Ngoc Hai 3c6ed4c82a feat(web): add Property Valuation UI with AVM integration
Build the valuation page at /dashboard/valuation with form input,
AI-powered price estimation results, comparable properties display,
and valuation history. Add "Dinh gia AI" button to listing detail
sidebar for quick per-listing estimates.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-09 00:17:12 +07:00

36 lines
1.2 KiB
TypeScript

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: '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' },
] 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(
(val) => !isNaN(Number(val)) && Number(val) > 0,
'Dien tich phai lon hon 0',
),
district: z.string().min(1, 'Vui long nhap quan/huyen'),
city: z.string().min(1, 'Vui long chon tinh/thanh pho'),
bedrooms: z.string().optional(),
bathrooms: z.string().optional(),
floors: z.string().optional(),
frontage: z.string().optional(),
roadWidth: z.string().optional(),
yearBuilt: z.string().optional(),
hasLegalPaper: z.boolean().optional(),
});
export type ValuationFormData = z.infer<typeof valuationFormSchema>;