import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsOptional, IsString, IsEnum, IsDateString } from 'class-validator';
import { ReportPeriod } from '../../../domain/value-objects';

export class QueryReportDto {
  @ApiPropertyOptional({ description: '报表代码' })
  @IsOptional()
  @IsString()
  reportCode?: string;

  @ApiPropertyOptional({ description: '周期键', example: '2024-01-15' })
  @IsOptional()
  @IsString()
  periodKey?: string;

  @ApiPropertyOptional({
    description: '报表周期',
    enum: ReportPeriod,
  })
  @IsOptional()
  @IsEnum(ReportPeriod)
  reportPeriod?: ReportPeriod;

  @ApiPropertyOptional({ description: '开始日期' })
  @IsOptional()
  @IsDateString()
  startDate?: string;

  @ApiPropertyOptional({ description: '结束日期' })
  @IsOptional()
  @IsDateString()
  endDate?: string;
}
