refactor user accounts structure

This commit is contained in:
2026-03-16 00:33:40 +03:30
parent d2215b9f04
commit 0ad6a3200e
118 changed files with 18774 additions and 8764 deletions
@@ -1,37 +1,20 @@
import { ApiProperty, PartialType } from '@nestjs/swagger'
import { IsEnum, IsOptional, IsString } from 'class-validator'
import { AccountStatus, AccountType } from 'generated/prisma/enums'
import { CreateUserDto } from '../../../users/dto/user.dto'
import { PartnerRole } from 'generated/prisma/enums'
export class CreateAccountDto extends CreateUserDto {
export class CreatePartnerAccountDto {
@IsString()
@ApiProperty({})
username: string
@IsOptional()
@IsEnum(AccountType)
type?: AccountType
@IsString()
@ApiProperty({})
password: string
}
export class UpdateAccountDto {
export class UpdateAccountDto extends PartialType(CreatePartnerAccountDto) {
@IsOptional()
@IsString()
username?: string
@IsOptional()
@IsEnum(AccountType)
type?: AccountType
@IsOptional()
@IsEnum(AccountStatus)
status?: AccountStatus
@IsOptional()
@IsString()
password?: string
// @IsOptional()
// @IsString()
// user_id?: string
@IsEnum(PartnerRole)
@ApiProperty({ enum: PartnerRole })
role?: PartnerRole
}