Files
backend/src/auth/dto/register.dto.ts
T
Ali Reza bb59d5e9ba Initial commit: Meshkee CMS API
NestJS backend with Prisma, Docker Compose for Postgres/Redis, and deploy docs for the production VM.
2026-07-21 17:52:36 +03:30

31 lines
677 B
TypeScript

import { IsEmail, IsOptional, IsString, Matches, MinLength } from 'class-validator';
export class RegisterDto {
@IsString()
@Matches(/^\+[1-9]\d{6,14}$/, {
message: 'cellNumber must be in E.164 format (e.g. +989121234567)',
})
cellNumber!: string;
@IsString()
@MinLength(8, { message: 'password must be at least 8 characters' })
password!: string;
@IsString()
@MinLength(2)
firstName!: string;
@IsString()
@MinLength(2)
lastName!: string;
@IsOptional()
@IsEmail()
email?: string;
/** Domain of the business website (e.g. shop-a.local). Resolves tenant for customer registration. */
@IsString()
@MinLength(3)
domain!: string;
}