correction for generic users
This commit is contained in:
parent
846c5c1069
commit
e999839bc5
@ -42,10 +42,10 @@ export class Users {
|
||||
password_hash: string;
|
||||
|
||||
@Column({ name: 'prenom', nullable: true })
|
||||
first_name: string;
|
||||
first_name?: string;
|
||||
|
||||
@Column({ name: 'nom', nullable: true })
|
||||
last_name: string;
|
||||
last_name?: string;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
@ -91,6 +91,12 @@ export class Users {
|
||||
@Column({ default: false, name: 'changement_mdp_obligatoire' })
|
||||
must_change_password: boolean;
|
||||
|
||||
@Column({ nullable: true, name: 'ville' })
|
||||
city?: string;
|
||||
|
||||
@Column({ nullable: true, name: 'code_postal' })
|
||||
postal_code?: string;
|
||||
|
||||
@CreateDateColumn({ name: 'cree_le', type: 'timestamptz' })
|
||||
created_at: Date;
|
||||
|
||||
@ -106,4 +112,7 @@ export class Users {
|
||||
|
||||
@OneToMany(() => Message, m => m.sender)
|
||||
messages?: Message[];
|
||||
|
||||
@OneToMany(() => Parents, parent => parent.co_parent)
|
||||
co_parent_in?: Parents[];
|
||||
}
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user