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

export class CreateSnapshotRequest {
  @ApiProperty({ description: '快照日期 (YYYY-MM-DD)' })
  @IsDateString()
  snapshotDate: string;
}

export class GetSnapshotRequest {
  @ApiProperty({ description: '快照日期 (YYYY-MM-DD)' })
  @IsDateString()
  snapshotDate: string;
}

export class GetBatchRatiosRequest {
  @ApiPropertyOptional({ description: '页码', default: 1 })
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(1)
  page?: number = 1;

  @ApiPropertyOptional({ description: '每页大小', default: 1000 })
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(1)
  @Max(5000)
  pageSize?: number = 1000;
}
