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

export class StatsQueryDto {
  @ApiPropertyOptional({
    description: 'Filter stats from this date (ISO string)',
    example: '2026-01-01',
  })
  @IsDateString()
  @IsOptional()
  dateFrom?: string;

  @ApiPropertyOptional({
    description: 'Filter stats up to this date (ISO string)',
    example: '2026-01-31',
  })
  @IsDateString()
  @IsOptional()
  dateTo?: string;

  @ApiPropertyOptional({
    description: 'Filter by trainer UUID',
    example: '550e8400-e29b-41d4-a716-446655440000',
  })
  @IsUUID()
  @IsOptional()
  trainerId?: string;
}

export class RatingQueryDto {
  @ApiPropertyOptional({
    description: 'Rating period: week, month, quarter, or year',
    example: 'month',
    enum: ['week', 'month', 'quarter', 'year'],
  })
  @IsIn(['week', 'month', 'quarter', 'year'])
  @IsOptional()
  period?: string;
}
