forked from Ynov/ptitspas-ynov-back
15 lines
619 B
TypeScript
15 lines
619 B
TypeScript
import { ApiProperty, OmitType } from '@nestjs/swagger';
|
|
import { IsEnum, IsOptional } from 'class-validator';
|
|
import { CreateUserDto } from './create_user.dto';
|
|
import { RoleType, StatutUtilisateurType } from 'src/entities/users.entity';
|
|
|
|
export class RegisterDto extends OmitType(CreateUserDto, ['changement_mdp_obligatoire'] as const) {
|
|
@ApiProperty({ enum: [RoleType.ASSISTANTE_MATERNELLE, RoleType.PARENT], default: RoleType.PARENT })
|
|
@IsEnum(RoleType)
|
|
role: RoleType = RoleType.PARENT;
|
|
|
|
@IsEnum(StatutUtilisateurType)
|
|
@IsOptional()
|
|
statut?: StatutUtilisateurType = StatutUtilisateurType.EN_ATTENTE;
|
|
}
|