Files
dailytrends/src/types/Feed.ts
albert 862c94a4e6 - update model and repository
- add tests for feed Model
2025-07-28 18:31:55 +02:00

67 lines
1.3 KiB
TypeScript

export enum NewsSource {
EL_PAIS = 'El País',
EL_MUNDO = 'El Mundo',
MANUAL = 'Manual'
}
export interface IFeed {
_id?: string;
title: string;
description: string;
url: string;
source: NewsSource;
publishedAt: Date;
imageUrl?: string;
category?: string;
isManual: boolean;
createdAt?: Date;
updatedAt?: Date;
}
export interface ICreateFeedDto {
title: string;
description: string;
url: string;
source: NewsSource;
publishedAt?: Date;
imageUrl?: string;
category?: string;
isManual?: boolean;
}
export interface IUpdateFeedDto {
title?: string;
description?: string;
url?: string;
source?: NewsSource;
publishedAt?: Date;
imageUrl?: string;
category?: string;
isManual?: boolean;
}
export interface IFeedQuery {
source?: NewsSource;
page?: number;
limit?: number;
}
export interface IPaginatedResponse<T> {
data: T[];
pagination: {
page: number;
limit: number;
total: number;
totalPages: number;
hasNext: boolean;
hasPrev: boolean;
};
}
export interface IScrapedNews {
title: string;
description: string;
url: string;
imageUrl?: string;
category?: string;
}