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
@@ -1,3 +1,12 @@
/*
* Copyright 2024 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

import com.mifos.core.common.utils.DataState
Expand All @@ -7,8 +16,6 @@ import kotlinx.coroutines.flow.Flow
interface FixedDepositRepository {
fun getFixedDepositTemplate(
clientId: Int,
productId: Int?
productId: Int?,
): Flow<DataState<FixedDepositTemplate>>


}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
/*
* Copyright 2024 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.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{
class FixedDepositRepositoryImpl(private val dataManagerFixedDeposit: DataManagerFixedDeposit) :
FixedDepositRepository {

override fun getFixedDepositTemplate(clientId: Int,productId: Int?): Flow<DataState<FixedDepositTemplate>> {
return dataManagerFixedDeposit.getFixedDepositTemplate(clientId,productId).asDataStateFlow()
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 @@ -42,5 +42,5 @@ object APIEndPoint {
const val MAKER_CHECKER = "makercheckers"
const val SHARE = "share"

const val FIXED_DEPOSIT ="fixeddepositaccounts"
const val FIXED_DEPOSIT = "fixeddepositaccounts"
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import com.mifos.core.network.services.ClientService
import com.mifos.core.network.services.CollectionSheetService
import com.mifos.core.network.services.DataTableService
import com.mifos.core.network.services.DocumentService
import com.mifos.core.network.services.FixedDepositService
import com.mifos.core.network.services.GroupService
import com.mifos.core.network.services.LoanService
import com.mifos.core.network.services.NoteService
Expand All @@ -44,7 +45,6 @@ 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 @@ -53,14 +53,14 @@ import com.mifos.core.network.services.createClientService
import com.mifos.core.network.services.createCollectionSheetService
import com.mifos.core.network.services.createDataTableService
import com.mifos.core.network.services.createDocumentService
import com.mifos.core.network.services.createFixedDepositService
import com.mifos.core.network.services.createGroupService
import com.mifos.core.network.services.createLoanService
import com.mifos.core.network.services.createNoteService
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 Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
/*
* 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.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){
class DataManagerFixedDeposit(private val baseApiManager: BaseApiManager) {

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

}
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 @@ -19,9 +19,9 @@ import com.mifos.core.network.datamanager.DataManagerClient
import com.mifos.core.network.datamanager.DataManagerCollectionSheet
import com.mifos.core.network.datamanager.DataManagerDataTable
import com.mifos.core.network.datamanager.DataManagerDocument
import com.mifos.core.network.datamanager.DataManagerFixedDeposit
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
/*
* 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.network.model


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

Expand All @@ -14,4 +22,4 @@ data class FixedDepositProductOption(

@SerialName("withHoldTax")
val withHoldTax: Boolean? = null,
)
)
Original file line number Diff line number Diff line change
@@ -1,24 +1,55 @@
/*
* 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.network.model

import com.mifos.core.model.objects.account.saving.FieldOfficerOptions
import com.mifos.core.model.utils.IgnoredOnParcel
import com.mifos.core.model.objects.template.recurring.Currency
import com.mifos.core.model.objects.template.recurring.interest.InterestCalculationDaysInYearTypeOption
import com.mifos.core.model.objects.template.recurring.interest.InterestCalculationTypeOption
import com.mifos.core.model.objects.template.recurring.interest.InterestCompoundingPeriodTypeOption
import com.mifos.core.model.objects.template.recurring.interest.InterestPostingPeriodTypeOption
import com.mifos.core.model.objects.template.recurring.period.PeriodFrequencyTypeOption
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(value = "currency")
val currency: Currency? = null,

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

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

)
@SerialName("periodFrequencyTypeOptions")
val periodFrequencyTypeOptions: List<PeriodFrequencyTypeOption>? = null,

@SerialName("interestCompoundingPeriodTypeOptions")
val interestCompoundingPeriodTypeOptions: List<InterestCompoundingPeriodTypeOption>? = null,

@SerialName("interestPostingPeriodTypeOptions")
val interestPostingPeriodTypeOptions: List<InterestPostingPeriodTypeOption>? = null,

@SerialName("interestCalculationDaysInYearTypeOptions")
val interestCalculationDaysInYearTypeOptions: List<InterestCalculationDaysInYearTypeOption>? = null,

@SerialName("interestCalculationTypeOptions")
val interestCalculationTypeOptions: List<InterestCalculationTypeOption>? = null,

)
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
/*
* 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.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 de.jensklingenberg.ktorfit.http.Query
import kotlinx.coroutines.flow.Flow






interface FixedDepositService {

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





10 changes: 10 additions & 0 deletions feature/client/src/commonMain/composeResources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -578,4 +578,14 @@
<string name="charges_view_charges">View Charges</string>
<string name="charges_client_update_not_support_error_msg">Updating client charges is not supported. Please delete the existing charge and create a new one.</string>

<string name="feature_fixed_deposit_deposit_amount">Deposit Amount</string>
<string name="feature_fixed_deposit_deposit_period_type">Deposit Period Type</string>
<string name="feature_fixed_interest_compounding">Interest Compounding</string>
<string name="feature_fixed_interest_compounding_period">Interest Compounding Period</string>
<string name="feature_fixed_interest_posting_period">Interest Posting Period</string>
<string name="feature_fixed_interest_calculated_using">Interest Calculated Using</string>
<string name="feature_fixed_days_in_year">Days in year</string>
<string name="feature_fixed_deposit_terms_page">Terms</string>
<string name="feature_fixed_deposit_deposit_period">Deposit Period</string>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ 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.createFixedDepositAccountRoute
import com.mifos.feature.client.newFixedDepositAccount.createFixedDepositAccountDestination
import com.mifos.feature.client.newFixedDepositAccount.navigateToCreateFixedDepositRoute
import com.mifos.feature.client.recurringDepositAccount.clientRecurringDepositAccountDestination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,22 @@ import androidx.navigation.compose.composable
import kotlinx.serialization.Serializable

@Serializable

data class createFixedDepositAccountRoute(
data class CreateFixedDepositAccountRoute(
val clientId: Int,
)
Comment on lines 17 to 20
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Route rename and typed navigation look correct; verify onFinish behavior

The route rename to CreateFixedDepositAccountRoute and usage in composable<CreateFixedDepositAccountRoute> plus the navigateToCreateFixedDepositRoute helper are consistent and type-safe.

One thing to double‑check: onFinish = {} means the screen won’t trigger any navigation on completion. If the UX is supposed to move to account details or back to the client screen after creating the fixed deposit, you may want to wire a real navigation callback here.

Naming nit (optional): for consistency you might consider renaming navigateToCreateFixedDepositRoute to navigateToCreateFixedDepositAccountRoute.

Also applies to: 22-30, 32-35


🏁 Script executed:

#!/bin/bash
# Grep usages of the navigate helper and onFinish to confirm expected flow.
rg -n "navigateToCreateFixedDepositRoute" -C3
rg -n "CreateFixedDepositAccountScreen" -C5

Length of output: 6921


🏁 Script executed:

#!/bin/bash
# View complete route file to see the full structure including any builder functions
cat feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountRoute.kt

Length of output: 1116


Data class naming violates Kotlin conventions; review comment shows intended but unapplied fix

The review comment displays CreateFixedDepositAccountRoute (PascalCase) as the "final state," but the actual code defines the data class as createFixedDepositAccountRoute (camelCase). Kotlin conventions require data classes to use PascalCase. The code needs to be updated:

  • Rename data class from createFixedDepositAccountRoute to CreateFixedDepositAccountRoute
  • Update composable type parameter: composable<CreateFixedDepositAccountRoute>
  • Update instantiation in navigator: CreateFixedDepositAccountRoute(clientId=clientId)

The onFinish = {} (no-op) and navigation wiring are as expected. The helper function navigateToCreateFixedDepositRoute is correctly imported and used in ClientNavigation.kt.

🤖 Prompt for AI Agents
In
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountRoute.kt
around lines 17 to 20, the data class is incorrectly named using camelCase;
rename the type from createFixedDepositAccountRoute to
CreateFixedDepositAccountRoute (PascalCase), then update all usages: change the
composable type parameter to composable<CreateFixedDepositAccountRoute> and
update instantiation in navigator to CreateFixedDepositAccountRoute(clientId =
clientId); keep onFinish and navigation wiring as-is.




fun NavGraphBuilder.createFixedDepositAccountDestination(navController: NavController) {
composable<createFixedDepositAccountRoute> {
composable<CreateFixedDepositAccountRoute> {
CreateFixedDepositAccountScreen(
onNavigateBack = navController::popBackStack,
onFinish = {},
navController = navController,
)
}
}

fun NavController.navigateToCreateFixedDepositRoute(clientId: Int) {
this.navigate(
createFixedDepositAccountRoute(clientId=clientId)
CreateFixedDepositAccountRoute(clientId = clientId),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavController
import com.mifos.core.designsystem.component.MifosScaffold
import com.mifos.core.ui.components.MifosBreadcrumbNavBar
Expand Down Expand Up @@ -79,7 +78,8 @@ private fun FixedDepositAccountScaffold(
},
Step(name = stringResource(Res.string.step_terms)) {
TermsPage(
onNext = { onAction(NewFixedDepositAccountAction.OnNextPress) },
state = newFixedDepositAccountState,
onAction = onAction,
)
},

Expand Down Expand Up @@ -132,10 +132,9 @@ private fun FixedDepositAccountScaffold(
modifier = Modifier
.fillMaxWidth(),

)
)
}
}
}

}
}
Loading