refactor user accounts structure
This commit is contained in:
@@ -1,16 +1,32 @@
|
||||
import { IsNumber, IsOptional, IsString } from 'class-validator'
|
||||
import { PartnerStatus } from '@/generated/prisma/enums'
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsNumber, IsOptional, IsString } from 'class-validator'
|
||||
|
||||
export class CreatePartnerDto {
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
name: string
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
code?: string
|
||||
@ApiProperty({ required: true })
|
||||
code: string
|
||||
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
@ApiProperty({ required: true })
|
||||
license_quota?: number
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
username: string
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
password: string
|
||||
}
|
||||
|
||||
export class UpdatePartnerDto extends CreatePartnerDto {}
|
||||
export class UpdatePartnerDto extends PartialType(CreatePartnerDto) {
|
||||
@IsEnum(PartnerStatus)
|
||||
@ApiProperty({ enum: PartnerStatus })
|
||||
status: PartnerStatus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user