mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 12:30:58 +00:00
42 lines
912 B
TypeScript
42 lines
912 B
TypeScript
import { ApiProperty } from "@nestjs/swagger";
|
|
import { Type } from "class-transformer";
|
|
import { IsBoolean, IsEmail, IsOptional, IsString, MinLength, ValidateNested } from "class-validator";
|
|
|
|
class CreateOrganizationUserNameDto {
|
|
@ApiProperty()
|
|
@IsString()
|
|
@MinLength(1)
|
|
en!: string;
|
|
|
|
@ApiProperty({ required: false })
|
|
@IsOptional()
|
|
@IsString()
|
|
am?: string;
|
|
}
|
|
|
|
export class CreateOrganizationUserDto {
|
|
@ApiProperty()
|
|
@IsEmail()
|
|
email!: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
@MinLength(1)
|
|
username!: string;
|
|
|
|
@ApiProperty({ required: false })
|
|
@IsOptional()
|
|
@IsString()
|
|
phoneNumber?: string;
|
|
|
|
@ApiProperty({ type: CreateOrganizationUserNameDto })
|
|
@ValidateNested()
|
|
@Type(() => CreateOrganizationUserNameDto)
|
|
name!: CreateOrganizationUserNameDto;
|
|
|
|
@ApiProperty({ required: false, default: false })
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
assignOrganizationAdmin?: boolean;
|
|
}
|