import { ApiProperty } from "@nestjs/swagger"; import { IsMobilePhone, IsNotEmpty, IsString, Length } from "class-validator"; import { AuthMessage } from "../../../common/enums/message.enum"; export class CreateResellerDto { @IsNotEmpty() @IsString() @Length(2, 50,) @ApiProperty({ description: "name", example: "mahyar" }) name: string; @IsNotEmpty({ message: AuthMessage.PHONE_NOT_EMPTY }) @IsMobilePhone("fa-IR", {}, { message: AuthMessage.INVALID_PHONE_FORMAT }) @Length(11, 11, { message: AuthMessage.PHONE_SHOULD_BE_11_DIGIT }) @ApiProperty({ description: "phone number", default: "09922320740" }) phone: string; }