import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { IsOptional, IsString, MaxLength, MinLength } from 'class-validator'; export class SetPasswordDto { @ApiPropertyOptional({ description: 'Required when changing an existing password' }) @IsOptional() @IsString() @MaxLength(72) currentPassword?: string; @ApiProperty({ example: 'mySecurePass123', minLength: 8 }) @IsString() @MinLength(8) @MaxLength(72) password!: string; @ApiProperty({ example: 'mySecurePass123' }) @IsString() @MinLength(8) @MaxLength(72) confirmPassword!: string; }