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

export enum ForecastPeriod {
  MONTH = 'month',
  QUARTER = 'quarter',
  YEAR = 'year',
}

export class ForecastQueryDto {
  @ApiPropertyOptional({ format: 'uuid', description: 'Filter nach Pipeline' })
  @IsOptional()
  @IsUUID()
  pipelineId?: string;

  @ApiPropertyOptional({
    enum: ForecastPeriod,
    default: ForecastPeriod.QUARTER,
    description: 'Zeitraum fuer den Forecast',
  })
  @IsOptional()
  @IsEnum(ForecastPeriod)
  period?: ForecastPeriod = ForecastPeriod.QUARTER;
}
