Files
psp_api/src/modules/admin/partners/dto/partner.dto.ts
T

33 lines
744 B
TypeScript

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
@IsString()
@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 PartialType(CreatePartnerDto) {
@IsEnum(PartnerStatus)
@ApiProperty({ enum: PartnerStatus })
status: PartnerStatus
}