import { IsBoolean, IsEmail, IsEnum, IsNumber, IsOptional, IsString, MinLength, } from "class-validator"; import { Currency } from "@jorgecuadros/database"; /** * Editable customer fields. Internal/derived columns (nameSource, nameMissing, * legacy* provenance, archivedAt) are managed by the service, not the client. * `name` is the only required field; everything else is optional. */ export class CreateCustomerDto { @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; /** ISO date string; coerced to Date by the service. */ @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; }