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

export class FeatureNameDto {
  @ApiPropertyOptional({ description: 'Feature name to filter by' })
  @IsOptional()
  @IsString()
  featureName?: string;
}

export class DateRangeDto {
  @ApiPropertyOptional({ description: 'Start date for filtering', type: Date })
  @IsOptional()
  @IsDate()
  @Type(() => Date)
  startDate?: Date;

  @ApiPropertyOptional({ description: 'End date for filtering', type: Date })
  @IsOptional()
  @IsDate()
  @Type(() => Date)
  endDate?: Date;
}

export class MetadataFilterDto extends FeatureNameDto {
  @ApiProperty({ description: 'Metadata key to analyze' })
  @IsNotEmpty()
  @IsString()
  metadataKey: string;
}

export class GeoFilterDto {
  @ApiPropertyOptional({ description: 'Country to filter by' })
  @IsOptional()
  @IsString()
  country?: string;

  @ApiPropertyOptional({ description: 'Region to filter by' })
  @IsOptional()
  @IsString()
  region?: string;

  @ApiPropertyOptional({ description: 'City to filter by' })
  @IsOptional()
  @IsString()
  city?: string;

  @ApiPropertyOptional({ description: 'Timezone to filter by' })
  @IsOptional()
  @IsString()
  timezone?: string;
}

export class AnalyticsQueryDto extends DateRangeDto {

}
