/// Domain Repository Interface: News Repository
///
/// Defines the contract for news article data operations.
/// This is an abstract interface following the Repository Pattern.
library;

import 'package:worker/features/news/domain/entities/blog_category.dart';
import 'package:worker/features/news/domain/entities/news_article.dart';

/// News Repository Interface
///
/// Provides methods to fetch and manage news articles and categories.
abstract class NewsRepository {
  /// Get all blog categories from Frappe API
  Future<List<BlogCategory>> getBlogCategories();

  /// Get all news articles
  Future<List<NewsArticle>> getAllArticles();

  /// Get featured article
  Future<NewsArticle?> getFeaturedArticle();

  /// Get articles by category
  Future<List<NewsArticle>> getArticlesByCategory(NewsCategory category);

  /// Get a specific article by ID (from local cache)
  Future<NewsArticle?> getArticleById(String articleId);

  /// Get a specific article by ID from API
  /// Uses frappe.client.get endpoint to fetch the full blog post detail
  Future<NewsArticle?> getArticleByIdFromApi(String articleId);

  /// Refresh articles from server
  Future<List<NewsArticle>> refreshArticles();
}
