import { z } from "zod";

export const propertySchema = z.object({
  title: z.string().min(3, "En az 3 karakter").max(255),
  description: z.string().max(16000).optional(),
  propertyType: z.enum(["daire", "villa", "arsa", "dukkan", "ofis", "depo"]),
  listingType: z.enum(["satilik", "kiralik"]),
  status: z.enum(["aktif", "rezerve", "pasif", "satildi", "kiralandit"]).default("aktif"),
  price: z.coerce.number().min(0, "Geçerli bir fiyat girin"),
  currency: z.string().max(3).default("TRY"),
  roomCount: z.string().max(10).optional(),
  grossM2: z.coerce.number().min(0).optional().nullable(),
  netM2: z.coerce.number().min(0).optional().nullable(),
  floor: z.coerce.number().optional().nullable(),
  totalFloors: z.coerce.number().optional().nullable(),
  buildingAge: z.coerce.number().min(0).optional().nullable(),
  city: z.string().min(1, "Şehir zorunlu").max(100),
  district: z.string().max(100).optional(),
  neighborhood: z.string().max(100).optional(),
  address: z.string().max(500).optional(),
  mapLat: z.coerce.number().optional().nullable(),
  mapLng: z.coerce.number().optional().nullable(),
  featuresJson: z.string().max(2000).optional(),
  imageIds: z.string().max(2000).optional(),
  assigneeId: z.string().max(36).optional(),
});

export type PropertyFormValues = z.infer<typeof propertySchema>;
