import { z } from "zod"

export const relationFieldSchema = z
    .object({ value: z.string(), label: z.string() })
    .nullable()

export const settingsFormSchema = z.object({
    name: z.string().min(1, "Name is required"),
    email: z.union([z.string().email("Invalid email address"), z.literal("")]).optional(),
    phone: z.string().optional(),
    alternative_phone: z.string().optional(),
    website: z.string().optional(),
    time_zone: z.string().optional(),
    upi_id: z.string().optional(),
    first_day_of_work: z.string().optional(),
    latitude: z.string().optional(),
    longitude: z.string().optional(),
    bank_details: z.string().optional(),
    first_address_line: z.string().optional(),
    second_address_line: z.string().optional(),
    country: relationFieldSchema,
    state: relationFieldSchema,
    city: z.string().optional(),
    zip_code: z.string().optional(),
    description: z.string().optional(),
    security: z.string().optional(),
    privacy_policy: z.string().optional(),
})

export type SettingsFormValues = z.infer<typeof settingsFormSchema>
