import { PartialType } from '@nestjs/swagger'
import { UserCreateDto } from './user-create.dto'
import {
    ArrayMinSize,
    IsArray,
    IsEmail,
    IsEnum,
    IsNotEmpty,
    IsNumber,
    IsOptional,
    IsString,
    Matches,
    MaxLength,
    ValidateNested
} from 'class-validator'
import { Role } from '../../model/role.enum'
import { Type } from 'class-transformer'

export class UserUpdateDto {
    @IsString()
    @MaxLength(30)
    @IsOptional()
    readonly name?: string

    @IsString()
    @MaxLength(40)
    @IsOptional()
    readonly username?: string

    @IsString()
    @IsOptional()
    readonly avatar?: string

    @IsEmail()
    @IsString()
    @IsOptional()
    readonly email?: string

    @IsArray()
    @ArrayMinSize(1)
    @IsOptional()
    readonly roles?: Role[]

    @IsNumber()
    @IsOptional()
    readonly orgId?: number
}
