ppob-backend/src/users/dto/create-user.dto.ts
2022-01-07 15:34:25 +07:00

39 lines
616 B
TypeScript

import { IsNotEmpty, IsOptional, IsUUID } from 'class-validator';
import { Partner } from '../entities/partner.entity';
export class CreateUserDto {
@IsNotEmpty()
username: string;
@IsNotEmpty()
name: string;
@IsNotEmpty()
phone_number: string;
@IsNotEmpty()
password: string;
@IsUUID()
roleId: string;
@IsNotEmpty()
superior: boolean;
@IsOptional()
identity_number: string;
@IsOptional()
image_identity: string;
@IsOptional()
image_store: string;
partner: Partner;
// @ValidateIf((o) => {
// return !!o.superior;
// })
// @IsUUID()
// superior: string;
}