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

/// Use case for fetching the list of hubs.
///
/// This use case retrieves all hubs associated with the current client
/// by interacting with the [HubRepositoryInterface].
class GetHubsUseCase implements NoInputUseCase<List<Hub>> {

  /// Creates a [GetHubsUseCase].
  ///
  /// Requires a [HubRepositoryInterface] to fetch the data.
  GetHubsUseCase(this._repository);
  final HubRepositoryInterface _repository;

  @override
  Future<List<Hub>> call() {
    return _repository.getHubs();
  }
}
