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

42 lines
867 B
TypeScript
Raw Normal View History

2026-03-16 00:33:40 +03:30
import { PartnerStatus } from '@/generated/prisma/enums'
import { ApiProperty, PartialType } from '@nestjs/swagger'
import { IsEnum, IsNumber, IsOptional, IsString } from 'class-validator'
export class CreatePartnerDto {
@IsString()
2026-03-16 00:33:40 +03:30
@ApiProperty({ required: true })
name: string
@IsString()
2026-03-16 00:33:40 +03:30
@ApiProperty({ required: true })
code: string
@IsOptional()
2026-03-14 16:26:44 +03:30
@IsNumber()
2026-03-16 00:33:40 +03:30
@ApiProperty({ required: true })
2026-03-14 16:26:44 +03:30
license_quota?: number
2026-03-16 00:33:40 +03:30
@IsString()
@ApiProperty({ required: true })
username: string
@IsString()
@ApiProperty({ required: true })
password: string
}
2026-03-14 16:26:44 +03:30
2026-03-16 00:33:40 +03:30
export class UpdatePartnerDto extends PartialType(CreatePartnerDto) {
@IsEnum(PartnerStatus)
@ApiProperty({ enum: PartnerStatus })
status: PartnerStatus
}
2026-04-06 18:33:04 +03:30
export class LicenseChargeDto {
@IsNumber()
@ApiProperty({
required: true,
minimum: 0,
})
count: number
}