From c8635c4d09c6294497999a8d03b1a69284c3e220 Mon Sep 17 00:00:00 2001 From: sdraris Date: Wed, 17 Sep 2025 15:43:13 +0200 Subject: [PATCH] user dto correction --- src/routes/user/dto/create_user.dto.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/routes/user/dto/create_user.dto.ts b/src/routes/user/dto/create_user.dto.ts index 9c2bb78..30152da 100644 --- a/src/routes/user/dto/create_user.dto.ts +++ b/src/routes/user/dto/create_user.dto.ts @@ -20,20 +20,21 @@ export class CreateUserDto { @ApiProperty({ minLength: 6, example: 'Mon_motdepasse_fort_1234?' }) @IsString() + @IsNotEmpty() @MinLength(6) password: string; @ApiProperty({ example: 'Julien' }) @IsString() - @IsOptional() + @IsNotEmpty() @MaxLength(100) - prenom?: string; + prenom: string; @ApiProperty({ example: 'Dupont' }) @IsString() - @IsOptional() + @IsNotEmpty() @MaxLength(100) - nom?: string; + nom: string; @ApiProperty({ enum: GenreType, required: false, default: GenreType.AUTRE }) @IsOptional() @@ -51,9 +52,9 @@ export class CreateUserDto { @ApiProperty({ example: '+33123456789' }) @IsString() - @IsOptional() + @IsNotEmpty() @MaxLength(20) - telephone?: string; + telephone: string; @ApiProperty({ example: 'Paris', required: false }) @IsOptional() @@ -69,8 +70,8 @@ export class CreateUserDto { @ApiProperty({ example: '10 rue de la paix, 75000 Paris' }) @IsString() - @IsOptional() - adresse?: string; + @IsNotEmpty() + adresse: string; @ApiProperty({ example: 'https://example.com/photo.jpg', required: false }) @IsOptional() @@ -91,4 +92,9 @@ export class CreateUserDto { @IsOptional() @IsBoolean() changement_mdp_obligatoire?: boolean = false; + + @ApiProperty({ example: true }) + @IsBoolean() + @IsNotEmpty() + cguAccepted: boolean; }