import { IsEnum, IsOptional, IsString, MaxLength } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { ReportType } from '../../../domain/entities/report.entity';
import { PaginationQueryDto } from './pagination.dto';

export class GenerateReportDto {
  @ApiProperty({
    enum: ReportType,
    example: ReportType.MONTHLY,
    description: 'Report type (daily, monthly, quarterly, annual)',
  })
  @IsEnum(ReportType)
  type: ReportType;

  @ApiPropertyOptional({
    example: '2025-01',
    description: 'Report period (auto-generated if omitted)',
  })
  @IsOptional()
  @IsString()
  @MaxLength(50)
  period?: string;
}

export class ListReportsQueryDto extends PaginationQueryDto {
  @ApiPropertyOptional({
    enum: ReportType,
    description: 'Filter by report type',
  })
  @IsOptional()
  @IsEnum(ReportType)
  type?: ReportType;
}
