2026-05-19 20:34:05 +03:30
|
|
|
import { PasswordFieldValidator, UsernameFieldValidator } from '@/common/utils'
|
2026-03-16 00:33:40 +03:30
|
|
|
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
2026-03-07 11:25:11 +03:30
|
|
|
import { IsEnum, IsOptional, IsString } from 'class-validator'
|
2026-03-16 00:33:40 +03:30
|
|
|
import { PartnerRole } from 'generated/prisma/enums'
|
2026-03-07 11:25:11 +03:30
|
|
|
|
2026-03-16 00:33:40 +03:30
|
|
|
export class CreatePartnerAccountDto {
|
2026-03-07 11:25:11 +03:30
|
|
|
@IsString()
|
2026-03-16 00:33:40 +03:30
|
|
|
@ApiProperty({})
|
2026-05-19 20:34:05 +03:30
|
|
|
@UsernameFieldValidator()
|
2026-03-07 11:25:11 +03:30
|
|
|
username: string
|
|
|
|
|
|
|
|
|
|
@IsString()
|
2026-05-19 20:34:05 +03:30
|
|
|
@PasswordFieldValidator()
|
2026-03-16 00:33:40 +03:30
|
|
|
@ApiProperty({})
|
2026-03-07 11:25:11 +03:30
|
|
|
password: string
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-16 00:33:40 +03:30
|
|
|
export class UpdateAccountDto extends PartialType(CreatePartnerAccountDto) {
|
2026-03-07 11:25:11 +03:30
|
|
|
@IsOptional()
|
2026-03-16 00:33:40 +03:30
|
|
|
@IsEnum(PartnerRole)
|
|
|
|
|
@ApiProperty({ enum: PartnerRole })
|
|
|
|
|
role?: PartnerRole
|
2026-03-07 11:25:11 +03:30
|
|
|
}
|