import 'package:functions/src/core/data/datasources/functions_remote_datasource.dart';
import 'package:functions/src/core/data/models/entities/locate_device_request_entity.dart';
import 'package:functions/src/core/data/models/entities/set_pedometer_request_entity.dart';
import 'package:functions/src/core/domain/repositories/functions_repository.dart';
import 'package:functions/src/features/activity_meter/domain/entities/activity_entity.dart';
import 'package:functions/src/features/contacts/domain/entities/contact_entity.dart';
import 'package:functions/src/features/remote_connection/domain/entities/picture_entity.dart';

class FunctionsRepositoryImpl implements FunctionsRepository {
  const FunctionsRepositoryImpl(this._remote);

  final FunctionsRemoteDatasource _remote;

  @override
  Future<List<ContactEntity>> getContacts({required String userId}) {
    return _remote.getContacts(userId: userId);
  }

  @override
  Future<List<PictureEntity>> getPictures({required String userId}) async {
    await Future<void>.delayed(const Duration(milliseconds: 2000));
    return _remote.getPictures(userId: userId);
  }

  @override
  Future<PictureEntity> takePicture({required String userId}) async {
    await Future<void>.delayed(const Duration(milliseconds: 2000));
    return _remote.takePicture(userId: userId);
  }

  @override
  Future<void> locateDevice({required LocateDeviceRequestEntity request}) async {
    await Future<void>.delayed(const Duration(milliseconds: 2000));
    return _remote.locateDevice(request: request);
  }

  @override
  Future<List<ActivityEntity>> getDeviceSteps({required String deviceId}) async {
    await Future<void>.delayed(const Duration(milliseconds: 2000));
    return _remote.getDeviceSteps(deviceId: deviceId);
  }

  @override
  Future<void> setPedometer({required SetPedometerRequestEntity request}) async {
    await Future<void>.delayed(const Duration(milliseconds: 2000));
    return _remote.setPedometer(request: request);
  }
}
