import { z } from "zod";

export const taskSchema = z.object({
  title: z.string().trim().min(1, "Başlık zorunlu.").max(255),
  description: z
    .string()
    .trim()
    .max(5000)
    .optional()
    .transform((v) => (v ? v : undefined)),
  status: z.enum(["backlog", "todo", "in_progress", "done"]).optional().default("todo"),
  priority: z.enum(["low", "medium", "high", "urgent"]).optional().default("medium"),
  dueDate: z.string().optional().transform((v) => (v ? v : undefined)),
  assigneeId: z.string().optional().transform((v) => (v ? v : undefined)),
  customerId: z.string().optional().transform((v) => (v ? v : undefined)),
});

export type TaskInput = z.infer<typeof taskSchema>;
