user dto correction

This commit is contained in:
sdraris 2025-09-17 15:43:13 +02:00
parent 39878644e8
commit c8635c4d09

View File

@ -20,20 +20,21 @@ export class CreateUserDto {
@ApiProperty({ minLength: 6, example: 'Mon_motdepasse_fort_1234?' }) @ApiProperty({ minLength: 6, example: 'Mon_motdepasse_fort_1234?' })
@IsString() @IsString()
@IsNotEmpty()
@MinLength(6) @MinLength(6)
password: string; password: string;
@ApiProperty({ example: 'Julien' }) @ApiProperty({ example: 'Julien' })
@IsString() @IsString()
@IsOptional() @IsNotEmpty()
@MaxLength(100) @MaxLength(100)
prenom?: string; prenom: string;
@ApiProperty({ example: 'Dupont' }) @ApiProperty({ example: 'Dupont' })
@IsString() @IsString()
@IsOptional() @IsNotEmpty()
@MaxLength(100) @MaxLength(100)
nom?: string; nom: string;
@ApiProperty({ enum: GenreType, required: false, default: GenreType.AUTRE }) @ApiProperty({ enum: GenreType, required: false, default: GenreType.AUTRE })
@IsOptional() @IsOptional()
@ -51,9 +52,9 @@ export class CreateUserDto {
@ApiProperty({ example: '+33123456789' }) @ApiProperty({ example: '+33123456789' })
@IsString() @IsString()
@IsOptional() @IsNotEmpty()
@MaxLength(20) @MaxLength(20)
telephone?: string; telephone: string;
@ApiProperty({ example: 'Paris', required: false }) @ApiProperty({ example: 'Paris', required: false })
@IsOptional() @IsOptional()
@ -69,8 +70,8 @@ export class CreateUserDto {
@ApiProperty({ example: '10 rue de la paix, 75000 Paris' }) @ApiProperty({ example: '10 rue de la paix, 75000 Paris' })
@IsString() @IsString()
@IsOptional() @IsNotEmpty()
adresse?: string; adresse: string;
@ApiProperty({ example: 'https://example.com/photo.jpg', required: false }) @ApiProperty({ example: 'https://example.com/photo.jpg', required: false })
@IsOptional() @IsOptional()
@ -91,4 +92,9 @@ export class CreateUserDto {
@IsOptional() @IsOptional()
@IsBoolean() @IsBoolean()
changement_mdp_obligatoire?: boolean = false; changement_mdp_obligatoire?: boolean = false;
@ApiProperty({ example: true })
@IsBoolean()
@IsNotEmpty()
cguAccepted: boolean;
} }