import { z } from "zod"

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

export const makeAndModelFormSchema = z.object({
    make: z.string().min(1, "Make is required"),
    model: z.string().min(1, "Model is required"),
    year: z.string().optional(),
    sub_model: z.string().optional(),
    engine_size: z.string().optional(),
    drivetrain: z.string().optional(),
    shop_type: relationFieldSchema,
    body_type: relationFieldSchema,
    fuel_type: relationFieldSchema,
    transmission: relationFieldSchema,
    is_active: z.boolean().default(true),
})

export type MakeAndModelFormValues = z.infer<typeof makeAndModelFormSchema>
export { relationFieldSchema }
