import 'package:auth/src/core/data/datasource/auth_remote_datasource.dart';
import 'package:auth/src/core/domain/repositories/auth_repository.dart';
import 'package:auth/src/features/sign_up/domain/entities/sign_up_request_entity.dart';
import 'package:auth/src/features/sign_up/domain/entities/two_fa_secret_entity.dart';

class AuthRepositoryImpl implements AuthRepository {
  const AuthRepositoryImpl(this._remote);

  final AuthRemoteDatasource _remote;

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

  @override
  Future<void> verifyPhoneCode({required String phone, required String code}) {
    return _remote.verifyPhoneCode(phone: phone, code: code);
  }

  @override
  Future<String> login({required String email, required String password}) {
    return _remote.login(email: email, password: password);
  }

  @override
  Future<void> twoFactor({required String token, required String code}) {
    return _remote.twoFALogin(token: token, code: code);
  }

  @override
  Future<String> signUp({required SignUpRequestEntity request}) {
    return _remote.signUp(request: request);
  }

  @override
  Future<TwoFASecretEntity> generateTwoFASignUp({required String token}) {
    return _remote.generateTwoFASignUp(token: token);
  }

  @override
  Future<void> verifyTwoFACodeSignUp({
    required String token,
    required String code,
  }) {
    return _remote.verifyTwoFACodeSignUp(token: token, code: code);
  }
}
