import 'package:krow_core/core.dart';
import 'package:krow_domain/krow_domain.dart';
import '../../domain/arguments/get_emergency_contacts_arguments.dart';
import '../../domain/repositories/emergency_contact_repository_interface.dart';

/// Use case for retrieving emergency contacts.
///
/// This use case encapsulates the business logic for fetching emergency contacts
/// for a specific staff member.
class GetEmergencyContactsUseCase
    extends UseCase<GetEmergencyContactsArguments, List<EmergencyContact>> {
  final EmergencyContactRepositoryInterface _repository;

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

  @override
  Future<List<EmergencyContact>> call(GetEmergencyContactsArguments params) {
    return _repository.getContacts(params.staffId);
  }
}
