import 'package:rasadyar_inspection/data/data_source/remote/auth/auth_remote.dart';
import 'package:rasadyar_inspection/data/model/response/auth/auth_response_model.dart';
import 'package:rasadyar_inspection/data/model/response/captcha/captcha_response_model.dart';

import 'auth_repository.dart';

class AuthRepositoryImpl implements AuthRepository {
  final AuthRemote authRemote;

  AuthRepositoryImpl(this.authRemote);

  @override
  Future<AuthResponseModel?> login({required Map<String, dynamic> authRequest}) async =>
      await authRemote.login(authRequest: authRequest);

  @override
  Future<CaptchaResponseModel?> captcha() async {
    return await authRemote.captcha();
  }

  @override
  Future<AuthResponseModel?> loginWithRefreshToken({
    required Map<String, dynamic> authRequest,
  }) async {
    return await authRemote.loginWithRefreshToken(authRequest: authRequest);
  }

  @override
  Future<void> logout() async {
    await authRemote.logout();
  }

  @override
  Future<bool> hasAuthenticated() async {
    return await authRemote.hasAuthenticated();
  }
}
