import { IsString, IsOptional, IsIn, MaxLength, MinLength } from 'class-validator'; import { ApiPropertyOptional } from '@nestjs/swagger'; const CURRENCIES = ['RUB', 'USD', 'EUR', 'CNY', 'KZT', 'BYN'] as const; export class UpdatePortfolioDto { @ApiPropertyOptional({ example: 'Мой портфель' }) @IsString() @MinLength(1) @MaxLength(100) @IsOptional() name?: string; @ApiPropertyOptional({ example: 'Обновлённое описание' }) @IsString() @IsOptional() @MaxLength(500) description?: string; @ApiPropertyOptional({ default: 'RUB', enum: CURRENCIES }) @IsString() @IsIn(CURRENCIES) @IsOptional() currency?: string; }