import { z } from 'zod'

export const ContactSchema = z.object({
  fullName: z.string().min(2, 'Ad soyad en az 2 karakter olmalı'),
  email: z.string().email('Geçerli bir email adresi girin'),
  phone: z.string().optional(),
  message: z.string().min(10, 'Mesaj en az 10 karakter olmalı'),
})

export type ContactInput = z.infer<typeof ContactSchema>

export const UnitSchema = z.object({
  slug: z.string().min(1),
  typeTr: z.string().min(1),
  typeEn: z.string().min(1),
  size: z.number().positive(),
  rooms: z.number().int().positive(),
  bathrooms: z.number().int().positive().default(1),
  floor: z.string().optional(),
  descTr: z.string().optional(),
  descEn: z.string().optional(),
  imageUrl: z.string().optional(),
  planUrl: z.string().optional(),
  featured: z.boolean().default(false),
  available: z.boolean().default(true),
  order: z.number().int().default(0),
})

export type UnitInput = z.infer<typeof UnitSchema>
