test Scraping Service adding item to repo

This commit is contained in:
albert
2025-07-29 01:16:40 +02:00
parent b936697659
commit 580dae0c4d
2 changed files with 24 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import { IFeedRepository } from '../repositories/FeedRepository';
import { IFeed } from '../types/Feed';
export class ScrapingService {
constructor(private feedRepository: IFeedRepository) {}
@ -14,4 +15,8 @@ export class ScrapingService {
async getFeedCount(): Promise<number> {
return await this.feedRepository.count();
}
async saveFeedItem(feedData: Omit<IFeed, '_id' | 'createdAt' | 'updatedAt'>): Promise<IFeed> {
return await this.feedRepository.create(feedData);
}
}