From b776b4058616aca2e642c6ec87e2ba9516bc4129 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 20 Nov 2025 15:33:29 +0530 Subject: [PATCH 1/8] feature Recurring Interest chart --- .../feature_recurring_deposit_string.xml | 4 + .../RecurringAccountScreen.kt | 3 +- .../RecurringAccountViewModel.kt | 64 +++++++++++ .../pages/InterestPage.kt | 106 ++++++++++++++++-- 4 files changed, 165 insertions(+), 12 deletions(-) diff --git a/feature/recurringDeposit/src/commonMain/composeResources/values/feature_recurring_deposit_string.xml b/feature/recurringDeposit/src/commonMain/composeResources/values/feature_recurring_deposit_string.xml index b82f0de3f8..118309961f 100644 --- a/feature/recurringDeposit/src/commonMain/composeResources/values/feature_recurring_deposit_string.xml +++ b/feature/recurringDeposit/src/commonMain/composeResources/values/feature_recurring_deposit_string.xml @@ -49,4 +49,8 @@ Next Button Interest Page Charges Page + Interest Compounding Period + Interest Posting Period + Interest Calculated Using + Days In Year \ No newline at end of file diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt index 6d9f1a85c8..b7526d11bd 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt @@ -92,7 +92,8 @@ private fun RecurringAccountScaffold( }, Step(name = stringResource(Res.string.feature_recurring_deposit_step_interest)) { InterestPage( - onNext = { onAction(RecurringAccountAction.OnNextPress) }, + state = state, + onAction = onAction, ) }, Step(name = stringResource(Res.string.feature_recurring_deposit_step_charges)) { diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt index d477224f7f..cdcb135547 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt @@ -170,6 +170,44 @@ class RecurringAccountViewModel( ) } + private fun handleInterestCalculationDaysInYearType(action: RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationDaysInYearType) { + mutableStateFlow.update { + it.copy( + recurringDepositAccountInterestChart = it.recurringDepositAccountInterestChart.copy( + interestCalculationDaysInYearType = action.interestCalculationTypeDaysInYear, + ), + + ) + } + } + private fun handleInterestCalculationType(action: RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationType) { + mutableStateFlow.update { + it.copy( + recurringDepositAccountInterestChart = it.recurringDepositAccountInterestChart.copy( + interestCalculationType = action.interestCalculationType, + ), + ) + } + } + private fun handleInterestCompoundingPeriodType(action: RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCompoundingPeriodType) { + mutableStateFlow.update { + it.copy( + recurringDepositAccountInterestChart = it.recurringDepositAccountInterestChart.copy( + interestCompoundingPeriodType = action.interestCompoundingPeriodType, + ), + ) + } + } + private fun handleInterestPostingPeriodType(action: RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestPostingPeriodType) { + mutableStateFlow.update { + it.copy( + recurringDepositAccountInterestChart = it.recurringDepositAccountInterestChart.copy( + interestPostingPeriodType = action.interestPostingPeriodType, + ), + ) + } + } + private fun resetForRetry() { mutableStateFlow.update { it.copy( @@ -577,6 +615,19 @@ class RecurringAccountViewModel( RecurringAccountAction.OnNextPress -> { moveToNextStep() } + + is RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationDaysInYearType -> { + handleInterestCalculationDaysInYearType(action) + } + is RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationType -> { + handleInterestCalculationType(action) + } + is RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCompoundingPeriodType -> { + handleInterestCompoundingPeriodType(action) + } + is RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestPostingPeriodType -> { + handleInterestPostingPeriodType(action) + } } } } @@ -590,6 +641,7 @@ data class RecurringAccountState( val recurringDepositAccountDetail: RecurringAccountDetailsState = RecurringAccountDetailsState(), val template: RecurringDepositAccountTemplate = RecurringDepositAccountTemplate(), val recurringDepositAccountSettings: RecurringAccountSettingsState = RecurringAccountSettingsState(), + val recurringDepositAccountInterestChart: RecurringAccountInterestChartState = RecurringAccountInterestChartState(), val currencyIndex: Int = -1, val currencyError: String? = null, ) { @@ -615,6 +667,12 @@ data class RecurringAccountDetailsState( ) { val isDetailButtonEnabled = fieldOfficerIndex != -1 && submissionDate.isNotEmpty() } +data class RecurringAccountInterestChartState( + val interestCalculationDaysInYearType: Int? = null, + val interestCalculationType: Int? = null, + val interestCompoundingPeriodType: Int? = null, + val interestPostingPeriodType: Int? = null, +) data class RecurringAccountSettingsState( val canDoNext: Boolean = false, @@ -717,6 +775,12 @@ sealed class RecurringAccountAction { data class SetPreMatureClosureInterestPeriodIndex(val interestPeriodIndex: Int) : RecurringAccountSettingsAction() data class SetPreMatureClosureMinimumBalanceForInterestCalculation(val minimumBalanceForInterestCalculation: String) : RecurringAccountSettingsAction() } + sealed class RecurringAccountInterestChartAction : RecurringAccountAction() { + data class OnInterestCalculationDaysInYearType(val interestCalculationTypeDaysInYear: Int) : RecurringAccountInterestChartAction() + data class OnInterestCompoundingPeriodType(val interestCompoundingPeriodType: Int) : RecurringAccountInterestChartAction() + data class OnInterestCalculationType(val interestCalculationType: Int) : RecurringAccountInterestChartAction() + data class OnInterestPostingPeriodType(val interestPostingPeriodType: Int) : RecurringAccountInterestChartAction() + } } sealed class RecurringAccountEvent { diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt index cb8ed3d409..e8c9274480 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt @@ -10,26 +10,110 @@ package com.mifos.feature.recurringDeposit.newRecurringDepositAccount.pages import androidclient.feature.recurringdeposit.generated.resources.Res -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_page -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_next_button +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_Calculation_Days_In_Year +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_calculation +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_compounding_period +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_posting_period import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height -import androidx.compose.material3.Button -import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp +import com.mifos.core.designsystem.component.MifosTextFieldDropdown +import com.mifos.core.designsystem.theme.DesignToken +import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountAction +import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountState import org.jetbrains.compose.resources.stringResource @Composable -fun InterestPage(onNext: () -> Unit) { +fun InterestPage( + state: RecurringAccountState, + onAction: (RecurringAccountAction) -> Unit, +) { Column(horizontalAlignment = Alignment.CenterHorizontally) { - Text(stringResource(Res.string.feature_recurring_deposit_interest_page)) - Spacer(Modifier.height(8.dp)) - Button(onClick = onNext) { - Text(stringResource(Res.string.feature_recurring_deposit_next_button)) - } + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == null) { + " " + } else { + state.template.interestCalculationDaysInYearTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value + ?: "" + }, + onValueChanged = { }, + onOptionSelected = { index, value -> + onAction( + RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCompoundingPeriodType( + index, + ), + ) + }, + options = state.template.interestCompoundingPeriodTypeOptions?.map { + it.value ?: "" + } ?: emptyList(), + label = stringResource(Res.string.feature_recurring_deposit_interest_compounding_period), + ) + Spacer(modifier = Modifier.height(DesignToken.padding.large)) + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestPostingPeriodType == null) { + " " + } else { + state.template.interestPostingPeriodTypeOptions?.get(state.recurringDepositAccountInterestChart.interestPostingPeriodType)?.value + ?: "" + }, + onValueChanged = { }, + onOptionSelected = { index, value -> + onAction( + RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestPostingPeriodType( + index, + ), + ) + }, + options = state.template.interestPostingPeriodTypeOptions?.map { + it.value ?: "" + } ?: emptyList(), + label = stringResource(Res.string.feature_recurring_deposit_interest_posting_period), + ) + Spacer(modifier = Modifier.height(DesignToken.padding.large)) + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestCalculationType == null) { + " " + } else { + state.template.interestCalculationTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCalculationType)?.value + ?: "" + }, + onValueChanged = { }, + onOptionSelected = { index, value -> + onAction( + RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationType( + index, + ), + ) + }, + options = state.template.interestCalculationTypeOptions?.map { + it.value ?: "" + } ?: emptyList(), + label = stringResource(Res.string.feature_recurring_deposit_interest_calculation), + ) + Spacer(modifier = Modifier.height(DesignToken.padding.large)) + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType == null) { + " " + } else { + state.template.interestCalculationDaysInYearTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType)?.value + ?: "" + }, + onValueChanged = { }, + onOptionSelected = { index, value -> + onAction( + RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationDaysInYearType( + index, + ), + ) + }, + options = state.template.interestCalculationDaysInYearTypeOptions?.map { + it.value ?: "" + } ?: emptyList(), + label = stringResource(Res.string.feature_recurring_deposit_Calculation_Days_In_Year), + ) } } From 65c30ac8385dff04b864b79fd70ae8337c0fc947 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 20 Nov 2025 18:23:15 +0530 Subject: [PATCH 2/8] changed the code of interest page to terms page --- .../RecurringAccountScreen.kt | 6 +- .../pages/InterestPage.kt | 109 +++--------------- .../pages/TermsPage.kt | 108 +++++++++++++++-- 3 files changed, 113 insertions(+), 110 deletions(-) diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt index b7526d11bd..d4fb713088 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt @@ -81,7 +81,8 @@ private fun RecurringAccountScaffold( }, Step(name = stringResource(Res.string.feature_recurring_deposit_step_terms)) { TermsPage( - onNext = { onAction(RecurringAccountAction.OnNextPress) }, + state = state, + onAction = onAction, ) }, Step(name = stringResource(Res.string.feature_recurring_deposit_step_settings)) { @@ -92,8 +93,7 @@ private fun RecurringAccountScaffold( }, Step(name = stringResource(Res.string.feature_recurring_deposit_step_interest)) { InterestPage( - state = state, - onAction = onAction, + onNext = { onAction(RecurringAccountAction.OnNextPress) }, ) }, Step(name = stringResource(Res.string.feature_recurring_deposit_step_charges)) { diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt index e8c9274480..ae28ebc64e 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt @@ -10,110 +10,27 @@ package com.mifos.feature.recurringDeposit.newRecurringDepositAccount.pages import androidclient.feature.recurringdeposit.generated.resources.Res -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_Calculation_Days_In_Year -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_calculation -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_compounding_period -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_posting_period +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_charges_page +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_next_button import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height +import androidx.compose.material3.Button +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import com.mifos.core.designsystem.component.MifosTextFieldDropdown -import com.mifos.core.designsystem.theme.DesignToken -import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountAction -import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountState +import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.stringResource + @Composable -fun InterestPage( - state: RecurringAccountState, - onAction: (RecurringAccountAction) -> Unit, -) { +fun InterestPage(onNext: () -> Unit) { Column(horizontalAlignment = Alignment.CenterHorizontally) { - MifosTextFieldDropdown( - value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == null) { - " " - } else { - state.template.interestCalculationDaysInYearTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value - ?: "" - }, - onValueChanged = { }, - onOptionSelected = { index, value -> - onAction( - RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCompoundingPeriodType( - index, - ), - ) - }, - options = state.template.interestCompoundingPeriodTypeOptions?.map { - it.value ?: "" - } ?: emptyList(), - label = stringResource(Res.string.feature_recurring_deposit_interest_compounding_period), - ) - Spacer(modifier = Modifier.height(DesignToken.padding.large)) - MifosTextFieldDropdown( - value = if (state.recurringDepositAccountInterestChart.interestPostingPeriodType == null) { - " " - } else { - state.template.interestPostingPeriodTypeOptions?.get(state.recurringDepositAccountInterestChart.interestPostingPeriodType)?.value - ?: "" - }, - onValueChanged = { }, - onOptionSelected = { index, value -> - onAction( - RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestPostingPeriodType( - index, - ), - ) - }, - options = state.template.interestPostingPeriodTypeOptions?.map { - it.value ?: "" - } ?: emptyList(), - label = stringResource(Res.string.feature_recurring_deposit_interest_posting_period), - ) - Spacer(modifier = Modifier.height(DesignToken.padding.large)) - MifosTextFieldDropdown( - value = if (state.recurringDepositAccountInterestChart.interestCalculationType == null) { - " " - } else { - state.template.interestCalculationTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCalculationType)?.value - ?: "" - }, - onValueChanged = { }, - onOptionSelected = { index, value -> - onAction( - RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationType( - index, - ), - ) - }, - options = state.template.interestCalculationTypeOptions?.map { - it.value ?: "" - } ?: emptyList(), - label = stringResource(Res.string.feature_recurring_deposit_interest_calculation), - ) - Spacer(modifier = Modifier.height(DesignToken.padding.large)) - MifosTextFieldDropdown( - value = if (state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType == null) { - " " - } else { - state.template.interestCalculationDaysInYearTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType)?.value - ?: "" - }, - onValueChanged = { }, - onOptionSelected = { index, value -> - onAction( - RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationDaysInYearType( - index, - ), - ) - }, - options = state.template.interestCalculationDaysInYearTypeOptions?.map { - it.value ?: "" - } ?: emptyList(), - label = stringResource(Res.string.feature_recurring_deposit_Calculation_Days_In_Year), - ) + Text(stringResource(Res.string.feature_recurring_deposit_charges_page)) + Spacer(Modifier.height(8.dp)) + Button(onClick = onNext) { + Text(stringResource(Res.string.feature_recurring_deposit_next_button)) + } } -} +} \ No newline at end of file diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt index 4be700953c..1c657f3204 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt @@ -10,26 +10,112 @@ package com.mifos.feature.recurringDeposit.newRecurringDepositAccount.pages import androidclient.feature.recurringdeposit.generated.resources.Res -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_next_button -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_terms_page +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_Calculation_Days_In_Year +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_calculation +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_compounding_period +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_posting_period import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height -import androidx.compose.material3.Button -import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp +import com.mifos.core.designsystem.component.MifosTextFieldDropdown +import com.mifos.core.designsystem.theme.DesignToken +import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountAction +import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountState import org.jetbrains.compose.resources.stringResource + @Composable -fun TermsPage(onNext: () -> Unit) { +fun TermsPage( + state: RecurringAccountState, + onAction: (RecurringAccountAction) -> Unit, +) { Column(horizontalAlignment = Alignment.CenterHorizontally) { - Text(stringResource(Res.string.feature_recurring_deposit_terms_page)) - Spacer(Modifier.height(8.dp)) - Button(onClick = onNext) { - Text(stringResource(Res.string.feature_recurring_deposit_next_button)) - } + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == null) { + " " + } else { + state.template.interestCalculationDaysInYearTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value + ?: "" + }, + onValueChanged = { }, + onOptionSelected = { index, value -> + onAction( + RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCompoundingPeriodType( + index, + ), + ) + }, + options = state.template.interestCompoundingPeriodTypeOptions?.map { + it.value ?: "" + } ?: emptyList(), + label = stringResource(Res.string.feature_recurring_deposit_interest_compounding_period), + ) + Spacer(modifier = Modifier.height(DesignToken.padding.large)) + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestPostingPeriodType == null) { + " " + } else { + state.template.interestPostingPeriodTypeOptions?.get(state.recurringDepositAccountInterestChart.interestPostingPeriodType)?.value + ?: "" + }, + onValueChanged = { }, + onOptionSelected = { index, value -> + onAction( + RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestPostingPeriodType( + index, + ), + ) + }, + options = state.template.interestPostingPeriodTypeOptions?.map { + it.value ?: "" + } ?: emptyList(), + label = stringResource(Res.string.feature_recurring_deposit_interest_posting_period), + ) + Spacer(modifier = Modifier.height(DesignToken.padding.large)) + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestCalculationType == null) { + " " + } else { + state.template.interestCalculationTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCalculationType)?.value + ?: "" + }, + onValueChanged = { }, + onOptionSelected = { index, value -> + onAction( + RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationType( + index, + ), + ) + }, + options = state.template.interestCalculationTypeOptions?.map { + it.value ?: "" + } ?: emptyList(), + label = stringResource(Res.string.feature_recurring_deposit_interest_calculation), + ) + Spacer(modifier = Modifier.height(DesignToken.padding.large)) + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType == null) { + " " + } else { + state.template.interestCalculationDaysInYearTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType)?.value + ?: "" + }, + onValueChanged = { }, + onOptionSelected = { index, value -> + onAction( + RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationDaysInYearType( + index, + ), + ) + }, + options = state.template.interestCalculationDaysInYearTypeOptions?.map { + it.value ?: "" + } ?: emptyList(), + label = stringResource(Res.string.feature_recurring_deposit_Calculation_Days_In_Year), + ) } } + From 2b1d86f776efd5b87999593381ea600e3d30f8ec Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 20 Nov 2025 18:57:15 +0530 Subject: [PATCH 3/8] fixed minor suggested changes --- .../values/feature_recurring_deposit_string.xml | 2 +- .../newRecurringDepositAccount/pages/InterestPage.kt | 3 +-- .../newRecurringDepositAccount/pages/TermsPage.kt | 8 +++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/feature/recurringDeposit/src/commonMain/composeResources/values/feature_recurring_deposit_string.xml b/feature/recurringDeposit/src/commonMain/composeResources/values/feature_recurring_deposit_string.xml index 118309961f..bd052d398f 100644 --- a/feature/recurringDeposit/src/commonMain/composeResources/values/feature_recurring_deposit_string.xml +++ b/feature/recurringDeposit/src/commonMain/composeResources/values/feature_recurring_deposit_string.xml @@ -52,5 +52,5 @@ Interest Compounding Period Interest Posting Period Interest Calculated Using - Days In Year + Days In Year \ No newline at end of file diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt index ae28ebc64e..31bbaba08c 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt @@ -23,7 +23,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.stringResource - @Composable fun InterestPage(onNext: () -> Unit) { Column(horizontalAlignment = Alignment.CenterHorizontally) { @@ -33,4 +32,4 @@ fun InterestPage(onNext: () -> Unit) { Text(stringResource(Res.string.feature_recurring_deposit_next_button)) } } -} \ No newline at end of file +} diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt index 1c657f3204..d80baada7e 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt @@ -10,7 +10,7 @@ package com.mifos.feature.recurringDeposit.newRecurringDepositAccount.pages import androidclient.feature.recurringdeposit.generated.resources.Res -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_Calculation_Days_In_Year +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_calculation_days_in_year import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_calculation import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_compounding_period import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_posting_period @@ -26,7 +26,6 @@ import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAc import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountState import org.jetbrains.compose.resources.stringResource - @Composable fun TermsPage( state: RecurringAccountState, @@ -37,7 +36,7 @@ fun TermsPage( value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == null) { " " } else { - state.template.interestCalculationDaysInYearTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value + state.template.interestCompoundingPeriodTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value ?: "" }, onValueChanged = { }, @@ -114,8 +113,7 @@ fun TermsPage( options = state.template.interestCalculationDaysInYearTypeOptions?.map { it.value ?: "" } ?: emptyList(), - label = stringResource(Res.string.feature_recurring_deposit_Calculation_Days_In_Year), + label = stringResource(Res.string.feature_recurring_deposit_calculation_days_in_year), ) } } - From 76e90ebf09a120d17c1a4c3acabd39496682e122 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Fri, 21 Nov 2025 19:00:38 +0530 Subject: [PATCH 4/8] add button on the bottom of terms page --- .../pages/TermsPage.kt | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt index d80baada7e..c8f251b766 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt @@ -10,18 +10,22 @@ package com.mifos.feature.recurringDeposit.newRecurringDepositAccount.pages import androidclient.feature.recurringdeposit.generated.resources.Res +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_back import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_calculation_days_in_year import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_calculation import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_compounding_period import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_posting_period +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_next import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import com.mifos.core.designsystem.component.MifosTextFieldDropdown import com.mifos.core.designsystem.theme.DesignToken +import com.mifos.core.ui.components.MifosTwoButtonRow import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountAction import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountState import org.jetbrains.compose.resources.stringResource @@ -31,12 +35,13 @@ fun TermsPage( state: RecurringAccountState, onAction: (RecurringAccountAction) -> Unit, ) { + Column(horizontalAlignment = Alignment.CenterHorizontally) { MifosTextFieldDropdown( value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == null) { " " } else { - state.template.interestCompoundingPeriodTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value + state.template.interestCompoundingPeriodTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value ?: "" }, onValueChanged = { }, @@ -57,7 +62,7 @@ fun TermsPage( value = if (state.recurringDepositAccountInterestChart.interestPostingPeriodType == null) { " " } else { - state.template.interestPostingPeriodTypeOptions?.get(state.recurringDepositAccountInterestChart.interestPostingPeriodType)?.value + state.template.interestPostingPeriodTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestPostingPeriodType)?.value ?: "" }, onValueChanged = { }, @@ -78,7 +83,7 @@ fun TermsPage( value = if (state.recurringDepositAccountInterestChart.interestCalculationType == null) { " " } else { - state.template.interestCalculationTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCalculationType)?.value + state.template.interestCalculationTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCalculationType)?.value ?: "" }, onValueChanged = { }, @@ -99,7 +104,7 @@ fun TermsPage( value = if (state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType == null) { " " } else { - state.template.interestCalculationDaysInYearTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType)?.value + state.template.interestCalculationDaysInYearTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType)?.value ?: "" }, onValueChanged = { }, @@ -115,5 +120,14 @@ fun TermsPage( } ?: emptyList(), label = stringResource(Res.string.feature_recurring_deposit_calculation_days_in_year), ) + + MifosTwoButtonRow( + firstBtnText = stringResource(Res.string.feature_recurring_deposit_back), + secondBtnText = stringResource(Res.string.feature_recurring_deposit_next), + onFirstBtnClick = { onAction(RecurringAccountAction.OnBackPress) }, + onSecondBtnClick = { onAction(RecurringAccountAction.OnNextPress) }, + isButtonIconVisible = true, + + ) } } From 934483f345c57aa178e52edb5f959b5acc636819 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Sat, 22 Nov 2025 10:50:24 +0530 Subject: [PATCH 5/8] minor changes --- .../commonMain/composeResources/values/strings.xml | 2 +- .../newFixedDepositAccount/pages/DetailsPage.kt | 4 ++-- .../RecurringAccountViewModel.kt | 11 ++++++++++- .../newRecurringDepositAccount/pages/TermsPage.kt | 6 +++++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/feature/client/src/commonMain/composeResources/values/strings.xml b/feature/client/src/commonMain/composeResources/values/strings.xml index c50f5cab4a..c039f88ce1 100644 --- a/feature/client/src/commonMain/composeResources/values/strings.xml +++ b/feature/client/src/commonMain/composeResources/values/strings.xml @@ -541,7 +541,7 @@ 1 Year Fixed Deposit Submission On - Field Officer + Field Officer diff --git a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/DetailsPage.kt b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/DetailsPage.kt index 7405a559c7..e2def4a8ac 100644 --- a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/DetailsPage.kt +++ b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/DetailsPage.kt @@ -9,13 +9,13 @@ */ package com.mifos.feature.client.newFixedDepositAccount.pages -import androidclient.feature.client.generated.resources.Field_officer import androidclient.feature.client.generated.resources.Res import androidclient.feature.client.generated.resources.btn_back import androidclient.feature.client.generated.resources.feature_client_charge_cancel import androidclient.feature.client.generated.resources.feature_client_charge_select import androidclient.feature.client.generated.resources.feature_client_external_id import androidclient.feature.client.generated.resources.feature_client_next +import androidclient.feature.client.generated.resources.field_officer import androidclient.feature.client.generated.resources.one_year_fixed_deposit import androidclient.feature.client.generated.resources.submission_on import androidx.compose.foundation.layout.Column @@ -130,7 +130,7 @@ fun DetailsPage( state.template.fieldOfficerOptions?.get(state.fixedDepositAccountDetail.fieldOfficerIndex)?.displayName ?: "" }, - label = stringResource(Res.string.Field_officer), + label = stringResource(Res.string.field_officer), onValueChanged = {}, onOptionSelected = { index, value -> onAction(NewFixedDepositAccountAction.OnFieldOfficerChange(index)) diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt index cdcb135547..b60bb40461 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt @@ -672,7 +672,13 @@ data class RecurringAccountInterestChartState( val interestCalculationType: Int? = null, val interestCompoundingPeriodType: Int? = null, val interestPostingPeriodType: Int? = null, -) + + +){ + val isTermsButtonEnabled = interestCalculationDaysInYearType != -1 && interestPostingPeriodType != -1 + && interestCompoundingPeriodType != -1 && interestCalculationType != -1 + +} data class RecurringAccountSettingsState( val canDoNext: Boolean = false, @@ -685,6 +691,7 @@ data class RecurringAccountSettingsState( val minimumDepositTerm: MinimumDepositTerm = MinimumDepositTerm(), val maxDepositTerm: MaxDepositTerm = MaxDepositTerm(), val preMatureClosure: PreMatureClosure = PreMatureClosure(), + ) { data class LockInPeriod( @@ -735,6 +742,8 @@ data class RecurringAccountSettingsState( minimumDepositTerm.frequency.isNotBlank() && minimumDepositTerm.frequencyAfterInMultiplesOf.isNotBlank() && maxDepositTerm.frequency.isNotBlank() + + } sealed class RecurringAccountAction { diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt index c8f251b766..4a7d1a0c17 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt @@ -25,6 +25,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import com.mifos.core.designsystem.component.MifosTextFieldDropdown import com.mifos.core.designsystem.theme.DesignToken +import com.mifos.core.ui.components.MifosProgressIndicatorMini import com.mifos.core.ui.components.MifosTwoButtonRow import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountAction import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountState @@ -35,7 +36,6 @@ fun TermsPage( state: RecurringAccountState, onAction: (RecurringAccountAction) -> Unit, ) { - Column(horizontalAlignment = Alignment.CenterHorizontally) { MifosTextFieldDropdown( value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == null) { @@ -120,12 +120,16 @@ fun TermsPage( } ?: emptyList(), label = stringResource(Res.string.feature_recurring_deposit_calculation_days_in_year), ) + if (state.recurringDepositAccountDetail.isMiniLoaderActive) { + MifosProgressIndicatorMini() + } MifosTwoButtonRow( firstBtnText = stringResource(Res.string.feature_recurring_deposit_back), secondBtnText = stringResource(Res.string.feature_recurring_deposit_next), onFirstBtnClick = { onAction(RecurringAccountAction.OnBackPress) }, onSecondBtnClick = { onAction(RecurringAccountAction.OnNextPress) }, + isSecondButtonEnabled = state.recurringDepositAccountInterestChart.isTermsButtonEnabled, isButtonIconVisible = true, ) From ba5794fd1631d019fb128ac9bf76e97e206bc24d Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Tue, 25 Nov 2025 22:05:45 +0530 Subject: [PATCH 6/8] solved one error --- .../RecurringAccountViewModel.kt | 10 +++------- .../newRecurringDepositAccount/pages/TermsPage.kt | 8 ++++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt index b60bb40461..8026399e94 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt @@ -673,11 +673,9 @@ data class RecurringAccountInterestChartState( val interestCompoundingPeriodType: Int? = null, val interestPostingPeriodType: Int? = null, - -){ - val isTermsButtonEnabled = interestCalculationDaysInYearType != -1 && interestPostingPeriodType != -1 - && interestCompoundingPeriodType != -1 && interestCalculationType != -1 - +) { + val isTermsButtonEnabled = interestCalculationDaysInYearType != -1 && interestPostingPeriodType != -1 && + interestCompoundingPeriodType != -1 && interestCalculationType != -1 } data class RecurringAccountSettingsState( @@ -742,8 +740,6 @@ data class RecurringAccountSettingsState( minimumDepositTerm.frequency.isNotBlank() && minimumDepositTerm.frequencyAfterInMultiplesOf.isNotBlank() && maxDepositTerm.frequency.isNotBlank() - - } sealed class RecurringAccountAction { diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt index 4a7d1a0c17..15555b4813 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt @@ -39,7 +39,7 @@ fun TermsPage( Column(horizontalAlignment = Alignment.CenterHorizontally) { MifosTextFieldDropdown( value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == null) { - " " + "" } else { state.template.interestCompoundingPeriodTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value ?: "" @@ -60,7 +60,7 @@ fun TermsPage( Spacer(modifier = Modifier.height(DesignToken.padding.large)) MifosTextFieldDropdown( value = if (state.recurringDepositAccountInterestChart.interestPostingPeriodType == null) { - " " + "" } else { state.template.interestPostingPeriodTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestPostingPeriodType)?.value ?: "" @@ -81,7 +81,7 @@ fun TermsPage( Spacer(modifier = Modifier.height(DesignToken.padding.large)) MifosTextFieldDropdown( value = if (state.recurringDepositAccountInterestChart.interestCalculationType == null) { - " " + "" } else { state.template.interestCalculationTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCalculationType)?.value ?: "" @@ -102,7 +102,7 @@ fun TermsPage( Spacer(modifier = Modifier.height(DesignToken.padding.large)) MifosTextFieldDropdown( value = if (state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType == null) { - " " + "" } else { state.template.interestCalculationDaysInYearTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType)?.value ?: "" From ca7accb0c8bdba6e57be1726defe393ee786b312 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Wed, 26 Nov 2025 13:48:43 +0530 Subject: [PATCH 7/8] implemented rabbit bot changes --- .../RecurringAccountViewModel.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt index 8026399e94..bad56c1db5 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt @@ -668,10 +668,10 @@ data class RecurringAccountDetailsState( val isDetailButtonEnabled = fieldOfficerIndex != -1 && submissionDate.isNotEmpty() } data class RecurringAccountInterestChartState( - val interestCalculationDaysInYearType: Int? = null, - val interestCalculationType: Int? = null, - val interestCompoundingPeriodType: Int? = null, - val interestPostingPeriodType: Int? = null, + val interestCalculationDaysInYearType: Int? = -1, + val interestCalculationType: Int? = -1, + val interestCompoundingPeriodType: Int? = -1, + val interestPostingPeriodType: Int? = -1, ) { val isTermsButtonEnabled = interestCalculationDaysInYearType != -1 && interestPostingPeriodType != -1 && From 95f4838faa23d3889294a27d71377b381e8818b5 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Wed, 26 Nov 2025 19:11:26 +0530 Subject: [PATCH 8/8] fixed suggestions --- .../RecurringAccountViewModel.kt | 8 ++++---- .../pages/TermsPage.kt | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt index bad56c1db5..dcb7500790 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt @@ -668,10 +668,10 @@ data class RecurringAccountDetailsState( val isDetailButtonEnabled = fieldOfficerIndex != -1 && submissionDate.isNotEmpty() } data class RecurringAccountInterestChartState( - val interestCalculationDaysInYearType: Int? = -1, - val interestCalculationType: Int? = -1, - val interestCompoundingPeriodType: Int? = -1, - val interestPostingPeriodType: Int? = -1, + val interestCalculationDaysInYearType: Int = -1, + val interestCalculationType: Int = -1, + val interestCompoundingPeriodType: Int = -1, + val interestPostingPeriodType: Int = -1, ) { val isTermsButtonEnabled = interestCalculationDaysInYearType != -1 && interestPostingPeriodType != -1 && diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt index 15555b4813..8986c382fc 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt @@ -38,10 +38,10 @@ fun TermsPage( ) { Column(horizontalAlignment = Alignment.CenterHorizontally) { MifosTextFieldDropdown( - value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == null) { + value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == -1) { "" } else { - state.template.interestCompoundingPeriodTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value + state.template.interestCompoundingPeriodTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value ?: "" }, onValueChanged = { }, @@ -59,10 +59,10 @@ fun TermsPage( ) Spacer(modifier = Modifier.height(DesignToken.padding.large)) MifosTextFieldDropdown( - value = if (state.recurringDepositAccountInterestChart.interestPostingPeriodType == null) { + value = if (state.recurringDepositAccountInterestChart.interestPostingPeriodType == -1) { "" } else { - state.template.interestPostingPeriodTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestPostingPeriodType)?.value + state.template.interestPostingPeriodTypeOptions?.get(state.recurringDepositAccountInterestChart.interestPostingPeriodType)?.value ?: "" }, onValueChanged = { }, @@ -80,10 +80,10 @@ fun TermsPage( ) Spacer(modifier = Modifier.height(DesignToken.padding.large)) MifosTextFieldDropdown( - value = if (state.recurringDepositAccountInterestChart.interestCalculationType == null) { + value = if (state.recurringDepositAccountInterestChart.interestCalculationType == -1) { "" } else { - state.template.interestCalculationTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCalculationType)?.value + state.template.interestCalculationTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCalculationType)?.value ?: "" }, onValueChanged = { }, @@ -101,10 +101,10 @@ fun TermsPage( ) Spacer(modifier = Modifier.height(DesignToken.padding.large)) MifosTextFieldDropdown( - value = if (state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType == null) { + value = if (state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType == -1) { "" } else { - state.template.interestCalculationDaysInYearTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType)?.value + state.template.interestCalculationDaysInYearTypeOptions?.get(state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType)?.value ?: "" }, onValueChanged = { },