Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import com.mifos.core.data.repository.DataTableRepository
import com.mifos.core.data.repository.DataTableRowDialogRepository
import com.mifos.core.data.repository.DocumentCreateUpdateRepository
import com.mifos.core.data.repository.DocumentListRepository
import com.mifos.core.data.repository.FixedDepositRepository
import com.mifos.core.data.repository.GenerateCollectionSheetRepository
import com.mifos.core.data.repository.GroupDetailsRepository
import com.mifos.core.data.repository.GroupListRepository
Expand Down Expand Up @@ -91,6 +92,7 @@ import com.mifos.core.data.repositoryImp.DataTableRepositoryImp
import com.mifos.core.data.repositoryImp.DataTableRowDialogRepositoryImp
import com.mifos.core.data.repositoryImp.DocumentCreateUpdateRepositoryImp
import com.mifos.core.data.repositoryImp.DocumentListRepositoryImp
import com.mifos.core.data.repositoryImp.FixedDepositRepositoryImpl
import com.mifos.core.data.repositoryImp.GenerateCollectionSheetRepositoryImp
import com.mifos.core.data.repositoryImp.GroupDetailsRepositoryImp
import com.mifos.core.data.repositoryImp.GroupListRepositoryImp
Expand Down Expand Up @@ -223,6 +225,7 @@ val RepositoryModule = module {

singleOf(::RecurringAccountRepositoryImp) bind RecurringAccountRepository::class
singleOf(::ShareAccountRepositoryImpl) bind ShareAccountRepository::class
singleOf(::FixedDepositRepositoryImpl) bind FixedDepositRepository::class

includes(platformModule)
single<PlatformDependentDataModule> { getPlatformDataModule }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.mifos.core.data.repository
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing copyright header.

This file is missing the standard Mifos Initiative copyright and license header that is present in all other files in this PR. Please add the MPL 2.0 license header for consistency.

Add the copyright header at the beginning of the file:

+/*
+ * Copyright 2025 Mifos Initiative
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See https://github.com/openMF/android-client/blob/master/LICENSE.md
+ */
 package com.mifos.core.data.repository
🤖 Prompt for AI Agents
In
core/data/src/commonMain/kotlin/com/mifos/core/data/repository/FixedDepositRepository.kt
around lines 1 to 1, the file is missing the project-standard MPL 2.0 copyright
and license header; add the same multi-line header block used across the repo
(Mifos Initiative copyright, SPDX identifier and MPL 2.0 text) at the very top
of the file before the package statement so the file matches the other source
files' licensing header.


import com.mifos.core.common.utils.DataState
import com.mifos.core.network.model.FixedDepositTemplate
import kotlinx.coroutines.flow.Flow

interface FixedDepositRepository {
fun getFixedDepositTemplate(
clientId: Int,
productId: Int?
): Flow<DataState<FixedDepositTemplate>>


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.mifos.core.data.repositoryImp


import com.mifos.core.common.utils.DataState
import com.mifos.core.common.utils.asDataStateFlow
import com.mifos.core.data.repository.FixedDepositRepository
import com.mifos.core.network.datamanager.DataManagerFixedDeposit
import com.mifos.core.network.model.FixedDepositTemplate
import kotlinx.coroutines.flow.Flow

class FixedDepositRepositoryImpl (private val dataManagerFixedDeposit: DataManagerFixedDeposit): FixedDepositRepository{

override fun getFixedDepositTemplate(clientId: Int,productId: Int?): Flow<DataState<FixedDepositTemplate>> {
return dataManagerFixedDeposit.getFixedDepositTemplate(clientId,productId).asDataStateFlow()
}




}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ object APIEndPoint {
const val NOTES = "notes"
const val MAKER_CHECKER = "makercheckers"
const val SHARE = "share"

const val FIXED_DEPOSIT ="fixeddepositaccounts"
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ data class SavingAccountDepositTypeEntity(

enum class ServerTypes(val id: Int, val code: String, val endpoint: String) {
SAVINGS(100, "depositAccountType.savingsDeposit", APIEndPoint.SAVINGS_ACCOUNTS),
FIXED(200, "depositAccountType.fixedDeposit", APIEndPoint.SAVINGS_ACCOUNTS),
FIXED(200, "depositAccountType.fixedDeposit", APIEndPoint.FIXED_DEPOSIT),
RECURRING(300, "depositAccountType.recurringDeposit", APIEndPoint.RECURRING_ACCOUNTS),
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import com.mifos.core.network.services.SearchService
import com.mifos.core.network.services.ShareAccountService
import com.mifos.core.network.services.StaffService
import com.mifos.core.network.services.SurveyService
import com.mifos.core.network.services.FixedDepositService
import com.mifos.core.network.services.createCenterService
import com.mifos.core.network.services.createChargeService
import com.mifos.core.network.services.createCheckerInboxService
Expand All @@ -59,6 +60,7 @@ import com.mifos.core.network.services.createOfficeService
import com.mifos.core.network.services.createRecurringAccountService
import com.mifos.core.network.services.createRunReportsService
import com.mifos.core.network.services.createSavingsAccountService
import com.mifos.core.network.services.createFixedDepositService
import com.mifos.core.network.services.createSearchService
import com.mifos.core.network.services.createShareAccountService
import com.mifos.core.network.services.createStaffService
Expand All @@ -76,6 +78,7 @@ class BaseApiManager(
val dataTableService: DataTableService = ktorfit.createDataTableService()
val loanService: LoanService = ktorfit.createLoanService()
val savingsService: SavingsAccountService = ktorfit.createSavingsAccountService()
val fixedDepositService: FixedDepositService = ktorfit.createFixedDepositService()

val recurringSavingsAccountService: RecurringAccountService = ktorfit.createRecurringAccountService()
val searchService: SearchService = ktorfit.createSearchService()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.mifos.core.network.datamanager

import com.mifos.core.network.BaseApiManager
import com.mifos.core.network.model.FixedDepositTemplate
import kotlinx.coroutines.flow.Flow

class DataManagerFixedDeposit (private val baseApiManager: BaseApiManager){

fun getFixedDepositTemplate(clientId:Int,productId: Int?): Flow<FixedDepositTemplate> =
baseApiManager.fixedDepositService.fixedDepositProductTemplate(clientId,productId)

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.mifos.core.network.datamanager.DataManagerDataTable
import com.mifos.core.network.datamanager.DataManagerDocument
import com.mifos.core.network.datamanager.DataManagerGroups
import com.mifos.core.network.datamanager.DataManagerIdentifiers
import com.mifos.core.network.datamanager.DataManagerFixedDeposit
import com.mifos.core.network.datamanager.DataManagerLoan
import com.mifos.core.network.datamanager.DataManagerNote
import com.mifos.core.network.datamanager.DataManagerOffices
Expand Down Expand Up @@ -55,4 +56,5 @@ val DataManagerModule = module {
single { DataManagerIdentifiers(get()) }
single { DataManagerRecurringAccount(get()) }
single { DataManagerShare(get()) }
single { DataManagerFixedDeposit(get()) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.mifos.core.network.model


import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class FixedDepositProductOption(
@SerialName("id")
val id: Int? = null,

@SerialName("name")
val name: String? = null,

@SerialName("withHoldTax")
val withHoldTax: Boolean? = null,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.mifos.core.network.model

import com.mifos.core.model.objects.account.saving.FieldOfficerOptions
import com.mifos.core.model.utils.IgnoredOnParcel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable



@Serializable
data class FixedDepositTemplate(
@SerialName("clientId")
val clientId: Int? = null,

@SerialName(value = "clientName")
val clientName: String? = null,

@SerialName("productOptions")
val productOptions: List<FixedDepositProductOption>? = null,

@SerialName("fieldOfficerOptions")
val fieldOfficerOptions: List<FieldOfficerOptions>? = null,

)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.mifos.core.network.services

import com.mifos.core.network.model.FixedDepositTemplate
import com.mifos.room.basemodel.APIEndPoint
import de.jensklingenberg.ktorfit.http.Query
import de.jensklingenberg.ktorfit.http.GET
import kotlinx.coroutines.flow.Flow






interface FixedDepositService {

@GET( APIEndPoint.FIXED_DEPOSIT + "/template")
fun fixedDepositProductTemplate(
@Query("clientId") clientId: Int,
@Query("productId") productId: Int?,
): Flow<FixedDepositTemplate>
}





Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,12 @@
<string name="client_update_document_title">Update Document</string>
<!-- Screen Title -->
<string name="title_new_fixed_deposit_account">New Fixed Deposit Account</string>
<string name="title_new_recurring_deposit_account">New Recurring Deposit Account</string>
<!-- New Fixed Deposit Account -->
<string name="one_year_fixed_deposit">1 Year Fixed Deposit</string>
<string name="submission_on">Submission On</string>
<string name="Field_officer">Field Officer</string>


<!-- Create Share Account -->
<string name="feature_share_account_details">Details</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fun NavGraphBuilder.clientApplyNewApplicationRoute(
onNavigateApplySavingsAccount: (Int) -> Unit,
onNavigateApplyShareAccount: (Int) -> Unit,
onNavigateApplyRecurringAccount: (Int) -> Unit,
onNavigateApplyFixedAccount: () -> Unit,
onNavigateApplyFixedAccount: (Int) -> Unit,
navController: NavController,
) {
composable<ClientApplyNewApplicationRoute> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ internal fun ClientApplyNewApplicationsScreen(
onNavigateApplySavingsAccount: (Int) -> Unit,
onNavigateApplyShareAccount: (Int) -> Unit,
onNavigateApplyRecurringAccount: (Int) -> Unit,
onNavigateApplyFixedAccount: () -> Unit,
onNavigateApplyFixedAccount: (Int) -> Unit,
navController: NavController,
viewModel: ClientApplyNewApplicationsViewModel = koinViewModel(),
) {
Expand All @@ -74,7 +74,7 @@ internal fun ClientApplyNewApplicationsScreen(
ClientApplyNewApplicationsEvent.NavigateBack -> onNavigateBack()
is ClientApplyNewApplicationsEvent.OnActionClick -> {
when (event.action) {
ClientApplyNewApplicationsItem.NewFixedAccount -> onNavigateApplyFixedAccount()
ClientApplyNewApplicationsItem.NewFixedAccount -> onNavigateApplyFixedAccount(state.clientId)
ClientApplyNewApplicationsItem.NewLoanAccount -> onNavigateApplyLoanAccount(
state.clientId,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import com.mifos.feature.client.createNewClient.CreateNewClientViewModel
import com.mifos.feature.client.createShareAccount.CreateShareAccountViewModel
import com.mifos.feature.client.documentPreviewScreen.DocumentPreviewScreenViewModel
import com.mifos.feature.client.fixedDepositAccount.FixedDepositAccountViewModel
import com.mifos.feature.client.newFixedDepositAccount.CreateFixedDepositAccountViewmodel
import com.mifos.feature.client.recurringDepositAccount.RecurringDepositAccountViewModel
import com.mifos.feature.client.savingsAccounts.SavingsAccountsViewModel
import com.mifos.feature.client.shareAccounts.ShareAccountsViewModel
Expand Down Expand Up @@ -83,6 +84,7 @@ val ClientModule = module {
viewModelOf(::ClientIdentifiersListViewModel)
viewModelOf(::ClientIdentifiersAddUpdateViewModel)
viewModelOf(::CreateShareAccountViewModel)
viewModelOf(::CreateFixedDepositAccountViewmodel)

singleOf(::DocumentSelectAndUploadRepositoryImpl) {
bind<DocumentSelectAndUploadRepository>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ import com.mifos.feature.client.documentPreviewScreen.createDocumentPreviewRoute
import com.mifos.feature.client.documentPreviewScreen.navigateToDocumentPreviewRoute
import com.mifos.feature.client.fixedDepositAccount.clientFixedDepositAccountDestination
import com.mifos.feature.client.fixedDepositAccount.navigateToFixedDepositAccountRoute
import com.mifos.feature.client.newFixedDepositAccount.fixedAccountDestination
import com.mifos.feature.client.newFixedDepositAccount.navigateToNewFixedDepositRoute
import com.mifos.feature.client.newFixedDepositAccount.createFixedDepositAccountRoute
import com.mifos.feature.client.newFixedDepositAccount.createFixedDepositAccountDestination
import com.mifos.feature.client.newFixedDepositAccount.navigateToCreateFixedDepositRoute
import com.mifos.feature.client.recurringDepositAccount.clientRecurringDepositAccountDestination
import com.mifos.feature.client.recurringDepositAccount.navigateToRecurringDepositAccountRoute
import com.mifos.feature.client.savingsAccounts.navigateToClientSavingsAccountsRoute
Expand Down Expand Up @@ -323,7 +324,7 @@ fun NavGraphBuilder.clientNavGraph(
onNavigateApplyLoanAccount = navController::navigateToNewLoanAccountRoute,
onNavigateApplySavingsAccount = navController::navigateToSavingsAccountRoute,
onNavigateApplyRecurringAccount = navController::navigateToRecurringAccountRoute,
onNavigateApplyFixedAccount = navController::navigateToNewFixedDepositRoute,
onNavigateApplyFixedAccount = navController::navigateToCreateFixedDepositRoute,
navController = navController,
)
clientUpcomingChargesDestination(
Expand Down Expand Up @@ -357,7 +358,7 @@ fun NavGraphBuilder.clientNavGraph(
navController = navController,
)
recurringAccountDestination(navController)
fixedAccountDestination()
createFixedDepositAccountDestination(navController = navController)
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,24 @@ import androidx.navigation.compose.composable
import kotlinx.serialization.Serializable

@Serializable
data object FixedDepositRoute

fun NavGraphBuilder.fixedAccountDestination() {
composable<FixedDepositRoute> {
FixedDepositAccountScreen(
onNavigateBack = {},
data class createFixedDepositAccountRoute(
val clientId: Int,
)



fun NavGraphBuilder.createFixedDepositAccountDestination(navController: NavController) {
composable<createFixedDepositAccountRoute> {
CreateFixedDepositAccountScreen(
onNavigateBack = navController::popBackStack,
onFinish = {},
navController = navController,
)
}
}
fun NavController.navigateToNewFixedDepositRoute() {
fun NavController.navigateToCreateFixedDepositRoute(clientId: Int) {
this.navigate(
FixedDepositRoute,
createFixedDepositAccountRoute(clientId=clientId)
)
}
Loading