From ac6e99d53c0906eac83f0f0dbdf2c98dd369a331 Mon Sep 17 00:00:00 2001 From: sdraris Date: Mon, 8 Sep 2025 11:02:35 +0200 Subject: [PATCH] added login + register dto --- src/routes/user/dto/login.dto.ts | 3 ++- src/routes/user/dto/register.dto.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/user/dto/login.dto.ts b/src/routes/user/dto/login.dto.ts index b574077..1856d28 100644 --- a/src/routes/user/dto/login.dto.ts +++ b/src/routes/user/dto/login.dto.ts @@ -1,5 +1,5 @@ import { ApiProperty } from "@nestjs/swagger"; -import { IsEmail, IsString, MinLength } from "class-validator"; +import { IsEmail, IsString, MaxLength, MinLength } from "class-validator"; export class LoginDto { @ApiProperty({ example: 'my.user@example.com', description: "Adresse email de l'utililisateur" }) @@ -12,5 +12,6 @@ export class LoginDto { }) @IsString({ message: 'Le mot de passe doit etre une chaine de caracteres' }) @MinLength(8, { message: 'Le mot de passe doit contenir au moins 8 caracteres' }) + @MaxLength(50) password: string; } \ No newline at end of file diff --git a/src/routes/user/dto/register.dto.ts b/src/routes/user/dto/register.dto.ts index c4b0de5..8765abb 100644 --- a/src/routes/user/dto/register.dto.ts +++ b/src/routes/user/dto/register.dto.ts @@ -8,5 +8,7 @@ export class RegisterDto extends OmitType(CreateUserDto, ['must_change_password' @IsEnum(RoleType) role: RoleType = RoleType.PARENT; + @IsEnum(StatutUtilisateurType) + @IsOptional() status?: StatutUtilisateurType = StatutUtilisateurType.EN_ATTENTE; }