import { z } from 'zod';

export const createAgendaSchema = z.object({
  title: z.string().min(1, 'Title is required').max(200),
  shiftId: z.string().optional(),
  pollId: z.string().optional(),
  items: z.array(z.any()).optional().default([]),
});

export const updateAgendaSchema = z.object({
  title: z.string().min(1).max(200).optional(),
  items: z.array(z.any()).optional(),
  status: z.enum(['draft', 'active', 'completed']).optional(),
});

export const createMinutesSchema = z.object({
  agendaId: z.string().min(1, 'Agenda ID is required'),
  notes: z.string().min(1, 'Notes are required'),
  decisions: z.array(z.any()).optional().default([]),
  attendees: z.array(z.any()).optional().default([]),
});

export const updateMinutesSchema = z.object({
  notes: z.string().min(1).optional(),
  decisions: z.array(z.any()).optional(),
  attendees: z.array(z.any()).optional(),
});

export const listAgendasSchema = z.object({
  page: z.coerce.number().int().positive().default(1),
  limit: z.coerce.number().int().positive().max(100).default(20),
  search: z.string().optional(),
  status: z.enum(['draft', 'active', 'completed']).optional(),
});

export type CreateAgendaInput = z.infer<typeof createAgendaSchema>;
export type UpdateAgendaInput = z.infer<typeof updateAgendaSchema>;
export type CreateMinutesInput = z.infer<typeof createMinutesSchema>;
export type UpdateMinutesInput = z.infer<typeof updateMinutesSchema>;
export type ListAgendasInput = z.infer<typeof listAgendasSchema>;
