Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
itsPronay committed Jan 25, 2025
1 parent ad07a66 commit 9dc6470
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,57 +296,8 @@ class SyncCentersDialogViewModel @Inject constructor(
onAccountSyncFailed(e)
}
}
// getLoanAndLoanRepayment(loanId)
// .subscribe(
// object : Subscriber<LoanAndLoanRepayment>() {
// override fun onCompleted() {}
// override fun onError(e: Throwable) {
// onAccountSyncFailed(e)
// }
//
// override fun onNext(loanAndLoanRepayment: LoanAndLoanRepayment) {
// mLoanAndRepaymentSyncIndex += 1
// _syncCenterData.update { it.copy(singleSyncCount = mLoanAndRepaymentSyncIndex) }
// if (mLoanAndRepaymentSyncIndex != mLoanAccountList.size) {
// checkNetworkConnectionAndSyncLoanAndLoanRepayment()
// } else {
// setLoanAccountSyncStatusTrue()
// checkAccountsSyncStatusAndSyncAccounts()
// }
// }
// },
// )
}

// /**
// * This Method Syncing the Member's Loan and their LoanRepayment. This is the
// * Observable.combineLatest In Which two request is going to server Loans and LoanRepayment
// * and This request will not complete till that both request completed successfully with
// * response (200 OK). If one will fail then response will come in onError. and If both
// * request is 200 response then response will come in onNext.
// *
// * @param loanId Loan Id
// */
// private fun syncMemberLoanAndMemberLoanRepayment(loanId: Int) {
// getLoanAndLoanRepayment(loanId)
// .subscribe(object : Subscriber<LoanAndLoanRepayment>() {
// override fun onCompleted() {}
// override fun onError(e: Throwable) {
// onAccountSyncFailed(e)
// }
//
// override fun onNext(loanAndLoanRepayment: LoanAndLoanRepayment) {
// mMemberLoanSyncIndex += 1
// _syncCenterData.update { it.copy(singleSyncCount = mLoanAndRepaymentSyncIndex + mSavingsAndTransactionSyncIndex + mMemberLoanSyncIndex) }
// if (mMemberLoanSyncIndex != mMemberLoanAccountsList.size) {
// checkNetworkConnectionAndSyncMemberLoanAndMemberLoanRepayment()
// } else {
// mCenterList[mCenterSyncIndex].id?.let { loadCenterAssociateGroups(it) }
// }
// }
// })
// }

/**
* This Method Fetching the SavingsAccount and SavingsAccountTransactionTemplate and Syncing
* them in Database table.
Expand Down Expand Up @@ -723,7 +674,7 @@ class SyncCentersDialogViewModel @Inject constructor(
private fun syncGroupLoanAndLoanRepayment(loanId: Int) {
viewModelScope.launch {
try {
getLoanAndLoanRepayment(loanId)
getLoanAndLoanRepayment(loanId)

mLoanAndRepaymentSyncIndex += 1
if (mLoanAndRepaymentSyncIndex != mLoanAccountList.size) {
Expand All @@ -740,29 +691,6 @@ class SyncCentersDialogViewModel @Inject constructor(
onAccountSyncFailed(e)
}
}
// getLoanAndLoanRepayment(loanId)
// .subscribe(
// object : Subscriber<LoanAndLoanRepayment>() {
// override fun onCompleted() {}
// override fun onError(e: Throwable) {
// onAccountSyncFailed(e)
// }
//
// override fun onNext(loanAndLoanRepayment: LoanAndLoanRepayment) {
// mLoanAndRepaymentSyncIndex += 1
// if (mLoanAndRepaymentSyncIndex != mLoanAccountList.size) {
// mLoanAccountList[mLoanAndRepaymentSyncIndex].id?.let {
// syncGroupLoanAndLoanRepayment(
// it,
// )
// }
// } else {
// setLoanAccountSyncStatusTrue()
// checkAccountsSyncStatusAndSyncGroupAccounts()
// }
// }
// },
// )
}

/**
Expand Down Expand Up @@ -794,29 +722,6 @@ class SyncCentersDialogViewModel @Inject constructor(
onAccountSyncFailed(e)
}
}
// getLoanAndLoanRepayment(loanId)
// .subscribe(
// object : Subscriber<LoanAndLoanRepayment>() {
// override fun onCompleted() {}
// override fun onError(e: Throwable) {
// onAccountSyncFailed(e)
// }
//
// override fun onNext(loanAndLoanRepayment: LoanAndLoanRepayment) {
// mLoanAndRepaymentSyncIndex += 1
// if (mLoanAndRepaymentSyncIndex != mLoanAccountList.size) {
// mLoanAccountList[mLoanAndRepaymentSyncIndex].id?.let {
// syncClientLoanAndLoanRepayment(
// it,
// )
// }
// } else {
// setLoanAccountSyncStatusTrue()
// checkAccountsSyncStatusAndSyncClientAccounts()
// }
// }
// },
// )
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.mifos.core.common.utils.Constants
import com.mifos.core.common.utils.Resource
import com.mifos.core.data.repository.LoanAccountSummaryRepository
import com.mifos.core.domain.useCases.GetLoanByIdUseCase
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import androidx.lifecycle.viewModelScope
import com.google.gson.Gson
import com.mifos.core.common.utils.Constants
import com.mifos.core.common.utils.Resource
import com.mifos.core.data.repository.LoanRepaymentRepository
import com.mifos.core.domain.useCases.GetDatabaseLoanRepaymentByLoanIdUseCase
import com.mifos.core.domain.useCases.LoadLoanRepaymentTemplateUseCase
import com.mifos.core.domain.useCases.SubmitPaymentUseCase
Expand Down

0 comments on commit 9dc6470

Please sign in to comment.