refactor user accounts structure
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsOptional, IsString } from 'class-validator'
|
||||
import { AccountStatus, ConsumerRole } from 'generated/prisma/enums'
|
||||
|
||||
export class CreateConsumerAccountDto {
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
username: string
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
password: string
|
||||
|
||||
@IsEnum(ConsumerRole)
|
||||
@ApiProperty({ required: true, enum: ConsumerRole })
|
||||
role: ConsumerRole
|
||||
}
|
||||
|
||||
export class UpdateAccountDto extends PartialType(CreateConsumerAccountDto) {
|
||||
@IsOptional()
|
||||
@IsEnum(AccountStatus)
|
||||
@ApiProperty({ enum: AccountStatus })
|
||||
status?: AccountStatus
|
||||
}
|
||||
Reference in New Issue
Block a user