import 'package:injectable/injectable.dart';
import 'package:krow/core/data/models/staff/workin_area.dart';
import 'package:krow/features/profile/working_area/data/working_area_repository.dart';
import 'package:krow/features/profile/working_area/data/working_areas_api_provider.dart';

@Singleton(as: WorkingAreaRepository)
class WorkingAreaRepositoryImpl implements WorkingAreaRepository {
  final WorkingAreasApiProvider _apiProvider;

  WorkingAreaRepositoryImpl({required WorkingAreasApiProvider apiProvider})
      : _apiProvider = apiProvider;

  @override
  Stream<List<WorkingArea>> getAllWorkingAreas() {
    return _apiProvider.getAllWorkingAreas();
  }

  @override
  Stream<List<WorkingArea>> getStaffWorkingAreas() {
    return _apiProvider.getStaffWorkingAreas();
  }

  @override
  Future<void> saveWorkingArea(List<String> ids) {
    return _apiProvider.putWorkingAreas(ids);
  }
}
