import 'package:injectable/injectable.dart';
import 'package:krow/features/profile/emergency_contacts/data/emergency_contact_api_provider.dart';
import 'package:krow/features/profile/emergency_contacts/data/emergency_contact_repository.dart';
import 'package:krow/features/profile/emergency_contacts/data/models/emergency_contact_model.dart';

@LazySingleton(as: EmergencyContactRepository)
class EmergencyContactRepositoryImpl implements EmergencyContactRepository {
  EmergencyContactRepositoryImpl({
    required EmergencyContactApiProvider apiProvider,
  }) : _apiProvider = apiProvider;

  final EmergencyContactApiProvider _apiProvider;

  @override
  Stream<List<EmergencyContactModel>> getStaffEmergencyContacts() {
    return _apiProvider.getStaffEmergencyContacts();
  }

  @override
  Future<List<EmergencyContactModel>?> updateEmergencyContacts(
    List<EmergencyContactModel> contacts,
  ) {
    return _apiProvider.updateEmergencyContacts(contacts);
  }
}
