Skip to content

Commit

Permalink
Feat: Migrating database module from dbflow to room db (openMF#2286)
Browse files Browse the repository at this point in the history
* MIFOSAC-278
adding entities for the migration. here we have added entities for accounts package

* MIFOSAC-278
adding entities for the migration. here we have added entities for center, client, collection sheet,group, navigation package

* MIFOSAC-278
due date type converter and database module cache issue solved

* MIFOSAC-278
added entities fir the rest of the modules

* MIFOSAC-278
migrated model package to the room related package
  • Loading branch information
Darkeye14 authored Jan 17, 2025
1 parent 8394f52 commit 5a80565
Show file tree
Hide file tree
Showing 220 changed files with 3,348 additions and 261 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.group.CenterWithAssociations
import com.mifos.core.objects.groups.CenterInfo
import com.mifos.room.entities.group.CenterWithAssociations
import kotlinx.coroutines.flow.Flow

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

import androidx.paging.PagingData
import com.mifos.core.entity.group.Center
import com.mifos.core.entity.group.CenterWithAssociations
import com.mifos.core.objects.clients.Page
import com.mifos.room.entities.group.CenterWithAssociations
import kotlinx.coroutines.flow.Flow
import rx.Observable

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

import com.mifos.core.entity.accounts.ClientAccounts
import com.mifos.core.entity.client.Client
import com.mifos.room.entities.accounts.ClientAccounts
import okhttp3.MultipartBody
import okhttp3.ResponseBody
import rx.Observable
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.collectionsheet.CenterDetail
import com.mifos.core.entity.collectionsheet.CollectionSheetPayload
import com.mifos.core.entity.collectionsheet.CollectionSheetResponse
import com.mifos.core.entity.collectionsheet.ProductiveCollectionSheetPayload
import com.mifos.core.entity.group.Center
import com.mifos.core.entity.group.CenterWithAssociations
import com.mifos.core.entity.group.Group
import com.mifos.core.network.GenericResponse
import com.mifos.core.objects.collectionsheets.CollectionSheetRequestPayload
import com.mifos.room.entities.collectionsheet.CenterDetail
import com.mifos.room.entities.collectionsheet.CollectionSheetPayload
import com.mifos.room.entities.collectionsheet.CollectionSheetResponse
import com.mifos.room.entities.collectionsheet.ProductiveCollectionSheetPayload
import com.mifos.room.entities.group.CenterWithAssociations

/**
* Created by Aditya Gupta on 12/08/23.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.accounts.GroupAccounts
import com.mifos.core.entity.group.Group
import com.mifos.core.entity.group.GroupWithAssociations
import com.mifos.room.entities.accounts.GroupAccounts
import com.mifos.room.entities.group.GroupWithAssociations
import rx.Observable

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

import com.mifos.core.entity.group.CenterWithAssociations
import com.mifos.core.entity.group.GroupWithAssociations
import com.mifos.room.entities.group.CenterWithAssociations
import com.mifos.room.entities.group.GroupWithAssociations
import rx.Observable

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

import com.mifos.core.entity.templates.loans.LoanTransactionTemplate
import com.mifos.core.network.GenericResponse
import com.mifos.core.objects.account.loan.LoanDisbursement
import com.mifos.room.entities.templates.loans.LoanTransactionTemplate
import rx.Observable

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

import com.mifos.core.entity.accounts.loan.Loans
import com.mifos.core.entity.templates.loans.LoanTemplate
import com.mifos.core.network.model.LoansPayload
import com.mifos.core.objects.organisations.LoanProducts
import com.mifos.room.entities.templates.loans.LoanTemplate
import rx.Observable

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

import com.mifos.core.entity.collectionsheet.IndividualCollectionSheet
import com.mifos.core.entity.organisation.Office
import com.mifos.core.entity.organisation.Staff
import com.mifos.core.network.model.RequestCollectionSheetPayload
import com.mifos.room.entities.collectionsheet.IndividualCollectionSheet

/**
* Created by Aditya Gupta on 10/08/23.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
*/
package com.mifos.core.data.repository

import com.mifos.core.entity.client.Savings
import com.mifos.core.entity.templates.savings.SavingProductsTemplate
import com.mifos.core.objects.organisations.ProductSavings
import com.mifos.core.payloads.SavingsPayload
import com.mifos.room.entities.client.Savings
import com.mifos.room.entities.templates.savings.SavingProductsTemplate
import rx.Observable

/**
Expand Down
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.CenterAccounts
import com.mifos.core.entity.accounts.ClientAccounts
import com.mifos.core.entity.accounts.GroupAccounts
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.CenterWithAssociations
import com.mifos.core.entity.group.Group
import com.mifos.core.entity.group.GroupWithAssociations
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.group.CenterWithAssociations
import com.mifos.room.entities.group.GroupWithAssociations
import rx.Observable

/**
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.ClientAccounts
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 rx.Observable

/**
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.ClientAccounts
import com.mifos.core.entity.accounts.GroupAccounts
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.group.GroupWithAssociations
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.group.GroupWithAssociations
import rx.Observable

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ 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

interface SyncLoanRepaymentTransactionRepository {

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

fun paymentTypeOption(): Observable<List<com.mifos.core.entity.PaymentTypeOption>>
fun paymentTypeOption(): Observable<List<PaymentTypeOption>>

fun submitPayment(
loanId: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,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 rx.Observable

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

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

fun paymentTypeOption(): Observable<List<com.mifos.core.entity.PaymentTypeOption>>
fun paymentTypeOption(): Observable<List<PaymentTypeOption>>

fun processTransaction(
savingsAccountType: String?,
Expand Down
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.CenterDetailsRepository
import com.mifos.core.entity.group.CenterWithAssociations
import com.mifos.core.network.datamanager.DataManagerCenter
import com.mifos.core.network.datamanager.DataManagerRunReport
import com.mifos.core.objects.groups.CenterInfo
import com.mifos.room.entities.group.CenterWithAssociations
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import androidx.paging.PagingData
import com.mifos.core.data.pagingSource.CenterListPagingSource
import com.mifos.core.data.repository.CenterListRepository
import com.mifos.core.entity.group.Center
import com.mifos.core.entity.group.CenterWithAssociations
import com.mifos.core.network.datamanager.DataManagerCenter
import com.mifos.core.objects.clients.Page
import com.mifos.room.entities.group.CenterWithAssociations
import kotlinx.coroutines.flow.Flow
import rx.Observable
import javax.inject.Inject
Expand Down
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.ClientDetailsRepository
import com.mifos.core.entity.accounts.ClientAccounts
import com.mifos.core.entity.client.Client
import com.mifos.core.network.datamanager.DataManagerClient
import com.mifos.room.entities.accounts.ClientAccounts
import okhttp3.MultipartBody
import okhttp3.ResponseBody
import rx.Observable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
package com.mifos.core.data.repositoryImp

import com.mifos.core.data.repository.GenerateCollectionSheetRepository
import com.mifos.core.entity.collectionsheet.CenterDetail
import com.mifos.core.entity.collectionsheet.CollectionSheetPayload
import com.mifos.core.entity.collectionsheet.CollectionSheetResponse
import com.mifos.core.entity.collectionsheet.ProductiveCollectionSheetPayload
import com.mifos.core.entity.group.Center
import com.mifos.core.entity.group.CenterWithAssociations
import com.mifos.core.entity.group.Group
import com.mifos.core.network.DataManager
import com.mifos.core.network.GenericResponse
import com.mifos.core.network.datamanager.DataManagerCollectionSheet
import com.mifos.core.objects.collectionsheets.CollectionSheetRequestPayload
import com.mifos.room.entities.collectionsheet.CenterDetail
import com.mifos.room.entities.collectionsheet.CollectionSheetPayload
import com.mifos.room.entities.collectionsheet.CollectionSheetResponse
import com.mifos.room.entities.collectionsheet.ProductiveCollectionSheetPayload
import com.mifos.room.entities.group.CenterWithAssociations
import javax.inject.Inject

/**
Expand Down
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.GroupDetailsRepository
import com.mifos.core.entity.accounts.GroupAccounts
import com.mifos.core.entity.group.Group
import com.mifos.core.entity.group.GroupWithAssociations
import com.mifos.core.network.datamanager.DataManagerGroups
import com.mifos.room.entities.accounts.GroupAccounts
import com.mifos.room.entities.group.GroupWithAssociations
import rx.Observable
import javax.inject.Inject

Expand Down
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.GroupListRepository
import com.mifos.core.entity.group.CenterWithAssociations
import com.mifos.core.entity.group.GroupWithAssociations
import com.mifos.core.network.DataManager
import com.mifos.room.entities.group.CenterWithAssociations
import com.mifos.room.entities.group.GroupWithAssociations
import rx.Observable
import javax.inject.Inject

Expand Down
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.LoanAccountDisbursementRepository
import com.mifos.core.entity.templates.loans.LoanTransactionTemplate
import com.mifos.core.network.GenericResponse
import com.mifos.core.network.datamanager.DataManagerLoan
import com.mifos.core.objects.account.loan.LoanDisbursement
import com.mifos.room.entities.templates.loans.LoanTransactionTemplate
import rx.Observable
import javax.inject.Inject

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

import com.mifos.core.data.repository.LoanAccountRepository
import com.mifos.core.entity.accounts.loan.Loans
import com.mifos.core.entity.templates.loans.LoanTemplate
import com.mifos.core.network.datamanager.DataManagerLoan
import com.mifos.core.network.model.LoansPayload
import com.mifos.core.objects.organisations.LoanProducts
import com.mifos.room.entities.templates.loans.LoanTemplate
import rx.Observable
import javax.inject.Inject

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

import com.mifos.core.data.repository.NewIndividualCollectionSheetRepository
import com.mifos.core.entity.collectionsheet.IndividualCollectionSheet
import com.mifos.core.entity.organisation.Office
import com.mifos.core.entity.organisation.Staff
import com.mifos.core.network.DataManager
import com.mifos.core.network.datamanager.DataManagerCollectionSheet
import com.mifos.core.network.model.RequestCollectionSheetPayload
import com.mifos.room.entities.collectionsheet.IndividualCollectionSheet
import javax.inject.Inject

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

import com.mifos.core.data.repository.SavingsAccountRepository
import com.mifos.core.entity.client.Savings
import com.mifos.core.entity.templates.savings.SavingProductsTemplate
import com.mifos.core.network.datamanager.DataManagerSavings
import com.mifos.core.objects.organisations.ProductSavings
import com.mifos.core.payloads.SavingsPayload
import com.mifos.room.entities.client.Savings
import com.mifos.room.entities.templates.savings.SavingProductsTemplate
import rx.Observable
import javax.inject.Inject

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

import com.mifos.core.data.repository.SyncCentersDialogRepository
import com.mifos.core.entity.accounts.CenterAccounts
import com.mifos.core.entity.accounts.ClientAccounts
import com.mifos.core.entity.accounts.GroupAccounts
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.CenterWithAssociations
import com.mifos.core.entity.group.Group
import com.mifos.core.entity.group.GroupWithAssociations
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
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.CenterAccounts
import com.mifos.room.entities.accounts.ClientAccounts
import com.mifos.room.entities.accounts.GroupAccounts
import com.mifos.room.entities.group.CenterWithAssociations
import com.mifos.room.entities.group.GroupWithAssociations
import rx.Observable
import javax.inject.Inject

Expand Down
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.SyncClientsDialogRepository
import com.mifos.core.entity.accounts.ClientAccounts
import com.mifos.core.entity.accounts.loan.LoanWithAssociations
import com.mifos.core.entity.accounts.savings.SavingsAccountWithAssociations
import com.mifos.core.entity.client.Client
Expand All @@ -19,6 +18,7 @@ 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 rx.Observable
import javax.inject.Inject

Expand Down
Loading

0 comments on commit 5a80565

Please sign in to comment.