import { z } from "zod";
import { TaskStatus } from "@prisma/client";

export const createEpicSchema = z.object({
  name: z.string().trim().min(1, "Required"),
  description: z.string().optional(),
  workspaceId: z.string().trim().min(1, "Required"),
  projectId: z.string().trim().min(1, "Required"),
  assigneeId: z.string().trim().min(1, "Required"),
  dueDate: z.coerce.date().optional(),
  labels: z.array(z.string()).optional().default([]),
});

export const updateEpicSchema = z.object({
  name: z.string().trim().min(1, "Required").optional(),
  description: z.string().optional(),
  assigneeId: z.string().trim().min(1, "Required").optional(),
  projectId: z.string().trim().min(1, "Required").optional(),
  dueDate: z.coerce.date().optional(),
  labels: z.array(z.string()).optional(),
});

export const getEpicsSchema = z.object({
  workspaceId: z.string(),
  projectId: z.string().optional(),
  assigneeId: z.string().optional(),
  status: z.nativeEnum(TaskStatus).optional(),
  search: z.string().optional(),
  dueDate: z.string().optional(),
}); 