import 'package:krow_core/core.dart';
import '../arguments/save_emergency_contacts_arguments.dart';
import '../repositories/emergency_contact_repository_interface.dart';

/// Use case for saving emergency contacts.
///
/// This use case encapsulates the business logic for saving emergency contacts
/// for a specific staff member.
class SaveEmergencyContactsUseCase
    extends UseCase<SaveEmergencyContactsArguments, void> {
  final EmergencyContactRepositoryInterface _repository;

  /// Creates a [SaveEmergencyContactsUseCase].
  SaveEmergencyContactsUseCase(this._repository);

  @override
  Future<void> call(SaveEmergencyContactsArguments params) {
    return _repository.saveContacts(params.contacts);
  }
}
