- update model and repository

- add tests for feed Model
This commit is contained in:
albert
2025-07-28 18:31:55 +02:00
parent e1b2403fed
commit 862c94a4e6
3 changed files with 244 additions and 26 deletions

View File

@ -2,9 +2,9 @@ export enum NewsSource {
EL_PAIS = 'El País',
EL_MUNDO = 'El Mundo',
MANUAL = 'Manual'
}
export interface IFeed {
}
export interface IFeed {
_id?: string;
title: string;
description: string;
@ -13,6 +13,55 @@ export interface IFeed {
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;
}