import { ApiPropertyOptional } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import { IsInt, IsOptional, Max, Min } from 'class-validator';

export class ValuationHistoryDto {
  @ApiPropertyOptional({ description: 'Maximum number of history records (default: 50, max: 100)', default: 50 })
  @IsOptional()
  @IsInt()
  @Min(1)
  @Max(100)
  @Transform(({ value }) => (value != null ? parseInt(value, 10) : 50))
  limit?: number;
}
