Files
backend/src/customers/dto/create-customer.dto.ts
T
Alireza HassaniandCursor 49a9f0c289 Expose invoice locale on public payloads and accept English name fields on create customer.
Public invoices need branding defaultLocale for RTL viewers; customer create aligns with the business add-customer form.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 15:46:18 +03:30

43 lines
642 B
TypeScript

import {
IsEmail,
IsOptional,
IsString,
Matches,
MinLength,
} from 'class-validator';
export class CreateCustomerDto {
@IsString()
@Matches(/^\+[1-9]\d{6,14}$/, {
message: 'cellNumber must be in E.164 format (e.g. +989121234567)',
})
cellNumber!: string;
@IsOptional()
@IsString()
@MinLength(8)
password?: string;
@IsString()
@MinLength(2)
firstName!: string;
@IsString()
@MinLength(2)
lastName!: string;
@IsOptional()
@IsString()
@MinLength(2)
firstNameEn?: string;
@IsOptional()
@IsString()
@MinLength(2)
lastNameEn?: string;
@IsOptional()
@IsEmail()
email?: string;
}