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

/// Use case for fetching the pending invoices.
///
/// This use case encapsulates the logic for retrieving invoices that are currently open or disputed.
/// It delegates the data retrieval to the [BillingRepository].
class GetPendingInvoicesUseCase extends NoInputUseCase<List<Invoice>> {
  /// Creates a [GetPendingInvoicesUseCase].
  GetPendingInvoicesUseCase(this._repository);

  final BillingRepository _repository;

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