Files
pablotest/lib/validations.ts
T
2026-08-05 19:40:55 +03:00

30 lines
939 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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>