38 lines
483 B
TypeScript
38 lines
483 B
TypeScript
import {
|
|
IsNotEmpty,
|
|
IsOptional,
|
|
IsString,
|
|
IsUUID,
|
|
Length,
|
|
Matches,
|
|
} from 'class-validator';
|
|
|
|
export class CreateSalonDto {
|
|
@IsString()
|
|
@Length(1, 200)
|
|
@IsNotEmpty()
|
|
name: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
description?: string;
|
|
|
|
@IsString()
|
|
@Length(1, 500)
|
|
@IsNotEmpty()
|
|
address: string;
|
|
|
|
@Matches(/^09\d{9}$/)
|
|
phone: string;
|
|
|
|
@IsUUID()
|
|
provinceId: string;
|
|
|
|
@IsUUID()
|
|
cityId: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID()
|
|
ownerId?: string;
|
|
}
|