24 lines
636 B
TypeScript
24 lines
636 B
TypeScript
import { PasswordFieldValidator, UsernameFieldValidator } from '@/common/utils'
|
|
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
|
import { IsEnum, IsOptional, IsString } from 'class-validator'
|
|
import { PartnerRole } from 'generated/prisma/enums'
|
|
|
|
export class CreatePartnerAccountDto {
|
|
@IsString()
|
|
@ApiProperty({})
|
|
@UsernameFieldValidator()
|
|
username: string
|
|
|
|
@IsString()
|
|
@PasswordFieldValidator()
|
|
@ApiProperty({})
|
|
password: string
|
|
}
|
|
|
|
export class UpdateAccountDto extends PartialType(CreatePartnerAccountDto) {
|
|
@IsOptional()
|
|
@IsEnum(PartnerRole)
|
|
@ApiProperty({ enum: PartnerRole })
|
|
role?: PartnerRole
|
|
}
|