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 b36ef5c
Show file tree
Hide file tree
Showing 78 changed files with 3,334 additions and 854 deletions.
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 com.mifos.room.entities.accounts.loans.LoanWithAssociations
import rx.Observable

/**
* 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,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,26 @@
*/
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 com.mifos.room.entities.accounts.loans.LoanRepaymentRequest
import com.mifos.room.entities.accounts.loans.LoanRepaymentResponse
import kotlinx.coroutines.flow.Flow
import rx.Observable

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,10 +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 com.mifos.room.entities.accounts.loans.LoanRepaymentRequest
import com.mifos.room.entities.accounts.loans.LoanRepaymentResponse
import com.mifos.room.entities.templates.loans.LoanRepaymentTemplate
import rx.Observable
import javax.inject.Inject

Expand All @@ -23,18 +23,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,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
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
package com.mifos.core.data.repositoryImp

import com.mifos.core.data.repository.SyncCentersDialogRepository
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.core.network.datamanager.DataManagerCenter
import com.mifos.core.network.datamanager.DataManagerClient
Expand All @@ -25,8 +23,10 @@ import com.mifos.core.network.datamanager.DataManagerSavings
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
import javax.inject.Inject

Expand All @@ -45,11 +45,11 @@ class SyncCentersDialogRepositoryImp @Inject constructor(
return dataManagerCenter.syncCenterAccounts(centerId)
}

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
package com.mifos.core.data.repositoryImp

import com.mifos.core.data.repository.SyncClientsDialogRepository
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.core.network.datamanager.DataManagerClient
import com.mifos.core.network.datamanager.DataManagerLoan
import com.mifos.core.network.datamanager.DataManagerSavings
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
import javax.inject.Inject

Expand All @@ -35,11 +35,11 @@ class SyncClientsDialogRepositoryImp @Inject constructor(
return dataManagerClient.getClientAccounts(clientId)
}

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
package com.mifos.core.data.repositoryImp

import com.mifos.core.data.repository.SyncGroupsDialogRepository
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.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.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
import javax.inject.Inject

Expand All @@ -40,11 +40,11 @@ class SyncGroupsDialogRepositoryImp @Inject constructor(
return dataManagerGroups.syncGroupAccounts(groupId)
}

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

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

Expand Down
Loading

0 comments on commit b36ef5c

Please sign in to comment.