import { z } from "zod"

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

export const taskFormSchema = z.object({
    subject: z.string().min(1, "Subject is required"),
    description: z.string().optional(),
    task_type: relationFieldSchema,
    task_section: relationFieldSchema,
    owner: relationFieldSchema,
    department: relationFieldSchema,
    priority: z.string().optional(),
    due_date: z.string().optional(),
    status: z.string().optional(),
    job_card: relationFieldSchema,
})

export type TaskFormValues = z.infer<typeof taskFormSchema>
