correction for generic users

This commit is contained in:
2025-09-08 09:50:30 +02:00
parent 846c5c1069
commit e999839bc5
2 changed files with 34 additions and 12 deletions
+23 -10
View File
@@ -25,15 +25,15 @@ export class CreateUserDto {
@ApiProperty({ example: 'Julien' })
@IsString()
@IsNotEmpty()
@IsOptional()
@MaxLength(100)
first_name: string;
first_name?: string;
@ApiProperty({ example: 'Dupont' })
@IsString()
@IsNotEmpty()
@IsOptional()
@MaxLength(100)
last_name: string;
last_name?: string;
@ApiProperty({ enum: GenreType, required: false, default: GenreType.AUTRE })
@IsOptional()
@@ -51,14 +51,27 @@ export class CreateUserDto {
@ApiProperty({ example: '+33123456789' })
@IsString()
@IsNotEmpty()
@IsOptional()
@MaxLength(20)
phone: string;
phone?: string;
@ApiProperty({ example: 'Paris', required: false })
@IsOptional()
@IsString()
@MaxLength(150)
city?: string;
@ApiProperty({ example: '75000', required: false })
@IsOptional()
@IsString()
@MaxLength(10)
postal_code?: string;
@ApiProperty({ example: '10 rue de la paix, 75000 Paris' })
@IsString()
@IsNotEmpty()
address: string;
@IsOptional()
address?: string;
@ApiProperty({ example: 'https://example.com/photo.jpg', required: false })
@IsOptional()
@@ -72,8 +85,8 @@ export class CreateUserDto {
@ApiProperty({ required: false })
@IsOptional()
@IsDateString()
consent_photo_at?: string;
@IsDateString({}, { message: 'consent_photo_at doit être une date ISO valide' })
consent_photo_at?: string | null;
@ApiProperty({ default: false })
@IsOptional()