import { z } from "zod";

import { PriorityStatus } from "@/constants/priorityStatusEnum";
import { TodoStatus } from "@/constants/todoStatusEnum";

export const todoSchema = z.object({
  id: z.string().optional(),
  title: z.string().trim().min(1, "Title is required"),
  task: z.string().trim().min(1, "Task is required"),
  priority: z.enum(PriorityStatus),
  status: z.enum(TodoStatus),
  dueDate: z.coerce.date(),
  assigneeIds: z
    .array(z.string())
    .min(1, "Assign at least one admin or manager"),
  userId: z.string().optional(), // Optional: specific user this todo is assigned to
});

export type TodoFormValues = z.input<typeof todoSchema>;
