import { ApiProperty, OmitType } from '@nestjs/swagger';
import { IsEnum, IsOptional } from 'class-validator';
import { CreateUserDto } from '../../user/dto/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;
}
