import { z } from 'zod';

export const nominateSchema = z.object({
  userId: z.string().cuid(),
  headline: z.string().max(200).optional(),
  story: z.string().max(2000).optional(),
});

export const updateSpotlightSchema = z.object({
  headline: z.string().max(200).optional(),
  story: z.string().max(2000).optional(),
});

export const featureSchema = z.object({
  month: z.string().regex(/^\d{4}-\d{2}$/, 'Month must be in YYYY-MM format'),
});

export const listSpotlightsSchema = z.object({
  page: z.coerce.number().int().min(1).default(1),
  limit: z.coerce.number().int().min(1).max(100).default(20),
  status: z.enum(['NOMINATED', 'APPROVED', 'FEATURED', 'ARCHIVED']).optional(),
});

export type NominateInput = z.infer<typeof nominateSchema>;
export type UpdateSpotlightInput = z.infer<typeof updateSpotlightSchema>;
export type FeatureInput = z.infer<typeof featureSchema>;
export type ListSpotlightsInput = z.infer<typeof listSpotlightsSchema>;
