

import '../../../models/AddNewAccountRequestModel.dart';
import '../../../models/AuthenticationRequest.dart';
import '../../../models/BeneficiaryAccountModel.dart';
import '../../../models/ChangeTransactionPinRequest.dart';
import '../../../models/CreateTransactionPinOTPRequest.dart';
import '../../../models/CreateTransactionPinRequest.dart';
import '../../../models/GLACCAddMoneyRequestModel.dart';
import '../../../models/RegisterRequest.dart';
import '../../../models/SignupOtpRequest.dart';
import '../../../models/SignupStep3RequestModel.dart';
import '../../../models/TransactionPinRequestModel.dart';
import '../../../models/TransactionSubmitRequestModel.dart';
import '../../../models/VerifyLoginOtpRequest.dart';
import '../../../models/accept_receive_transaction.dart';
import '../../../models/chanange_password_params.dart';
import '../../../models/resen_ot_chanange_trans_pin.dart';
import '../../../models/resend_ot_login_model.dart';
import '../../../models/resend_otp_usend.dart';
import '../../../models/upload_user_profile_model.dart';
import '../../config/server_response.dart';
import '../data_source_auth/remote_data_source/app_remote_data_source.dart';

abstract class AppRepositories {
  Future<ServerResponse> login(AuthenticationRequest request);

  Future<ServerResponse> validateLoginPin(VerifyLoginOtpRequest request);

  Future<ServerResponse> fetchAccountDetails();

  Future<ServerResponse> fetchGlsAccounts();

  Future<ServerResponse> fetchAccountInquiry(String type, String value);

  Future<ServerResponse> fetchDepositAccountTransactions(String accountNumber, String fromDate, String toDate);

  Future<ServerResponse> fetchExchangeRate();

  Future<ServerResponse> createTransactionPinOTP(CreateTransactionPinOTPRequest requestModel);

  Future<ServerResponse> createTransactionPin(CreateTransactionPinRequest requestModel);

  Future<ServerResponse> uploadUserProfilePicture(UploadUserProfileModel requestModel);

  Future<ServerResponse> changeTransactionPin(ChangeTransactionPinRequest requestModel);

  Future<ServerResponse> sendTransactionStep1(TransactionPinRequestModel transactionPinRequestModel);

  Future<ServerResponse> sendAddMoneyOtp(TransactionPinRequestModel transactionPinRequestModel);

  Future<ServerResponse> sendTransactionStep2(TransactionSubmitRequestModel transactionSubmitRequestModel);

  Future<ServerResponse> sendAddMoneyTransaction(GLACCAddMoneyRequestModel transactionSubmitRequestModel);

  Future<ServerResponse> acceptReceiveTransaction(AcceptReceiveTransactionModel requestModel);

  Future<ServerResponse> reverseTransaction(String nodeId, String sgtGntrnumber);

  Future<ServerResponse> addNewBeneficiary(BeneficiaryAccountModel requestModel);

  Future<ServerResponse> fetchAllBeneficiary(String porOrgacode, String email);

  Future<ServerResponse> deleteBeneficiary(String mbmBkmsnumberRef, String email, String porOrgacode);

  Future<ServerResponse> signupStep1(RegisterRequest registerRequest);

  Future<ServerResponse> signupStep2(SignupOtpRequest signupOtpRequest);

  Future<ServerResponse> signupStep3(SignupStep3RequestModel signupStep3RequestModel);

  Future<ServerResponse> changePassword(ChangePasswordParams changePasswordParams);

  Future<ServerResponse> getPendingTransition(String accountNumber);

  Future<ServerResponse> fetchAccountStatement(String accountNumber);

  Future<ServerResponse> fetchUserActivity(String fromDate, String toDate);

  Future<ServerResponse> resentOtpLoginSignUp(ResendOtpLoginModel model);

  Future<ServerResponse> getCurrencyList();

  Future<ServerResponse> addNewAccount(AddNewAccountRequestModel addNewAccountRequest);

  Future<ServerResponse> resendOtpUsend(ResendOtpUsendModel resendOtpUsendModel);

  Future<ServerResponse> resendOtpTransPin(ResendOtpChangeTransPin resendOtpChangeTransPin);

  Future<ServerResponse> createPinResndOtp(CreateTransactionPinOTPRequest createTransactionPinRequest);

  Future<ServerResponse> getConvertedCurrency(String baseCurrency, String targetCurrency, String sgtGntramtfc);
}

class AppRepositoriesImpl implements AppRepositories {
  AppRemoteDataSource remoteDataSource;

  AppRepositoriesImpl({required this.remoteDataSource});

  @override
  Future<ServerResponse> login(AuthenticationRequest requestModel) {
    return remoteDataSource.getLoginOTP(requestModel);
  }

  @override
  Future<ServerResponse> fetchAccountDetails() {
    return remoteDataSource.fetchAccountDetails();
  }

  @override
  Future<ServerResponse> fetchAccountInquiry(String type, String value) {
    return remoteDataSource.fetchAccountInquiry(type, value);
  }

  ///
  @override
  Future<ServerResponse> validateLoginPin(VerifyLoginOtpRequest requestModel) {
    return remoteDataSource.validateLoginPin(requestModel);
  }

  @override
  Future<ServerResponse> fetchDepositAccountTransactions(String accountNumber, String fromDate, String toDate) {
    return remoteDataSource.fetchDepositAccountTransactions(accountNumber, fromDate, toDate);
  }

  @override
  Future<ServerResponse> fetchExchangeRate() {
    return remoteDataSource.fetchExchangeRate();
  }

  @override
  Future<ServerResponse> sendTransactionStep1(TransactionPinRequestModel transactionPinRequestModel) {
    return remoteDataSource.sendTransactionStep1(transactionPinRequestModel);
  }

  //
  @override
  Future<ServerResponse> sendTransactionStep2(TransactionSubmitRequestModel transactionSubmitRequestModel) {
    return remoteDataSource.sendTransactionStep2(transactionSubmitRequestModel);
  }

  @override
  Future<ServerResponse> sendAddMoneyOtp(TransactionPinRequestModel transactionPinRequestModel) {
    return remoteDataSource.sendAddMoneyOtp(transactionPinRequestModel);
  }

  @override
  Future<ServerResponse> sendAddMoneyTransaction(GLACCAddMoneyRequestModel transactionSubmitRequestModel) {
    return remoteDataSource.sendAddMoneyTransaction(transactionSubmitRequestModel);
  }

  @override
  Future<ServerResponse> signupStep1(RegisterRequest registerRequest) {
    return remoteDataSource.signupStep1(registerRequest);
  }

  @override
  Future<ServerResponse> signupStep2(SignupOtpRequest signupOtpRequest) {
    return remoteDataSource.signupStep2(signupOtpRequest);
  }

  @override
  Future<ServerResponse> signupStep3(SignupStep3RequestModel signupStep3RequestModel) {
    return remoteDataSource.signupStep3(signupStep3RequestModel);
  }

  @override
  Future<ServerResponse> changePassword(ChangePasswordParams changePasswordParams) {
    return remoteDataSource.changePassword(changePasswordParams);
  }

  @override
  Future<ServerResponse> getPendingTransition(String accountNumber) {
    return remoteDataSource.getPendingTransition(accountNumber);
  }

  @override
  Future<ServerResponse> createTransactionPinOTP(CreateTransactionPinOTPRequest requestModel) {
    return remoteDataSource.createTransactionPinOTP(requestModel);
  }

  @override
  Future<ServerResponse> createTransactionPin(CreateTransactionPinRequest requestModel) {
    return remoteDataSource.createTransactionPin(requestModel);
  }

  @override
  Future<ServerResponse> changeTransactionPin(ChangeTransactionPinRequest requestModel) {
    return remoteDataSource.changeTransactionPin(requestModel);
  }

  @override
  Future<ServerResponse> acceptReceiveTransaction(AcceptReceiveTransactionModel requestModel) {
    return remoteDataSource.acceptReceiveTransition(requestModel);
  }

  @override
  Future<ServerResponse> fetchAccountStatement(String accountNumber) {
    return remoteDataSource.fetchAccountStatement(accountNumber);
  }

  @override
  Future<ServerResponse> fetchUserActivity(String fromDate, String toDate) {
    return remoteDataSource.fetchUserActivity(fromDate, toDate);
  }

  @override
  Future<ServerResponse> getCurrencyList() {
    return remoteDataSource.getCurrencyList();
  }

  @override
  Future<ServerResponse> fetchGlsAccounts() {
    return remoteDataSource.fetchGlsAllAccounts();
  }

  @override
  Future<ServerResponse> getConvertedCurrency(String baseCurrency, String targetCurrency, String sgtGntramtfc) {
    return remoteDataSource.getConvertedCurrency(baseCurrency, targetCurrency, sgtGntramtfc);
  }

  @override
  Future<ServerResponse> addNewAccount(AddNewAccountRequestModel addNewAccountRequest) {
    return remoteDataSource.addNewAccount(addNewAccountRequest);
  }

  @override
  Future<ServerResponse> resentOtpLoginSignUp(ResendOtpLoginModel model) {
    return remoteDataSource.resentOtpLoginSignUp(model);
  }

  @override
  Future<ServerResponse> resendOtpUsend(ResendOtpUsendModel resendOtpUsendModel) {
    return remoteDataSource.resendOtpUsend(resendOtpUsendModel);
  }

  @override
  Future<ServerResponse> resendOtpTransPin(ResendOtpChangeTransPin resendOtpChangeTransPin) {
    return remoteDataSource.resendOtpTransPin(resendOtpChangeTransPin);
  }

  @override
  Future<ServerResponse> createPinResndOtp(CreateTransactionPinOTPRequest createTransactionPinRequest) {
    return remoteDataSource.createPinResndOtp(createTransactionPinRequest);
  }

  @override
  Future<ServerResponse> uploadUserProfilePicture(UploadUserProfileModel requestModel) {
    return remoteDataSource.uploadUserProfilePicture(requestModel);
  }

  @override
  Future<ServerResponse> reverseTransaction(String nodeId, String sgtGntrnumber) {
    return remoteDataSource.reverseTransition(nodeId, sgtGntrnumber);
  }

  @override
  Future<ServerResponse> addNewBeneficiary(BeneficiaryAccountModel requestModel) {
    return remoteDataSource.addNewBeneficiary(requestModel);
  }

  @override
  Future<ServerResponse> fetchAllBeneficiary(String porOrgacode, String email) {
    return remoteDataSource.fetchAllBeneficiary(porOrgacode, email);
  }

  @override
  Future<ServerResponse> deleteBeneficiary(String mbmBkmsnumberRef, String email, String porOrgacode) {
    return remoteDataSource.deleteBeneficiary(mbmBkmsnumberRef, email, porOrgacode);
  }
}
