parent
8411c2a28b
commit
7240744076
4 changed files with 44 additions and 19 deletions
@ -0,0 +1,29 @@ |
|||||||
|
import { IsString, IsEmail, IsEnum, IsNotEmpty, IsOptional, Matches } from "class-validator"; |
||||||
|
|
||||||
|
export class CreateAdminDto { |
||||||
|
@IsEmail({}, { message: "Invalid email format" }) |
||||||
|
email: string; |
||||||
|
|
||||||
|
@IsString() |
||||||
|
@IsNotEmpty({ message: "Password is required" }) |
||||||
|
password: string; |
||||||
|
|
||||||
|
@IsString() |
||||||
|
@IsNotEmpty({ message: "First name is required" }) |
||||||
|
firstName: string; |
||||||
|
|
||||||
|
@IsString() |
||||||
|
@IsNotEmpty({ message: "Last name is required" }) |
||||||
|
lastName: string; |
||||||
|
|
||||||
|
@IsString() |
||||||
|
@IsNotEmpty({ message: "Username is required" }) |
||||||
|
username: string; |
||||||
|
|
||||||
|
@IsString() |
||||||
|
@Matches(/^[0-9]{11}$/, { message: "Phone number must be 10 digits" }) |
||||||
|
phoneNumber: string; |
||||||
|
|
||||||
|
@IsEnum(["male", "female"], { message: "Gender must be 'male' or 'female'" }) |
||||||
|
gender: string; |
||||||
|
} |
Loading…
Reference in new issue