29 lines
432 B
TypeScript
29 lines
432 B
TypeScript
import {
|
|
IsEnum,
|
|
IsOptional,
|
|
IsString,
|
|
Length,
|
|
Matches,
|
|
} from 'class-validator';
|
|
import { UserRole } from '../enums/user-role.enum';
|
|
|
|
export class UpdateUserDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@Length(1, 100)
|
|
firstName?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@Length(1, 100)
|
|
lastName?: string;
|
|
|
|
@IsOptional()
|
|
@Matches(/^09\d{9}$/)
|
|
mobile?: string;
|
|
|
|
@IsOptional()
|
|
@IsEnum(UserRole)
|
|
role?: UserRole;
|
|
}
|