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

/// Use case for deleting a hub.
///
/// This use case removes a hub from the system via the [HubRepositoryInterface].
class DeleteHubUseCase implements UseCase<DeleteHubArguments, void> {

  /// Creates a [DeleteHubUseCase].
  ///
  /// Requires a [HubRepositoryInterface] to perform the deletion.
  DeleteHubUseCase(this._repository);
  final HubRepositoryInterface _repository;

  @override
  Future<void> call(DeleteHubArguments arguments) {
    return _repository.deleteHub(arguments.hubId);
  }
}
