import { z } from "zod/v4";

export const CreateCustomerRequestSchema = z.object({
  id: z.string().nonempty(),

  reference: z.string().optional(),
  is_company: z.string().toLowerCase().default("true"),
  name: z.string(),
  trade_name: z.string().optional(),
  tin: z.string().optional(),
  default_taxes: z.array(z.string()).default([]),

  street: z.string().optional(),
  street2: z.string().optional(),
  city: z.string().optional(),
  province: z.string().optional(),
  postal_code: z.string().optional(),
  country: z.string().toLowerCase().default("es").optional(),

  email_primary: z.string().optional(),
  email_secondary: z.string().optional(),
  phone_primary: z.string().optional(),
  phone_secondary: z.string().optional(),
  mobile_primary: z.string().optional(),
  mobile_secondary: z.string().optional(),

  fax: z.string().optional(),
  website: z.string().optional(),

  legal_record: z.string().optional(),

  language_code: z.string().toLowerCase().default("es"),
  currency_code: z.string().toUpperCase().default("EUR"),
});

export type CreateCustomerRequestDTO = z.infer<typeof CreateCustomerRequestSchema>;
