import { ApiProperty } from '@nestjs/swagger';

export class TrendResponseDto {
    @ApiProperty()
    id: string;

    @ApiProperty()
    title: string;

    @ApiProperty()
    description: string;

    @ApiProperty()
    url: string;

    @ApiProperty()
    source: string;

    @ApiProperty()
    score: number;

    @ApiProperty()
    category: string;

    @ApiProperty({ type: [String] })
    tags: string[];

    @ApiProperty()
    engagement: Record<string, number>;

    @ApiProperty()
    sourceTimestamp: Date;

    @ApiProperty()
    createdAt: Date;
}

export class CollectionStatsDto {
    @ApiProperty()
    totalRaw: number;

    @ApiProperty()
    afterDedup: number;

    @ApiProperty()
    bySource: Record<string, number>;

    @ApiProperty({ type: [String] })
    errors: string[];

    @ApiProperty()
    durationMs: number;
}

export class TrendsListResponseDto {
    @ApiProperty({ type: [TrendResponseDto] })
    data: TrendResponseDto[];

    @ApiProperty()
    total: number;

    @ApiProperty()
    filters: Record<string, any>;
}
