import { IsEnum, IsOptional, IsInt, Min, Max } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { DashboardPeriod } from '../../../domain/value-objects';

/**
 * 仪表板趋势查询参数
 */
export class DashboardTrendQueryDto {
  @ApiPropertyOptional({
    enum: DashboardPeriod,
    default: DashboardPeriod.SEVEN_DAYS,
    description: '时间周期 (7d, 30d, 90d)',
  })
  @IsOptional()
  @IsEnum(DashboardPeriod)
  period?: DashboardPeriod = DashboardPeriod.SEVEN_DAYS;
}

/**
 * 仪表板活动查询参数
 */
export class DashboardActivitiesQueryDto {
  @ApiPropertyOptional({
    default: 5,
    minimum: 1,
    maximum: 20,
    description: '返回数量限制',
  })
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(1)
  @Max(20)
  limit?: number = 5;
}
