import {
  IsBoolean,
  IsEmail,
  IsEnum,
  IsNumber,
  IsOptional,
  IsString,
  MinLength,
} from "class-validator";
import { Currency } from "@jorgecuadros/database";

/** Same editable fields as create, all optional. */
export class UpdateCustomerDto {
  @IsOptional() @IsString() @MinLength(1) name?: string;
  @IsOptional() @IsString() addressLine1?: string;
  @IsOptional() @IsString() addressLine2?: string;
  @IsOptional() @IsString() city?: string;
  @IsOptional() @IsString() state?: string;
  @IsOptional() @IsString() zipCode?: string;
  @IsOptional() @IsString() country?: string;
  @IsOptional() @IsString() phone?: string;
  @IsOptional() @IsString() mobile?: string;
  @IsOptional() @IsString() fax?: string;
  @IsOptional() @IsEmail() email?: string;
  @IsOptional() @IsBoolean() emailOptOut?: boolean;
  @IsOptional() @IsString() notes?: string;
  @IsOptional() @IsString() identificationType?: string;
  @IsOptional() @IsString() identificationNumber?: string;
  @IsOptional() @IsString() identificationExpiration?: string;
  @IsOptional() @IsString() customerSince?: string;
  @IsOptional() @IsBoolean() status?: boolean;
  @IsOptional() @IsNumber() minimumBalance?: number;
  @IsOptional() @IsNumber() feeAmount?: number;
  @IsOptional() @IsEnum(Currency) preferredCurrency?: Currency;
}
