import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsIn, IsInt, IsOptional, Max, Min } from 'class-validator';

export class GetTrendingAreasDto {
  @ApiPropertyOptional({
    description: 'Look-back window in days',
    enum: [7, 14, 30],
    default: 7,
    example: 7,
  })
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @IsIn([7, 14, 30])
  period: number = 7;

  @ApiPropertyOptional({
    description: 'Maximum number of trending areas to return',
    minimum: 1,
    maximum: 50,
    default: 10,
    example: 10,
  })
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(1)
  @Max(50)
  limit: number = 10;

  @ApiProperty({
    description: 'Geographic aggregation level (currently only "district" is supported)',
    enum: ['district'],
    default: 'district',
    example: 'district',
  })
  @IsOptional()
  @IsIn(['district'])
  level: 'district' = 'district';
}
