39 lines
616 B
TypeScript
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;
|
|
}
|