37 lines
679 B
TypeScript
37 lines
679 B
TypeScript
|
|
import { IsEnum, IsOptional, IsString } from 'class-validator'
|
||
|
|
import { AccountStatus, AccountType } from 'generated/prisma/enums'
|
||
|
|
import { CreateUserDto } from '../../../users/dto/user.dto'
|
||
|
|
|
||
|
|
export class CreateAccountDto extends CreateUserDto {
|
||
|
|
@IsString()
|
||
|
|
username: string
|
||
|
|
|
||
|
|
@IsEnum(AccountStatus)
|
||
|
|
status: AccountStatus
|
||
|
|
|
||
|
|
@IsString()
|
||
|
|
password: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export class UpdateAccountDto {
|
||
|
|
@IsOptional()
|
||
|
|
@IsString()
|
||
|
|
username?: string
|
||
|
|
|
||
|
|
@IsOptional()
|
||
|
|
@IsEnum(AccountType)
|
||
|
|
type?: AccountType
|
||
|
|
|
||
|
|
@IsOptional()
|
||
|
|
@IsEnum(AccountStatus)
|
||
|
|
status?: AccountStatus
|
||
|
|
|
||
|
|
@IsOptional()
|
||
|
|
@IsString()
|
||
|
|
password?: string
|
||
|
|
|
||
|
|
@IsOptional()
|
||
|
|
@IsString()
|
||
|
|
user_id?: string
|
||
|
|
}
|