import { z } from 'zod';

export const exportContactsPreviewSchema = z.object({
  cutIds: z.array(z.string()).min(1, 'At least one cut required'),
  outcomes: z.array(z.enum([
    'NOT_HOME', 'REFUSED', 'MOVED', 'ALREADY_VOTED',
    'SPOKE_WITH', 'LEFT_LITERATURE', 'COME_BACK_LATER',
  ])).optional(),
  supportLevelMin: z.number().int().min(1).max(4).optional(),
  supportLevelMax: z.number().int().min(1).max(4).optional(),
  hasEmail: z.boolean().optional(),
  hasSign: z.boolean().optional(),
  visitedSince: z.string().datetime().optional(),
});

export const exportContactsSchema = exportContactsPreviewSchema.extend({
  campaignId: z.string().min(1, 'Campaign ID required'),
});

export type ExportContactsPreviewInput = z.infer<typeof exportContactsPreviewSchema>;
export type ExportContactsInput = z.infer<typeof exportContactsSchema>;
