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

/// Use case for assigning an NFC tag to a hub.
///
/// This use case handles the association of a physical NFC tag with a specific
/// hub by calling the [HubRepositoryInterface].
class AssignNfcTagUseCase implements UseCase<AssignNfcTagArguments, void> {

  /// Creates an [AssignNfcTagUseCase].
  ///
  /// Requires a [HubRepositoryInterface] to interact with the backend.
  AssignNfcTagUseCase(this._repository);
  final HubRepositoryInterface _repository;

  @override
  Future<void> call(AssignNfcTagArguments arguments) {
    return _repository.assignNfcTag(
      hubId: arguments.hubId,
      nfcTagId: arguments.nfcTagId,
    );
  }
}
