import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { IsInt } from 'class-validator'; export class BaseRangeQueryDto { @ApiProperty({ description: 'UTC epoch seconds (inclusive)', example: 1767168000, }) @Type(() => Number) @IsInt() fromSec!: number; @ApiProperty({ description: 'UTC epoch seconds (exclusive)', example: 1767175200, }) @Type(() => Number) @IsInt() toSec!: number; @ApiPropertyOptional({ description: 'Page number (1-based). Default = 1', example: 1, default: 1, }) page?: number; @ApiPropertyOptional({ description: 'Page size. Default = 10', example: 10, default: 10, }) size?: number; } export class AdsStatsQueryDto extends BaseRangeQueryDto { @ApiPropertyOptional({ description: 'Ads ID (supported)', example: '694b8d79d8db191891d56ab6', }) adsId?: string; @ApiPropertyOptional({ description: 'Channel ID (ignored if not present in aggregates)', example: 'channel_001', }) channelId?: string; @ApiPropertyOptional({ description: 'Ad type (ignored if not present in aggregates)', example: 'BANNER', }) adType?: string; } export class ChannelStatsQueryDto extends BaseRangeQueryDto { @ApiPropertyOptional({ description: 'Channel ID', example: 'channel_001', }) channelId?: string; }