Skip to content

Commit

Permalink
backup
Browse files Browse the repository at this point in the history
  • Loading branch information
itsPronay committed Jan 24, 2025
1 parent a2a64ee commit 32bf511
Show file tree
Hide file tree
Showing 98 changed files with 3,233 additions and 1,346 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.accounts.loan.LoanWithAssociations
import rx.Observable
import com.mifos.room.entities.accounts.loans.LoanWithAssociations

/**
* Created by Aditya Gupta on 08/08/23.
*/
interface LoanAccountSummaryRepository {

fun getLoanById(loanId: Int): Observable<LoanWithAssociations>
suspend fun getLoanById(loanId: Int): LoanWithAssociations
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,21 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.accounts.loan.LoanRepaymentRequest
import com.mifos.core.entity.templates.loans.LoanRepaymentTemplate
import com.mifos.core.objects.account.loan.LoanRepaymentResponse
import rx.Observable
import com.mifos.room.entities.accounts.loans.LoanRepaymentRequest
import com.mifos.room.entities.accounts.loans.LoanRepaymentResponse
import com.mifos.room.entities.templates.loans.LoanRepaymentTemplate

/**
* Created by Aditya Gupta on 10/08/23.
*/
interface LoanRepaymentRepository {

fun getLoanRepayTemplate(loanId: Int): Observable<LoanRepaymentTemplate>
suspend fun getLoanRepayTemplate(loanId: Int): LoanRepaymentTemplate

fun submitPayment(
loanId: Int,
request: LoanRepaymentRequest,
): Observable<LoanRepaymentResponse>
): LoanRepaymentResponse

fun getDatabaseLoanRepaymentByLoanId(loanId: Int): Observable<LoanRepaymentRequest>
suspend fun getDatabaseLoanRepaymentByLoanId(loanId: Int): LoanRepaymentRequest?
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.accounts.loan.LoanWithAssociations
import rx.Observable
import com.mifos.room.entities.accounts.loans.LoanWithAssociations
import kotlinx.coroutines.flow.Flow

/**
* Created by Aditya Gupta on 12/08/23.
*/
interface LoanRepaymentScheduleRepository {

fun getLoanRepaySchedule(loanId: Int): Observable<LoanWithAssociations>
fun getLoanRepaySchedule(loanId: Int): Flow<LoanWithAssociations>
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.accounts.loan.LoanWithAssociations
import rx.Observable
import com.mifos.room.entities.accounts.loans.LoanWithAssociations
import kotlinx.coroutines.flow.Flow

/**
* Created by Aditya Gupta on 12/08/23.
*/
interface LoanTransactionsRepository {

fun getLoanTransactions(loan: Int): Observable<LoanWithAssociations>
fun getLoanTransactions(loan: Int): Flow<LoanWithAssociations>
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.accounts.loan.LoanRepaymentRequest
import com.mifos.core.entity.accounts.savings.SavingsAccountTransactionRequest
import com.mifos.core.entity.center.CenterPayload
import com.mifos.core.entity.client.ClientPayload
import com.mifos.core.entity.group.GroupPayload
import com.mifos.room.entities.accounts.loans.LoanRepaymentRequest
import kotlinx.coroutines.flow.Flow
import rx.Observable

/**
Expand All @@ -27,7 +28,7 @@ interface OfflineDashboardRepository {

fun allDatabaseCenterPayload(): Observable<List<CenterPayload>>

fun databaseLoanRepayments(): Observable<List<LoanRepaymentRequest>>
fun databaseLoanRepayments(): Flow<List<LoanRepaymentRequest>>

fun allSavingsAccountTransactions(): Observable<List<SavingsAccountTransactionRequest>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.accounts.loan.LoanWithAssociations
import com.mifos.core.entity.accounts.savings.SavingsAccountWithAssociations
import com.mifos.core.entity.client.Client
import com.mifos.core.entity.group.Center
import com.mifos.core.entity.group.Group
import com.mifos.core.entity.templates.loans.LoanRepaymentTemplate
import com.mifos.core.entity.templates.savings.SavingsAccountTransactionTemplate
import com.mifos.room.entities.accounts.CenterAccounts
import com.mifos.room.entities.accounts.ClientAccounts
import com.mifos.room.entities.accounts.GroupAccounts
import com.mifos.room.entities.accounts.loans.LoanWithAssociations
import com.mifos.room.entities.group.CenterWithAssociations
import com.mifos.room.entities.group.GroupWithAssociations
import com.mifos.room.entities.templates.loans.LoanRepaymentTemplate
import rx.Observable

/**
Expand All @@ -30,9 +30,9 @@ interface SyncCentersDialogRepository {

fun syncCenterAccounts(centerId: Int): Observable<CenterAccounts>

fun syncLoanById(loanId: Int): Observable<LoanWithAssociations>
suspend fun syncLoanById(loanId: Int): LoanWithAssociations

fun syncLoanRepaymentTemplate(loanId: Int): Observable<LoanRepaymentTemplate>
suspend fun syncLoanRepaymentTemplate(loanId: Int): LoanRepaymentTemplate

fun getCenterWithAssociations(centerId: Int): Observable<CenterWithAssociations>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.accounts.loan.LoanWithAssociations
import com.mifos.core.entity.accounts.savings.SavingsAccountWithAssociations
import com.mifos.core.entity.client.Client
import com.mifos.core.entity.templates.loans.LoanRepaymentTemplate
import com.mifos.core.entity.templates.savings.SavingsAccountTransactionTemplate
import com.mifos.room.entities.accounts.ClientAccounts
import com.mifos.room.entities.accounts.loans.LoanWithAssociations
import com.mifos.room.entities.templates.loans.LoanRepaymentTemplate
import rx.Observable

/**
Expand All @@ -24,9 +24,9 @@ interface SyncClientsDialogRepository {

suspend fun syncClientAccounts(clientId: Int): ClientAccounts

fun syncLoanById(loanId: Int): Observable<LoanWithAssociations>
suspend fun syncLoanById(loanId: Int): LoanWithAssociations

fun syncLoanRepaymentTemplate(loanId: Int): Observable<LoanRepaymentTemplate>
suspend fun syncLoanRepaymentTemplate(loanId: Int): LoanRepaymentTemplate

fun syncSavingsAccount(
type: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.accounts.loan.LoanWithAssociations
import com.mifos.core.entity.accounts.savings.SavingsAccountWithAssociations
import com.mifos.core.entity.client.Client
import com.mifos.core.entity.group.Group
import com.mifos.core.entity.templates.loans.LoanRepaymentTemplate
import com.mifos.core.entity.templates.savings.SavingsAccountTransactionTemplate
import com.mifos.room.entities.accounts.ClientAccounts
import com.mifos.room.entities.accounts.GroupAccounts
import com.mifos.room.entities.accounts.loans.LoanWithAssociations
import com.mifos.room.entities.group.GroupWithAssociations
import com.mifos.room.entities.templates.loans.LoanRepaymentTemplate
import rx.Observable

/**
Expand All @@ -27,9 +27,9 @@ interface SyncGroupsDialogRepository {

fun syncGroupAccounts(groupId: Int): Observable<GroupAccounts>

fun syncLoanById(loanId: Int): Observable<LoanWithAssociations>
suspend fun syncLoanById(loanId: Int): LoanWithAssociations

fun syncLoanRepaymentTemplate(loanId: Int): Observable<LoanRepaymentTemplate>
suspend fun syncLoanRepaymentTemplate(loanId: Int): LoanRepaymentTemplate

fun syncSavingsAccount(
type: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.accounts.loan.LoanRepaymentRequest
import com.mifos.core.objects.account.loan.LoanRepaymentResponse
import com.mifos.room.entities.PaymentTypeOption
import rx.Observable
import com.mifos.room.entities.accounts.loans.LoanRepaymentRequest
import com.mifos.room.entities.accounts.loans.LoanRepaymentResponse
import kotlinx.coroutines.flow.Flow

interface SyncLoanRepaymentTransactionRepository {

fun databaseLoanRepayments(): Observable<List<LoanRepaymentRequest>>
fun databaseLoanRepayments(): Flow<List<LoanRepaymentRequest>>

fun paymentTypeOption(): Observable<List<PaymentTypeOption>>
fun paymentTypeOption(): Flow<List<PaymentTypeOption>>

fun submitPayment(
suspend fun submitPayment(
loanId: Int,
request: LoanRepaymentRequest,
): Observable<LoanRepaymentResponse>
): LoanRepaymentResponse

fun deleteAndUpdateLoanRepayments(loanId: Int): Observable<List<LoanRepaymentRequest>>
suspend fun deleteAndUpdateLoanRepayments(loanId: Int): Flow<List<LoanRepaymentRequest>>

fun updateLoanRepaymentTransaction(
suspend fun updateLoanRepaymentTransaction(
loanRepaymentRequest: LoanRepaymentRequest,
): Observable<LoanRepaymentRequest>
): LoanRepaymentRequest
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package com.mifos.core.data.repository
import com.mifos.core.entity.accounts.savings.SavingsAccountTransactionRequest
import com.mifos.core.objects.account.saving.SavingsAccountTransactionResponse
import com.mifos.room.entities.PaymentTypeOption
import kotlinx.coroutines.flow.Flow
import rx.Observable

/**
Expand All @@ -21,7 +22,7 @@ interface SyncSavingsAccountTransactionRepository {

fun allSavingsAccountTransactions(): Observable<List<SavingsAccountTransactionRequest>>

fun paymentTypeOption(): Observable<List<PaymentTypeOption>>
fun paymentTypeOption(): Flow<List<PaymentTypeOption>>

fun processTransaction(
savingsAccountType: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
package com.mifos.core.data.repositoryImp

import com.mifos.core.data.repository.LoanAccountSummaryRepository
import com.mifos.core.entity.accounts.loan.LoanWithAssociations
import com.mifos.core.network.datamanager.DataManagerLoan
import rx.Observable
import com.mifos.room.entities.accounts.loans.LoanWithAssociations
import javax.inject.Inject

/**
Expand All @@ -21,7 +20,7 @@ import javax.inject.Inject
class LoanAccountSummaryRepositoryImp @Inject constructor(private val dataManagerLoan: DataManagerLoan) :
LoanAccountSummaryRepository {

override fun getLoanById(loanId: Int): Observable<LoanWithAssociations> {
override suspend fun getLoanById(loanId: Int): LoanWithAssociations {
return dataManagerLoan.getLoanById(loanId)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
package com.mifos.core.data.repositoryImp

import com.mifos.core.data.repository.LoanRepaymentRepository
import com.mifos.core.entity.accounts.loan.LoanRepaymentRequest
import com.mifos.core.entity.templates.loans.LoanRepaymentTemplate
import com.mifos.core.network.datamanager.DataManagerLoan
import com.mifos.core.objects.account.loan.LoanRepaymentResponse
import rx.Observable
import com.mifos.room.entities.accounts.loans.LoanRepaymentRequest
import com.mifos.room.entities.accounts.loans.LoanRepaymentResponse
import com.mifos.room.entities.templates.loans.LoanRepaymentTemplate
import javax.inject.Inject

/**
Expand All @@ -23,18 +22,18 @@ import javax.inject.Inject
class LoanRepaymentRepositoryImp @Inject constructor(private val dataManagerLoan: DataManagerLoan) :
LoanRepaymentRepository {

override fun getLoanRepayTemplate(loanId: Int): Observable<LoanRepaymentTemplate> {
override suspend fun getLoanRepayTemplate(loanId: Int): LoanRepaymentTemplate {
return dataManagerLoan.getLoanRepayTemplate(loanId)
}

override fun submitPayment(
loanId: Int,
request: LoanRepaymentRequest,
): Observable<LoanRepaymentResponse> {
): LoanRepaymentResponse {
return submitPayment(loanId, request)
}

override fun getDatabaseLoanRepaymentByLoanId(loanId: Int): Observable<LoanRepaymentRequest> {
override suspend fun getDatabaseLoanRepaymentByLoanId(loanId: Int): LoanRepaymentRequest {
return dataManagerLoan.getDatabaseLoanRepaymentByLoanId(loanId)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
package com.mifos.core.data.repositoryImp

import com.mifos.core.data.repository.LoanRepaymentScheduleRepository
import com.mifos.core.entity.accounts.loan.LoanWithAssociations
import com.mifos.core.network.DataManager
import rx.Observable
import com.mifos.room.entities.accounts.loans.LoanWithAssociations
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

/**
Expand All @@ -21,7 +21,7 @@ import javax.inject.Inject
class LoanRepaymentScheduleRepositoryImp @Inject constructor(private val dataManager: DataManager) :
LoanRepaymentScheduleRepository {

override fun getLoanRepaySchedule(loanId: Int): Observable<LoanWithAssociations> {
override fun getLoanRepaySchedule(loanId: Int): Flow<LoanWithAssociations> {
return dataManager.getLoanRepaySchedule(loanId)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
package com.mifos.core.data.repositoryImp

import com.mifos.core.data.repository.LoanTransactionsRepository
import com.mifos.core.entity.accounts.loan.LoanWithAssociations
import com.mifos.core.network.DataManager
import rx.Observable
import com.mifos.room.entities.accounts.loans.LoanWithAssociations
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

/**
Expand All @@ -21,7 +21,7 @@ import javax.inject.Inject
class LoanTransactionsRepositoryImp @Inject constructor(private val dataManager: DataManager) :
LoanTransactionsRepository {

override fun getLoanTransactions(loan: Int): Observable<LoanWithAssociations> {
override fun getLoanTransactions(loan: Int): Flow<LoanWithAssociations> {
return dataManager.getLoanTransactions(loan)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package com.mifos.core.data.repositoryImp

import com.mifos.core.data.repository.OfflineDashboardRepository
import com.mifos.core.entity.accounts.loan.LoanRepaymentRequest
import com.mifos.core.entity.accounts.savings.SavingsAccountTransactionRequest
import com.mifos.core.entity.center.CenterPayload
import com.mifos.core.entity.client.ClientPayload
Expand All @@ -20,6 +19,8 @@ import com.mifos.core.network.datamanager.DataManagerClient
import com.mifos.core.network.datamanager.DataManagerGroups
import com.mifos.core.network.datamanager.DataManagerLoan
import com.mifos.core.network.datamanager.DataManagerSavings
import com.mifos.room.entities.accounts.loans.LoanRepaymentRequest
import kotlinx.coroutines.flow.Flow
import rx.Observable
import javax.inject.Inject

Expand All @@ -46,7 +47,7 @@ class OfflineDashboardRepositoryImp @Inject constructor(
return dataManagerCenter.allDatabaseCenterPayload
}

override fun databaseLoanRepayments(): Observable<List<LoanRepaymentRequest>> {
override fun databaseLoanRepayments(): Flow<List<LoanRepaymentRequest>> {
return dataManagerLoan.databaseLoanRepayments
}

Expand Down
Loading

0 comments on commit 32bf511

Please sign in to comment.