import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsDateString, IsIn, IsOptional } from 'class-validator';

export class RevenueStatsDto {
  @ApiProperty({ description: 'Start date (ISO 8601)', example: '2025-01-01' })
  @IsDateString()
  startDate!: string;

  @ApiProperty({ description: 'End date (ISO 8601)', example: '2025-12-31' })
  @IsDateString()
  endDate!: string;

  @ApiPropertyOptional({ description: 'Group results by day or month', enum: ['day', 'month'], default: 'month' })
  @IsOptional()
  @IsIn(['day', 'month'])
  groupBy?: 'day' | 'month';
}
