import { z } from 'zod';

export const createContactListSchema = z.object({
  name: z.string().min(1).max(200),
});

export const updateContactListSchema = z.object({
  name: z.string().min(1).max(200).optional(),
});

export const createContactEntrySchema = z.object({
  phone: z.string().min(7).max(20),
  name: z.string().max(200).optional(),
  email: z.string().email().max(200).optional(),
  customFields: z.record(z.string()).optional(),
});

export const bulkAddEntriesSchema = z.object({
  entries: z.array(z.object({
    phone: z.string().min(7).max(20),
    name: z.string().max(200).optional(),
    email: z.string().email().max(200).optional(),
  })).min(1).max(1000),
});

export type CreateContactListInput = z.infer<typeof createContactListSchema>;
export type UpdateContactListInput = z.infer<typeof updateContactListSchema>;
export type CreateContactEntryInput = z.infer<typeof createContactEntrySchema>;
export type BulkAddEntriesInput = z.infer<typeof bulkAddEntriesSchema>;
