import { z } from "zod";

const phoneSchema = z
  .string()
  .min(6, "Phone number is too short")
  .max(20, "Phone number is too long")
  .regex(/^\+?[1-9]\d{1,14}$/, "Invalid international phone number");

export const contactSchema = z.object({
  firstName: z.string().min(3, "First name must be at least 3 characters long"),
  lastName: z.string().min(3, "Last name must be at least 3 characters long"),
  companyName: z
    .string()
    .min(3, "Company name must be at least 3 characters long"),
  address: z.string().min(3, "Address must be at least 3 characters long"),
  email: z.email("Invalid email address"),
  phone: phoneSchema,
  industry: z.string().min(1, "Industry is required"),
  notes: z.string().optional(),
  subscribe: z.boolean(),
});
