Files
dsc-api/src/modules/auth/DTO/loginPassword.dto.ts
T
2025-01-22 10:47:47 +03:30

19 lines
749 B
TypeScript

import { ApiProperty, PickType } from "@nestjs/swagger";
import { IsEmail, IsNotEmpty, IsString } from "class-validator";
import { AuthMessage } from "../../../common/enums/message.enum";
export class LoginPasswordDTO {
@IsNotEmpty({ message: AuthMessage.EMAIL_NOT_EMPTY })
@IsEmail(undefined, { message: AuthMessage.INVALID_EMAIL_FORMAT })
@ApiProperty({ description: "email of user", default: "user@test.ir" })
email: string;
@IsNotEmpty({ message: AuthMessage.PasswordNotEmpty })
@IsString({ message: AuthMessage.INVALID_PASS_FORMAT })
@ApiProperty({ type: "string", description: "password user", example: "@1234" })
password: string;
}
export class CheckUserExistDto extends PickType(LoginPasswordDTO, ["email"] as const) {}