import { IsString, IsNotEmpty, IsOptional, IsEnum } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export enum ReportType {
  CLIENTS_SUMMARY = 'clients_summary',
  FUNNEL_CONVERSION = 'funnel_conversion',
  TRAINER_PERFORMANCE = 'trainer_performance',
  SALES_SUMMARY = 'sales_summary',
  SLEEPING_CLIENTS = 'sleeping_clients',
}

export class GenerateReportDto {
  @ApiProperty({ description: 'Report type', enum: ReportType })
  @IsEnum(ReportType)
  type: ReportType;

  @ApiProperty({ description: 'Report title', example: 'Monthly Sales Report' })
  @IsString()
  @IsNotEmpty()
  title: string;

  @ApiPropertyOptional({
    description: 'Report parameters (JSON)',
    example: { dateFrom: '2026-01-01', dateTo: '2026-01-31' },
  })
  @IsOptional()
  parameters?: Record<string, any>;
}
