import 'package:injectable/injectable.dart';
import 'package:krow/features/profile/mobility/data/models/mobility_model.dart';
import 'package:krow/features/profile/mobility/data/staff_mobility_api_provider.dart';
import 'package:krow/features/profile/mobility/data/staff_mobility_repository.dart';

@LazySingleton(as: StaffMobilityRepository)
class StaffMobilityRepositoryImpl extends StaffMobilityRepository {
  StaffMobilityRepositoryImpl({
    required StaffMobilityApiProvider apiProvider,
  }) : _apiProvider = apiProvider;

  final StaffMobilityApiProvider _apiProvider;

  @override
  Stream<MobilityModel> getStaffMobility() {
    return _apiProvider.getStaffMobilityWithCache();
  }

  @override
  Future<MobilityModel?> updateStaffMobilityInfo(MobilityModel data) {
    return _apiProvider.updateStaffMobilityInfo(data);
  }
}
