import 'package:krow_core/core.dart';
import 'package:krow_domain/krow_domain.dart';
import '../repositories/billing_repository.dart';

/// Use case for fetching the invoice history.
///
/// This use case encapsulates the logic for retrieving the list of past paid invoices.
/// It delegates the data retrieval to the [BillingRepository].
class GetInvoiceHistoryUseCase extends NoInputUseCase<List<Invoice>> {
  /// Creates a [GetInvoiceHistoryUseCase].
  GetInvoiceHistoryUseCase(this._repository);

  final BillingRepository _repository;

  @override
  Future<List<Invoice>> call() => _repository.getInvoiceHistory();
}
