import { z } from "zod";

export const parsedEventRowSchema = z.object({
  primary_country_code: z
    .string()
    .trim()
    .min(2, "primary_country_code is required")
    .max(8)
    .transform((value) => value.toUpperCase()),
  approved_document_name: z.string().trim().min(1).max(400),
  sent_email_name: z
    .string()
    .trim()
    .min(1, "sent_email_name is required")
    .max(140),
  brand: z.string().trim().min(1).max(200).optional(),
  last_open: z.string().datetime().nullable(),
  opened: z.number().int().min(0),
  total_opens: z.number().int().min(0),
  last_click: z.string().datetime().nullable(),
  clicked: z.number().int().min(0),
  total_clicks: z.number().int().min(0),
  sent_date: z.string().datetime().nullable(),
  source_row_number: z.number().int().positive(),
  source_sheet_name: z.string().trim().min(1).optional(),
});
