import 'package:account/src/core/data/datasource/account_remote_datasource.dart';
import 'package:account/src/core/domain/repositories/account_repository.dart';
import 'package:account/src/features/change_password/domain/models/entities/change_password_request_entity.dart';
import 'package:legacy_shared/src/data/models/entities/device_entity.dart';
import 'package:account/src/features/linked_devices/domain/entities/update_device_request_entity.dart';
import 'package:account/src/features/personal_data/domain/entities/update_user_request_entity.dart';
import 'package:legacy_shared/legacy_shared.dart';

class AccountRepositoryImpl implements AccountRepository {
  const AccountRepositoryImpl(this._remote);

  final AccountRemoteDatasource _remote;

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

  @override
  Future<void> deleteDevice({required String userId, required String deviceId}) {
    return _remote.deleteDevice(userId: userId, deviceId: deviceId);
  }

  @override
  Future<void> updateDevice({required String userId, required String deviceId, required UpdateDeviceRequestEntity request}) {
    return _remote.updateDevice(userId: userId, deviceId: deviceId, request: request);
  }

  @override
  Future<void> updateUser({required String userId, required UpdateUserRequestEntity request}) {
    return _remote.updateUser(userId: userId, request: request);
  }

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

  @override
  Future<void> deleteAppUser({required String userId}) {
    return _remote.deleteAppUser(userId: userId);
  }

  @override
  Future<void> changePassword({required String userId, required ChangePasswordRequestEntity request}) {
    return _remote.changePassword(userId: userId, request: request);
  }
}
