diff --git a/core/ui/src/commonMain/kotlin/com/mifos/core/ui/util/TextFieldsValidator.kt b/core/ui/src/commonMain/kotlin/com/mifos/core/ui/util/TextFieldsValidator.kt index bee8680bb0b..88bdb241537 100644 --- a/core/ui/src/commonMain/kotlin/com/mifos/core/ui/util/TextFieldsValidator.kt +++ b/core/ui/src/commonMain/kotlin/com/mifos/core/ui/util/TextFieldsValidator.kt @@ -54,4 +54,11 @@ object TextFieldsValidator { else -> null } } + + fun dropDownEmptyValidator(input: Boolean): StringResource? { + return when { + input -> Res.string.error_field_empty + else -> null + } + } } diff --git a/feature/client/src/commonMain/composeResources/values/strings.xml b/feature/client/src/commonMain/composeResources/values/strings.xml index f57ba5ca0b9..c707d04d55f 100644 --- a/feature/client/src/commonMain/composeResources/values/strings.xml +++ b/feature/client/src/commonMain/composeResources/values/strings.xml @@ -593,6 +593,7 @@ View Charges Updating client charges is not supported. Please delete the existing charge and create a new one. + Deposit Amount Deposit Period Type Interest Compounding diff --git a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountViewmodel.kt b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountViewmodel.kt index a4ab7b3b214..34a29e74854 100644 --- a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountViewmodel.kt +++ b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountViewmodel.kt @@ -90,29 +90,29 @@ class CreateFixedDepositAccountViewmodel( } DataState.Loading -> { - setLoadingState() + mutableStateFlow.update { + it.copy( + isOverlayLoading = true, + ) + } } } } } - private fun setLoadingState() { + private fun setSuccessState() { mutableStateFlow.update { it.copy( - screenState = NewFixedDepositAccountState.ScreenState.Loading, + screenState = NewFixedDepositAccountState.ScreenState.Success, + isOverlayLoading = false, ) } } - - private fun setSuccessState() { - mutableStateFlow.update { - it.copy(screenState = NewFixedDepositAccountState.ScreenState.Success) - } - } private fun setErrorState(message: String) { mutableStateFlow.update { it.copy( screenState = NewFixedDepositAccountState.ScreenState.Error(message), + isOverlayLoading = false, ) } } @@ -274,6 +274,7 @@ data class NewFixedDepositAccountState( val fixedDepositAccountDetail: FixedDepositAccountDetailsState = FixedDepositAccountDetailsState(), val fixedDepositAccountTerms: FixedDepositAccountTermsState = FixedDepositAccountTermsState(), val template: FixedDepositTemplate = FixedDepositTemplate(), + val isOverlayLoading: Boolean = false, ) { sealed interface ScreenState { data class Error(val message: String) : ScreenState 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 d4fb713088a..f9e5107e58c 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 @@ -10,7 +10,6 @@ package com.mifos.feature.recurringDeposit.newRecurringDepositAccount import androidclient.feature.recurringdeposit.generated.resources.Res -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_create_recurring_deposit_account import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_step_charges import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_step_details import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_step_interest @@ -28,6 +27,7 @@ import com.mifos.core.designsystem.component.MifosScaffold import com.mifos.core.ui.components.MifosBreadcrumbNavBar import com.mifos.core.ui.components.MifosErrorComponent import com.mifos.core.ui.components.MifosProgressIndicator +import com.mifos.core.ui.components.MifosProgressIndicatorOverlay import com.mifos.core.ui.components.MifosStepper import com.mifos.core.ui.components.Step import com.mifos.core.ui.util.EventsEffect @@ -104,8 +104,6 @@ private fun RecurringAccountScaffold( ) MifosScaffold( - title = stringResource(Res.string.feature_recurring_deposit_create_recurring_deposit_account), - onBackPressed = { onAction(RecurringAccountAction.NavigateBack) }, modifier = modifier, ) { paddingValues -> Column( @@ -141,5 +139,8 @@ private fun RecurringAccountScaffold( } } } + if (state.isOverlayLoading) { + MifosProgressIndicatorOverlay() + } } } 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 dcb75007905..8ac1c06c72c 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 @@ -10,25 +10,27 @@ package com.mifos.feature.recurringDeposit.newRecurringDepositAccount import androidclient.feature.recurringdeposit.generated.resources.Res -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_deposit_amount_is_required -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_lock_in_period_frequency_is_required import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_no_internet_connection -import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_recurring_frequency_is_required import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.viewModelScope import androidx.navigation.toRoute import com.mifos.core.common.utils.DataState +import com.mifos.core.common.utils.DateHelper import com.mifos.core.data.repository.RecurringAccountRepository import com.mifos.core.data.util.NetworkMonitor import com.mifos.core.model.objects.payloads.RecurringDepositAccountPayload import com.mifos.core.model.objects.template.recurring.FieldOfficerOption import com.mifos.core.ui.util.BaseViewModel +import com.mifos.core.ui.util.TextFieldsValidator import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountState.ScreenState import com.mifos.room.entities.templates.recurringDeposit.RecurringDepositAccountTemplate import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch +import org.jetbrains.compose.resources.StringResource import org.jetbrains.compose.resources.getString +import kotlin.time.Clock +import kotlin.time.ExperimentalTime const val TOTAL_STEPS = 4 @@ -58,19 +60,6 @@ class RecurringAccountViewModel( ) } } - private fun setSuccessState() { - mutableStateFlow.update { - it.copy(screenState = ScreenState.Success) - } - } - - private fun setErrorState(message: String) { - mutableStateFlow.update { - it.copy( - screenState = ScreenState.Error(message), - ) - } - } private fun moveToNextStep() { if (state.currentStep < state.totalSteps) { @@ -91,7 +80,11 @@ class RecurringAccountViewModel( val online = networkMonitor.isOnline.first() if (!online) { - setErrorState(getString(Res.string.feature_recurring_deposit_no_internet_connection)) + mutableStateFlow.update { + it.copy( + screenState = ScreenState.Error(getString(Res.string.feature_recurring_deposit_no_internet_connection)), + ) + } return@launch } val lockInFreq = settings.lockInPeriod.frequency.toIntOrNull() @@ -125,22 +118,14 @@ class RecurringAccountViewModel( recurringFrequency = recurringFreq, recurringFrequencyType = settings.minimumDepositTerm.frequencyTypeIndex, // date in dd MM yyyy format. - submittedOnDate = s.recurringDepositAccountDetail.submittedOnDate, + submittedOnDate = s.recurringDepositAccountDetail.submissionDate, ) if (state.isOnline) { recurringAccountRepo.createRecurringDepositAccount(payload).collect { dataState -> when (dataState) { is DataState.Error -> { - if (depositAmountInt == null) { - setErrorState(getString(Res.string.feature_recurring_deposit_deposit_amount_is_required)) - } else if (lockInFreq == null) { - setErrorState(getString(Res.string.feature_recurring_deposit_lock_in_period_frequency_is_required)) - } else if (recurringFreq == null) { - setErrorState(getString(Res.string.feature_recurring_deposit_recurring_frequency_is_required)) - } else { - setErrorState(dataState.message) - } + // it will implement latter } is DataState.Loading -> { @@ -148,7 +133,11 @@ class RecurringAccountViewModel( } is DataState.Success -> { - setSuccessState() + mutableStateFlow.update { + it.copy( + screenState = ScreenState.Success, + ) + } } } } @@ -161,12 +150,15 @@ class RecurringAccountViewModel( it.copy( recurringDepositAccountDetail = it.recurringDepositAccountDetail.copy( loanProductSelected = action.index, + productError = null, + fieldOfficerError = null, ), ) } loadRecurringAccountTemplateWithProduct( state.clientId, - state.template.productOptions?.get(state.recurringDepositAccountDetail.loanProductSelected)?.id ?: -1, + state.template.productOptions?.get(state.recurringDepositAccountDetail.loanProductSelected)?.id + ?: -1, ) } @@ -180,6 +172,7 @@ class RecurringAccountViewModel( ) } } + private fun handleInterestCalculationType(action: RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationType) { mutableStateFlow.update { it.copy( @@ -189,6 +182,7 @@ class RecurringAccountViewModel( ) } } + private fun handleInterestCompoundingPeriodType(action: RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCompoundingPeriodType) { mutableStateFlow.update { it.copy( @@ -198,6 +192,7 @@ class RecurringAccountViewModel( ) } } + private fun handleInterestPostingPeriodType(action: RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestPostingPeriodType) { mutableStateFlow.update { it.copy( @@ -267,27 +262,32 @@ class RecurringAccountViewModel( } private fun loadRecurringAccountTemplate() = viewModelScope.launch { - recurringAccountRepo.getRecurringAccountTemplate(clientId = state.clientId).collect { state -> - when (state) { - is DataState.Success -> { - setSuccessState() - mutableStateFlow.update { - it.copy( - template = state.data, - isOnline = true, - ) + recurringAccountRepo.getRecurringAccountTemplate(clientId = state.clientId) + .collect { dataState -> + when (dataState) { + is DataState.Success -> { + mutableStateFlow.update { + it.copy( + template = dataState.data, + isOnline = true, + screenState = ScreenState.Success, + ) + } } - } - is DataState.Error -> { - setErrorState(state.message) - } + is DataState.Error -> { + mutableStateFlow.update { + it.copy( + screenState = ScreenState.Error(dataState.message), + ) + } + } - DataState.Loading -> { - setLoadingState() + DataState.Loading -> { + setLoadingState() + } } } - } } private fun loadRecurringAccountTemplateWithProduct( @@ -301,26 +301,26 @@ class RecurringAccountViewModel( it.copy( screenState = ScreenState.Success, template = state.data, - recurringDepositAccountDetail = it.recurringDepositAccountDetail.copy( - isMiniLoaderActive = false, - ), + isOverlayLoading = false, ) } } is DataState.Error -> { - setErrorState(state.message) mutableStateFlow.update { it.copy( - recurringDepositAccountDetail = it.recurringDepositAccountDetail.copy( - isMiniLoaderActive = false, - ), + screenState = ScreenState.Error(state.message), + isOverlayLoading = false, ) } } DataState.Loading -> { - setLoadingState() + mutableStateFlow.update { + it.copy( + isOverlayLoading = true, + ) + } } } } @@ -341,6 +341,7 @@ class RecurringAccountViewModel( depositPeriod = state.recurringDepositAccountSettings.depositPeriod.copy( period = action.period, ), + depositPeriodError = null, ), ) } @@ -355,6 +356,7 @@ class RecurringAccountViewModel( action.periodType, )?.id ?: -1, ), + depositPeriodTypeError = null, ), ) } @@ -510,6 +512,7 @@ class RecurringAccountViewModel( .recurringDepositDetails.copy( depositAmount = action.depositAmount, ), + depositAmountError = null, ), ) } @@ -570,6 +573,30 @@ class RecurringAccountViewModel( ) } } + + RecurringAccountAction.RecurringAccountSettingsAction.OnSettingNext -> { + val depositAmountError = + TextFieldsValidator.stringValidator(state.recurringDepositAccountSettings.recurringDepositDetails.depositAmount) + val depositPeriodTypeError = TextFieldsValidator.dropDownEmptyValidator( + state.recurringDepositAccountSettings.depositPeriod.periodType == -1, + ) + val depositPeriodError = + TextFieldsValidator.stringValidator(state.recurringDepositAccountSettings.depositPeriod.period) + + if (depositAmountError != null || depositPeriodTypeError != null || depositPeriodError != null) { + mutableStateFlow.update { + it.copy( + recurringDepositAccountSettings = it.recurringDepositAccountSettings.copy( + depositPeriodError = depositPeriodError, + depositAmountError = depositAmountError, + depositPeriodTypeError = depositPeriodTypeError, + ), + ) + } + } else { + moveToNextStep() + } + } } } @@ -578,18 +605,45 @@ class RecurringAccountViewModel( is RecurringAccountAction.RecurringAccountDetailsAction.OnProductNameChange -> { handleProductNameChange(action) } + is RecurringAccountAction.RecurringAccountDetailsAction.OnSubmissionDateChange -> { handleSubmissionDateChange(action) } + is RecurringAccountAction.RecurringAccountDetailsAction.OnSubmissionDatePick -> { handleSubmissionDatePick(action) } + is RecurringAccountAction.RecurringAccountDetailsAction.OnFieldOfficerChange -> { handleFieldOfficerChange(action) } + is RecurringAccountAction.RecurringAccountDetailsAction.OnExternalIdChange -> { handleExternalIdChange(action) } + + RecurringAccountAction.RecurringAccountDetailsAction.OnDetailNext -> { + val productError = TextFieldsValidator.dropDownEmptyValidator( + state.recurringDepositAccountDetail.loanProductSelected == -1, + ) + + val fieldOfficerError = TextFieldsValidator.dropDownEmptyValidator( + state.recurringDepositAccountDetail.fieldOfficerIndex == -1, + ) + + if (fieldOfficerError != null || productError != null) { + mutableStateFlow.update { + it.copy( + recurringDepositAccountDetail = it.recurringDepositAccountDetail.copy( + productError = productError, + fieldOfficerError = fieldOfficerError, + ), + ) + } + } else { + moveToNextStep() + } + } } } @@ -619,12 +673,15 @@ class RecurringAccountViewModel( is RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationDaysInYearType -> { handleInterestCalculationDaysInYearType(action) } + is RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationType -> { handleInterestCalculationType(action) } + is RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCompoundingPeriodType -> { handleInterestCompoundingPeriodType(action) } + is RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestPostingPeriodType -> { handleInterestPostingPeriodType(action) } @@ -644,6 +701,7 @@ data class RecurringAccountState( val recurringDepositAccountInterestChart: RecurringAccountInterestChartState = RecurringAccountInterestChartState(), val currencyIndex: Int = -1, val currencyError: String? = null, + val isOverlayLoading: Boolean = false, ) { sealed interface ScreenState { data class Error(val message: String) : ScreenState @@ -652,31 +710,30 @@ data class RecurringAccountState( } } -data class RecurringAccountDetailsState( +data class RecurringAccountDetailsState +@OptIn(ExperimentalTime::class) +constructor( val productId: Int = -1, - val submittedOnDate: String = "", val fieldOfficer: FieldOfficerOption? = null, val showSubmissionDatePick: Boolean = false, val loanProductSelected: Int = -1, - val submissionDate: String = "", + val submissionDate: String = DateHelper.getDateAsStringFromLong( + Clock.System.now().toEpochMilliseconds(), + ), val fieldOfficerIndex: Int = -1, - val fieldOfficerError: String? = null, val externalId: String = "", - val isMiniLoaderActive: Boolean = false, val fieldOfficerOptions: List? = null, -) { - val isDetailButtonEnabled = fieldOfficerIndex != -1 && submissionDate.isNotEmpty() -} + + val productError: StringResource? = null, + val fieldOfficerError: StringResource? = null, +) + data class RecurringAccountInterestChartState( val interestCalculationDaysInYearType: Int = -1, val interestCalculationType: Int = -1, val interestCompoundingPeriodType: Int = -1, val interestPostingPeriodType: Int = -1, - -) { - val isTermsButtonEnabled = interestCalculationDaysInYearType != -1 && interestPostingPeriodType != -1 && - interestCompoundingPeriodType != -1 && interestCalculationType != -1 -} +) data class RecurringAccountSettingsState( val canDoNext: Boolean = false, @@ -690,6 +747,9 @@ data class RecurringAccountSettingsState( val maxDepositTerm: MaxDepositTerm = MaxDepositTerm(), val preMatureClosure: PreMatureClosure = PreMatureClosure(), + val depositAmountError: StringResource? = null, + val depositPeriodTypeError: StringResource? = null, + val depositPeriodError: StringResource? = null, ) { data class LockInPeriod( @@ -705,7 +765,6 @@ data class RecurringAccountSettingsState( data class DepositPeriod( val period: String = "", val periodType: Int = -1, - val periodTypeError: String? = null, val depositFrequencySameAsGroupCenterMeeting: Boolean = false, ) @@ -731,15 +790,6 @@ data class RecurringAccountSettingsState( val interestPeriodIndexError: String? = null, val minimumBalanceForInterestCalculation: String = "", ) - - val isSettingsNextEnabled = preMatureClosure.penalInterest.isNotBlank() && - preMatureClosure.minimumBalanceForInterestCalculation.isNotBlank() && - recurringDepositDetails.depositAmount.isNotBlank() && - depositPeriod.period.isNotBlank() && - lockInPeriod.frequency.isNotBlank() && - minimumDepositTerm.frequency.isNotBlank() && - minimumDepositTerm.frequencyAfterInMultiplesOf.isNotBlank() && - maxDepositTerm.frequency.isNotBlank() } sealed class RecurringAccountAction { @@ -755,6 +805,7 @@ sealed class RecurringAccountAction { data class OnSubmissionDatePick(val state: Boolean) : RecurringAccountDetailsAction() data class OnFieldOfficerChange(val index: Int) : RecurringAccountDetailsAction() data class OnExternalIdChange(val value: String) : RecurringAccountDetailsAction() + object OnDetailNext : RecurringAccountDetailsAction() } sealed class RecurringAccountSettingsAction : RecurringAccountAction() { @@ -762,29 +813,56 @@ sealed class RecurringAccountAction { object ToggleAdvancePaymentsTowardsFutureInstallments : RecurringAccountSettingsAction() object ToggleAllowWithdrawals : RecurringAccountSettingsAction() data class SetLockInPeriod(val frequency: String) : RecurringAccountSettingsAction() - data class SetLockInPeriodType(val frequencyTypeIndex: Int) : RecurringAccountSettingsAction() - data class SetRecurringDepositAmount(val depositAmount: String) : RecurringAccountSettingsAction() + data class SetLockInPeriodType(val frequencyTypeIndex: Int) : + RecurringAccountSettingsAction() + + data class SetRecurringDepositAmount(val depositAmount: String) : + RecurringAccountSettingsAction() + data class SetDepositPeriod(val period: String) : RecurringAccountSettingsAction() data class SetDepositPeriodType(val periodType: Int) : RecurringAccountSettingsAction() - data object ToggleDepositFrequencySameAsGroupCenterMeeting : RecurringAccountSettingsAction() + data object ToggleDepositFrequencySameAsGroupCenterMeeting : + RecurringAccountSettingsAction() data class SetMinDepositTermFreq(val frequency: String) : RecurringAccountSettingsAction() - data class SetMinDepositTermFreqType(val frequencyTypeIndex: Int) : RecurringAccountSettingsAction() - data class SetMinDepositTermFreqAfterInMultiOf(val frequencyAfterInMultiplesOf: String) : RecurringAccountSettingsAction() - data class SetMinDepositTermFreqTypeAfterInMultiOf(val frequencyTypeIndexAfterInMultiplesOf: Int) : RecurringAccountSettingsAction() + data class SetMinDepositTermFreqType(val frequencyTypeIndex: Int) : + RecurringAccountSettingsAction() + + data class SetMinDepositTermFreqAfterInMultiOf(val frequencyAfterInMultiplesOf: String) : + RecurringAccountSettingsAction() + + data class SetMinDepositTermFreqTypeAfterInMultiOf(val frequencyTypeIndexAfterInMultiplesOf: Int) : + RecurringAccountSettingsAction() data class SetMaxDepositTermFreq(val frequency: String) : RecurringAccountSettingsAction() - data class SetMaxDepositTermFreqType(val frequencyTypeIndex: Int) : RecurringAccountSettingsAction() + data class SetMaxDepositTermFreqType(val frequencyTypeIndex: Int) : + RecurringAccountSettingsAction() + data object TogglePreMatureClosureApplyPenalInterest : RecurringAccountSettingsAction() - data class SetPreMatureClosurePenalInterest(val penalInterest: String) : RecurringAccountSettingsAction() - data class SetPreMatureClosureInterestPeriodIndex(val interestPeriodIndex: Int) : RecurringAccountSettingsAction() - data class SetPreMatureClosureMinimumBalanceForInterestCalculation(val minimumBalanceForInterestCalculation: String) : RecurringAccountSettingsAction() + data class SetPreMatureClosurePenalInterest(val penalInterest: String) : + RecurringAccountSettingsAction() + + data class SetPreMatureClosureInterestPeriodIndex(val interestPeriodIndex: Int) : + RecurringAccountSettingsAction() + + data class SetPreMatureClosureMinimumBalanceForInterestCalculation(val minimumBalanceForInterestCalculation: String) : + RecurringAccountSettingsAction() + + object OnSettingNext : 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() + 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() } } diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/di/RecurringDepositModule.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/di/RecurringDepositModule.kt deleted file mode 100644 index 10c43c60892..00000000000 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/di/RecurringDepositModule.kt +++ /dev/null @@ -1,18 +0,0 @@ -/* - * 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.feature.recurringDeposit.newRecurringDepositAccount.di - -import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountViewModel -import org.koin.core.module.dsl.viewModelOf -import org.koin.dsl.module - -val RecurringDepositModule = module { - viewModelOf(::RecurringAccountViewModel) -} diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt index 0a7673bc10d..8b863b88067 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt @@ -17,12 +17,16 @@ import androidclient.feature.recurringdeposit.generated.resources.feature_recurr import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_next import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_product_name import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_select +import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_step_details import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_submitted_on import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.DatePicker import androidx.compose.material3.DatePickerDialog import androidx.compose.material3.ExperimentalMaterial3Api @@ -31,7 +35,6 @@ import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.material3.rememberDatePickerState import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.input.KeyboardType import com.mifos.core.common.utils.DateHelper @@ -40,7 +43,7 @@ import com.mifos.core.designsystem.component.MifosOutlinedTextField import com.mifos.core.designsystem.component.MifosTextFieldConfig 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.designsystem.theme.MifosTypography import com.mifos.core.ui.components.MifosTwoButtonRow import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountAction import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountState @@ -66,12 +69,20 @@ fun DetailsPage( if (state.recurringDepositAccountDetail.showSubmissionDatePick) { DatePickerDialog( onDismissRequest = { - onAction(RecurringAccountAction.RecurringAccountDetailsAction.OnSubmissionDatePick(state = false)) + onAction( + RecurringAccountAction.RecurringAccountDetailsAction.OnSubmissionDatePick( + state = false, + ), + ) }, confirmButton = { TextButton( onClick = { - onAction(RecurringAccountAction.RecurringAccountDetailsAction.OnSubmissionDatePick(state = false)) + onAction( + RecurringAccountAction.RecurringAccountDetailsAction.OnSubmissionDatePick( + state = false, + ), + ) submissionDatePickerState.selectedDateMillis?.let { onAction( RecurringAccountAction.RecurringAccountDetailsAction.OnSubmissionDateChange( @@ -85,7 +96,11 @@ fun DetailsPage( dismissButton = { TextButton( onClick = { - onAction(RecurringAccountAction.RecurringAccountDetailsAction.OnSubmissionDatePick(state = false)) + onAction( + RecurringAccountAction.RecurringAccountDetailsAction.OnSubmissionDatePick( + state = false, + ), + ) }, ) { Text(stringResource(Res.string.feature_recurring_deposit_cancel)) } }, @@ -94,75 +109,99 @@ fun DetailsPage( } } - Column(horizontalAlignment = Alignment.CenterHorizontally) { - MifosTextFieldDropdown( - value = if (state.recurringDepositAccountDetail.loanProductSelected == -1) { - "" - } else { - state.template.productOptions?.get(state.recurringDepositAccountDetail.loanProductSelected)?.name ?: "" - }, - onValueChanged = {}, - onOptionSelected = { index, value -> - onAction(RecurringAccountAction.RecurringAccountDetailsAction.OnProductNameChange(index)) - }, - options = state.template.productOptions?.map { - it.name ?: "" - } ?: emptyList(), - label = stringResource(Res.string.feature_recurring_deposit_product_name), - ) - - if (!state.template.fieldOfficerOptions.isNullOrEmpty()) { - MifosDatePickerTextField( - value = state.recurringDepositAccountDetail.submissionDate, - label = stringResource(Res.string.feature_recurring_deposit_submitted_on), - openDatePicker = { - onAction(RecurringAccountAction.RecurringAccountDetailsAction.OnSubmissionDatePick(true)) - }, + Column(Modifier.fillMaxSize().padding(bottom = DesignToken.padding.large)) { + Column( + modifier = Modifier.weight(1f).verticalScroll(rememberScrollState()), + ) { + Text( + text = stringResource(Res.string.feature_recurring_deposit_step_details), + style = MifosTypography.labelLargeEmphasized, ) - Spacer(Modifier.height(DesignToken.padding.large)) MifosTextFieldDropdown( - value = if (state.recurringDepositAccountDetail.fieldOfficerIndex == -1) { + value = if (state.recurringDepositAccountDetail.loanProductSelected == -1) { "" } else { - state.template.fieldOfficerOptions - ?.get(state.recurringDepositAccountDetail.fieldOfficerIndex)?.displayName ?: "" + state.template.productOptions?.get(state.recurringDepositAccountDetail.loanProductSelected)?.name + ?: "" }, onValueChanged = {}, onOptionSelected = { index, value -> - onAction(RecurringAccountAction.RecurringAccountDetailsAction.OnFieldOfficerChange(index)) + onAction( + RecurringAccountAction.RecurringAccountDetailsAction.OnProductNameChange( + index, + ), + ) }, - options = state.template.fieldOfficerOptions?.map { - it.displayName ?: "" + options = state.template.productOptions?.map { + it.name ?: "" } ?: emptyList(), - label = stringResource(Res.string.feature_recurring_deposit_field_officer), + label = stringResource(Res.string.feature_recurring_deposit_product_name) + "*", + errorMessage = state.recurringDepositAccountDetail.productError?.let { stringResource(it) }, ) - MifosOutlinedTextField( - value = state.recurringDepositAccountDetail.externalId, - onValueChange = { - onAction(RecurringAccountAction.RecurringAccountDetailsAction.OnExternalIdChange(it)) - }, - label = stringResource(Res.string.feature_recurring_deposit_external_id), - config = MifosTextFieldConfig( - keyboardOptions = KeyboardOptions( - keyboardType = KeyboardType.Text, - ), - ), - ) - Spacer(Modifier.height(DesignToken.padding.large)) - } + if (!state.template.fieldOfficerOptions.isNullOrEmpty()) { + MifosDatePickerTextField( + value = state.recurringDepositAccountDetail.submissionDate, + label = stringResource(Res.string.feature_recurring_deposit_submitted_on) + "*", + openDatePicker = { + onAction( + RecurringAccountAction.RecurringAccountDetailsAction.OnSubmissionDatePick( + true, + ), + ) + }, + ) + + Spacer(Modifier.height(DesignToken.padding.large)) + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountDetail.fieldOfficerIndex == -1) { + "" + } else { + state.template.fieldOfficerOptions + ?.get(state.recurringDepositAccountDetail.fieldOfficerIndex)?.displayName + ?: "" + }, + onValueChanged = {}, + onOptionSelected = { index, value -> + onAction( + RecurringAccountAction.RecurringAccountDetailsAction.OnFieldOfficerChange( + index, + ), + ) + }, + options = state.template.fieldOfficerOptions?.map { + it.displayName ?: "" + } ?: emptyList(), + label = stringResource(Res.string.feature_recurring_deposit_field_officer) + "*", + errorMessage = state.recurringDepositAccountDetail.fieldOfficerError?.let { stringResource(it) }, + ) - if (state.recurringDepositAccountDetail.isMiniLoaderActive) { - MifosProgressIndicatorMini() + MifosOutlinedTextField( + value = state.recurringDepositAccountDetail.externalId, + onValueChange = { + onAction( + RecurringAccountAction.RecurringAccountDetailsAction.OnExternalIdChange( + it, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_external_id), + config = MifosTextFieldConfig( + keyboardOptions = KeyboardOptions( + keyboardType = KeyboardType.Text, + ), + ), + ) + Spacer(Modifier.height(DesignToken.padding.large)) + } } MifosTwoButtonRow( firstBtnText = stringResource(Res.string.feature_recurring_deposit_back), secondBtnText = stringResource(Res.string.feature_recurring_deposit_next), onFirstBtnClick = { onAction(RecurringAccountAction.NavigateBack) }, - onSecondBtnClick = { onAction(RecurringAccountAction.OnNextPress) }, - isSecondButtonEnabled = state.recurringDepositAccountDetail.isDetailButtonEnabled, + onSecondBtnClick = { onAction(RecurringAccountAction.RecurringAccountDetailsAction.OnDetailNext) }, modifier = Modifier.padding(top = DesignToken.padding.small), ) } diff --git a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/SettingsPage.kt b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/SettingsPage.kt index ac486f71ce2..8b26863b2de 100644 --- a/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/SettingsPage.kt +++ b/feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/SettingsPage.kt @@ -32,27 +32,26 @@ import androidclient.feature.recurringdeposit.generated.resources.feature_recurr import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_step_settings import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_type import androidx.compose.animation.AnimatedVisibility -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.verticalScroll -import androidx.compose.material3.Checkbox import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType -import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import com.mifos.core.designsystem.component.MifosOutlinedTextField import com.mifos.core.designsystem.component.MifosTextFieldConfig import com.mifos.core.designsystem.component.MifosTextFieldDropdown +import com.mifos.core.designsystem.theme.DesignToken +import com.mifos.core.designsystem.theme.MifosTypography import com.mifos.core.ui.components.MifosCheckBox import com.mifos.core.ui.components.MifosTwoButtonRow import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountAction @@ -68,119 +67,163 @@ fun SettingPage( ) { val settingsState = state.recurringDepositAccountSettings - val scrollState = rememberScrollState() - - Column( - modifier = Modifier - .fillMaxWidth() - .verticalScroll(scrollState), - horizontalAlignment = Alignment.Start, - verticalArrangement = Arrangement.spacedBy(20.dp), - ) { - Text(stringResource(Res.string.feature_recurring_deposit_step_settings), fontWeight = FontWeight.Bold, fontSize = 18.sp) - + Column(Modifier.fillMaxSize().padding(bottom = DesignToken.padding.large)) { Column( - horizontalAlignment = Alignment.Start, - verticalArrangement = Arrangement.spacedBy(10.dp), + modifier = Modifier.weight(1f).verticalScroll(rememberScrollState()), ) { - Row(verticalAlignment = Alignment.CenterVertically) { - Checkbox(settingsState.isMandatory, onCheckedChange = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.ToggleMandatoryDeposit) }) - Text(stringResource(Res.string.feature_recurring_deposit_is_mandatory_deposit)) - } - Row(verticalAlignment = Alignment.CenterVertically) { - MifosCheckBox( - text = stringResource(Res.string.feature_recurring_deposit_adjust_advance_payments), - checked = settingsState.adjustAdvancePayments, - onCheckChanged = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.ToggleAdvancePaymentsTowardsFutureInstallments) }, - ) - } - Row(verticalAlignment = Alignment.CenterVertically) { - MifosCheckBox( - text = stringResource(Res.string.feature_recurring_deposit_allow_withdrawals), - checked = settingsState.allowWithdrawals, - onCheckChanged = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.ToggleAllowWithdrawals) }, - ) - } - } + Text( + text = stringResource(Res.string.feature_recurring_deposit_step_settings), + style = MifosTypography.labelLargeEmphasized, + ) + Spacer(Modifier.height(DesignToken.padding.large)) + + MifosCheckBox( + text = stringResource(Res.string.feature_recurring_deposit_is_mandatory_deposit), + checked = settingsState.isMandatory, + onCheckChanged = { + onAction(RecurringAccountAction.RecurringAccountSettingsAction.ToggleMandatoryDeposit) + }, + ) + + Spacer(Modifier.height(DesignToken.padding.small)) - Text(stringResource(Res.string.feature_recurring_deposit_lock_in_period), fontWeight = FontWeight.Bold) - MifosOutlinedTextField( - value = settingsState.lockInPeriod.frequency, - onValueChange = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetLockInPeriod(it)) }, - label = stringResource(Res.string.feature_recurring_deposit_frequency), - config = MifosTextFieldConfig( - keyboardOptions = KeyboardOptions( - keyboardType = KeyboardType.Number, - imeAction = ImeAction.Next, + MifosCheckBox( + text = stringResource(Res.string.feature_recurring_deposit_adjust_advance_payments), + checked = settingsState.adjustAdvancePayments, + onCheckChanged = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.ToggleAdvancePaymentsTowardsFutureInstallments) }, + ) + + Spacer(Modifier.height(DesignToken.padding.small)) + + MifosCheckBox( + text = stringResource(Res.string.feature_recurring_deposit_allow_withdrawals), + checked = settingsState.allowWithdrawals, + onCheckChanged = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.ToggleAllowWithdrawals) }, + ) + + Spacer(Modifier.height(DesignToken.padding.large)) + + Text( + stringResource(Res.string.feature_recurring_deposit_lock_in_period), + style = MifosTypography.labelLargeEmphasized, + ) + Spacer(Modifier.height(DesignToken.padding.large)) + + MifosOutlinedTextField( + value = settingsState.lockInPeriod.frequency, + onValueChange = { + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetLockInPeriod( + it, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_frequency), + config = MifosTextFieldConfig( + keyboardOptions = KeyboardOptions( + keyboardType = KeyboardType.Number, + imeAction = ImeAction.Next, + ), ), - ), - modifier = Modifier.fillMaxWidth(), - ) - MifosTextFieldDropdown( - value = if (settingsState.lockInPeriod.frequencyTypeIndex != -1) { - state.template.lockinPeriodFrequencyTypeOptions - ?.getOrNull(settingsState.lockInPeriod.frequencyTypeIndex)?.value.orEmpty() - } else { - "" - }, - options = state.template.lockinPeriodFrequencyTypeOptions?.map { - it.value.orEmpty() - } ?: emptyList(), - onValueChanged = {}, - onOptionSelected = { id, name -> - onAction( - RecurringAccountAction.RecurringAccountSettingsAction.SetLockInPeriodType(id), - ) - }, - label = stringResource(Res.string.feature_recurring_deposit_type), - ) - Text(stringResource(Res.string.feature_recurring_deposit_recurring_deposit_details), fontWeight = FontWeight.Bold) - MifosOutlinedTextField( - value = settingsState.recurringDepositDetails.depositAmount, - onValueChange = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetRecurringDepositAmount(it)) }, - label = stringResource(Res.string.feature_recurring_deposit_recurring_deposit_amount), - config = MifosTextFieldConfig( - keyboardOptions = KeyboardOptions( - keyboardType = KeyboardType.Number, - imeAction = ImeAction.Next, + modifier = Modifier.fillMaxWidth(), + ) + Spacer(Modifier.height(DesignToken.padding.small)) + MifosTextFieldDropdown( + value = if (settingsState.lockInPeriod.frequencyTypeIndex != -1) { + state.template.lockinPeriodFrequencyTypeOptions + ?.getOrNull(settingsState.lockInPeriod.frequencyTypeIndex)?.value.orEmpty() + } else { + "" + }, + options = state.template.lockinPeriodFrequencyTypeOptions?.map { + it.value.orEmpty() + } ?: emptyList(), + onValueChanged = {}, + onOptionSelected = { id, name -> + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetLockInPeriodType(id), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_type), + ) + Spacer(Modifier.height(DesignToken.padding.large)) + Text( + stringResource(Res.string.feature_recurring_deposit_recurring_deposit_details), + style = MifosTypography.labelLargeEmphasized, + ) + Spacer(Modifier.height(DesignToken.padding.large)) + MifosOutlinedTextField( + value = settingsState.recurringDepositDetails.depositAmount, + onValueChange = { + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetRecurringDepositAmount( + it, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_recurring_deposit_amount) + "*", + config = MifosTextFieldConfig( + keyboardOptions = KeyboardOptions( + keyboardType = KeyboardType.Number, + imeAction = ImeAction.Next, + ), + prefix = { + Text(state.template.currency?.displaySymbol.orEmpty()) + }, + isError = state.recurringDepositAccountSettings.depositAmountError != null, + errorText = state.recurringDepositAccountSettings.depositAmountError?.let { stringResource(it) }, ), - prefix = { - Text(state.template.currency?.displaySymbol.orEmpty()) + modifier = Modifier.fillMaxWidth(), + ) + Spacer(Modifier.height(DesignToken.padding.large)) + Text( + stringResource(Res.string.feature_recurring_deposit_deposit_period), + style = MifosTypography.labelLargeEmphasized, + ) + Spacer(Modifier.height(DesignToken.padding.large)) + MifosOutlinedTextField( + value = settingsState.depositPeriod.period, + onValueChange = { + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetDepositPeriod( + it, + ), + ) }, - ), - modifier = Modifier.fillMaxWidth(), - ) - Text(stringResource(Res.string.feature_recurring_deposit_deposit_period), fontWeight = FontWeight.Bold) - MifosOutlinedTextField( - value = settingsState.depositPeriod.period, - onValueChange = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetDepositPeriod(it)) }, - label = stringResource(Res.string.feature_recurring_deposit_deposit_period), - config = MifosTextFieldConfig( - keyboardOptions = KeyboardOptions( - keyboardType = KeyboardType.Number, - imeAction = ImeAction.Next, + label = stringResource(Res.string.feature_recurring_deposit_deposit_period) + "*", + config = MifosTextFieldConfig( + keyboardOptions = KeyboardOptions( + keyboardType = KeyboardType.Number, + imeAction = ImeAction.Next, + ), + isError = state.recurringDepositAccountSettings.depositPeriodError != null, + errorText = state.recurringDepositAccountSettings.depositPeriodError?.let { stringResource(it) }, ), - ), - modifier = Modifier.fillMaxWidth(), - ) - MifosTextFieldDropdown( - value = if (settingsState.depositPeriod.periodType != -1) { - state.template.periodFrequencyTypeOptions - ?.getOrNull(settingsState.depositPeriod.periodType)?.value.orEmpty() - } else { - "" - }, - options = state.template.periodFrequencyTypeOptions?.map { - it.value.orEmpty() - } ?: emptyList(), - onValueChanged = {}, - onOptionSelected = { id, name -> - onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetDepositPeriodType(id)) - }, - label = stringResource(Res.string.feature_recurring_deposit_type), - modifier = Modifier.fillMaxWidth(), - ) - Row(verticalAlignment = Alignment.CenterVertically) { + modifier = Modifier.fillMaxWidth(), + ) + Spacer(Modifier.height(DesignToken.padding.small)) + MifosTextFieldDropdown( + value = if (settingsState.depositPeriod.periodType != -1) { + state.template.periodFrequencyTypeOptions + ?.getOrNull(settingsState.depositPeriod.periodType)?.value.orEmpty() + } else { + "" + }, + options = state.template.periodFrequencyTypeOptions?.map { + it.value.orEmpty() + } ?: emptyList(), + onValueChanged = {}, + onOptionSelected = { id, name -> + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetDepositPeriodType( + id, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_type) + "*", + modifier = Modifier.fillMaxWidth(), + errorMessage = state.recurringDepositAccountSettings.depositPeriodTypeError?.let { stringResource(it) }, + ) MifosCheckBox( text = stringResource(Res.string.feature_recurring_deposit_deposit_frequency_same_as_meeting), checked = settingsState.depositPeriod.depositFrequencySameAsGroupCenterMeeting, @@ -188,155 +231,219 @@ fun SettingPage( onAction(RecurringAccountAction.RecurringAccountSettingsAction.ToggleDepositFrequencySameAsGroupCenterMeeting) }, ) - } - Text(stringResource(Res.string.feature_recurring_deposit_minimum_deposit_term), fontWeight = FontWeight.Bold) - MifosOutlinedTextField( - value = settingsState.minimumDepositTerm.frequency, - onValueChange = { - onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetMinDepositTermFreq(it)) - }, - label = stringResource(Res.string.feature_recurring_deposit_frequency), - config = MifosTextFieldConfig( - keyboardOptions = KeyboardOptions( - keyboardType = KeyboardType.Number, - imeAction = ImeAction.Next, - ), - ), - modifier = Modifier.fillMaxWidth(), - ) - MifosTextFieldDropdown( - value = if (settingsState.minimumDepositTerm.frequencyTypeIndex != -1) { - state.template.periodFrequencyTypeOptions?.getOrNull(settingsState.minimumDepositTerm.frequencyTypeIndex)?.value.orEmpty() - } else { - "" - }, - options = state.template.periodFrequencyTypeOptions?.map { - it.value.orEmpty() - } ?: emptyList(), - onValueChanged = {}, - onOptionSelected = { id, name -> - onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetMinDepositTermFreqType(id)) - }, - label = stringResource(Res.string.feature_recurring_deposit_type), - modifier = Modifier.fillMaxWidth(), - ) - Text(stringResource(Res.string.feature_recurring_deposit_in_multiples_of), fontWeight = FontWeight.Bold) - MifosOutlinedTextField( - value = settingsState.minimumDepositTerm.frequencyAfterInMultiplesOf, - onValueChange = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetMinDepositTermFreqAfterInMultiOf(it)) }, - label = stringResource(Res.string.feature_recurring_deposit_frequency), - config = MifosTextFieldConfig( - keyboardOptions = KeyboardOptions( - keyboardType = KeyboardType.Number, - imeAction = ImeAction.Next, + Spacer(Modifier.height(DesignToken.padding.large)) + Text( + stringResource(Res.string.feature_recurring_deposit_minimum_deposit_term), + style = MifosTypography.labelLargeEmphasized, + ) + Spacer(Modifier.height(DesignToken.padding.large)) + MifosOutlinedTextField( + value = settingsState.minimumDepositTerm.frequency, + onValueChange = { + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetMinDepositTermFreq( + it, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_frequency), + config = MifosTextFieldConfig( + keyboardOptions = KeyboardOptions( + keyboardType = KeyboardType.Number, + imeAction = ImeAction.Next, + ), ), - ), - modifier = Modifier.fillMaxWidth(), - ) - MifosTextFieldDropdown( - value = if (settingsState.minimumDepositTerm.frequencyTypeIndexAfterInMultiplesOf != -1) { - state.template.periodFrequencyTypeOptions?.getOrNull(settingsState.minimumDepositTerm.frequencyTypeIndexAfterInMultiplesOf)?.value.orEmpty() - } else { - "" - }, - options = state.template.periodFrequencyTypeOptions?.map { - it.value.orEmpty() - } ?: emptyList(), - onValueChanged = {}, - onOptionSelected = { id, name -> - onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetMinDepositTermFreqTypeAfterInMultiOf(id)) - }, - label = stringResource(Res.string.feature_recurring_deposit_type), - modifier = Modifier.fillMaxWidth(), - ) - Text(stringResource(Res.string.feature_recurring_deposit_maximum_deposit_term), fontWeight = FontWeight.Bold) - MifosOutlinedTextField( - value = settingsState.maxDepositTerm.frequency, - onValueChange = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetMaxDepositTermFreq(it)) }, - label = stringResource(Res.string.feature_recurring_deposit_frequency), - config = MifosTextFieldConfig( - keyboardOptions = KeyboardOptions( - keyboardType = KeyboardType.Number, - imeAction = ImeAction.Next, + modifier = Modifier.fillMaxWidth(), + ) + Spacer(Modifier.height(DesignToken.padding.small)) + MifosTextFieldDropdown( + value = if (settingsState.minimumDepositTerm.frequencyTypeIndex != -1) { + state.template.periodFrequencyTypeOptions?.getOrNull(settingsState.minimumDepositTerm.frequencyTypeIndex)?.value.orEmpty() + } else { + "" + }, + options = state.template.periodFrequencyTypeOptions?.map { + it.value.orEmpty() + } ?: emptyList(), + onValueChanged = {}, + onOptionSelected = { id, name -> + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetMinDepositTermFreqType( + id, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_type), + modifier = Modifier.fillMaxWidth(), + ) + Spacer(Modifier.height(DesignToken.padding.large)) + Text( + stringResource(Res.string.feature_recurring_deposit_in_multiples_of), + style = MifosTypography.labelLargeEmphasized, + ) + Spacer(Modifier.height(DesignToken.padding.large)) + MifosOutlinedTextField( + value = settingsState.minimumDepositTerm.frequencyAfterInMultiplesOf, + onValueChange = { + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetMinDepositTermFreqAfterInMultiOf( + it, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_frequency), + config = MifosTextFieldConfig( + keyboardOptions = KeyboardOptions( + keyboardType = KeyboardType.Number, + imeAction = ImeAction.Next, + ), ), - ), - modifier = Modifier.fillMaxWidth(), - ) - MifosTextFieldDropdown( - value = if (settingsState.maxDepositTerm.frequencyTypeIndex != -1) { - state.template.periodFrequencyTypeOptions?.getOrNull(settingsState.maxDepositTerm.frequencyTypeIndex)?.value.orEmpty() - } else { - "" - }, - options = state.template.periodFrequencyTypeOptions?.map { - it.value.orEmpty() - } ?: emptyList(), - onValueChanged = {}, - onOptionSelected = { id, name -> - onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetMaxDepositTermFreqType(id)) - }, - label = stringResource(Res.string.feature_recurring_deposit_type), - modifier = Modifier.fillMaxWidth(), - ) - Text(stringResource(Res.string.feature_recurring_deposit_for_pre_mature_closure), fontWeight = FontWeight.Bold) - Row(verticalAlignment = Alignment.CenterVertically) { - Checkbox( - settingsState.preMatureClosure.applyPenalInterest, - onCheckedChange = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.TogglePreMatureClosureApplyPenalInterest) }, + modifier = Modifier.fillMaxWidth(), ) - Text(stringResource(Res.string.feature_recurring_deposit_apply_penal_interest)) - } - AnimatedVisibility( - visible = settingsState.preMatureClosure.applyPenalInterest, - ) { - Column( - horizontalAlignment = Alignment.Start, - verticalArrangement = Arrangement.spacedBy(20.dp), - ) { - MifosOutlinedTextField( - value = settingsState.preMatureClosure.penalInterest, - onValueChange = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetPreMatureClosurePenalInterest(it)) }, - label = stringResource(Res.string.feature_recurring_deposit_penal_interest_percentage), - config = MifosTextFieldConfig( - keyboardOptions = KeyboardOptions( - keyboardType = KeyboardType.Number, - imeAction = ImeAction.Next, + Spacer(Modifier.height(DesignToken.padding.small)) + MifosTextFieldDropdown( + value = if (settingsState.minimumDepositTerm.frequencyTypeIndexAfterInMultiplesOf != -1) { + state.template.periodFrequencyTypeOptions?.getOrNull(settingsState.minimumDepositTerm.frequencyTypeIndexAfterInMultiplesOf)?.value.orEmpty() + } else { + "" + }, + options = state.template.periodFrequencyTypeOptions?.map { + it.value.orEmpty() + } ?: emptyList(), + onValueChanged = {}, + onOptionSelected = { id, name -> + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetMinDepositTermFreqTypeAfterInMultiOf( + id, ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_type), + modifier = Modifier.fillMaxWidth(), + ) + Spacer(Modifier.height(DesignToken.padding.large)) + Text( + stringResource(Res.string.feature_recurring_deposit_maximum_deposit_term), + style = MifosTypography.labelLargeEmphasized, + ) + Spacer(Modifier.height(DesignToken.padding.large)) + MifosOutlinedTextField( + value = settingsState.maxDepositTerm.frequency, + onValueChange = { + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetMaxDepositTermFreq( + it, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_frequency), + config = MifosTextFieldConfig( + keyboardOptions = KeyboardOptions( + keyboardType = KeyboardType.Number, + imeAction = ImeAction.Next, ), - modifier = Modifier.fillMaxWidth(), - ) - MifosTextFieldDropdown( - value = if (settingsState.preMatureClosure.interestPeriodIndex != -1) { - state.template.preClosurePenalInterestOnTypeOptions - ?.getOrNull(settingsState.preMatureClosure.interestPeriodIndex)?.value.orEmpty() - } else { - "" - }, - options = state.template.preClosurePenalInterestOnTypeOptions?.map { - it.value.orEmpty() - } ?: emptyList(), - onValueChanged = {}, - onOptionSelected = { id, name -> - onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetPreMatureClosureInterestPeriodIndex(id)) - }, - label = stringResource(Res.string.feature_recurring_deposit_period), - modifier = Modifier.fillMaxWidth(), - ) - MifosOutlinedTextField( - value = settingsState.preMatureClosure.minimumBalanceForInterestCalculation, - onValueChange = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.SetPreMatureClosureMinimumBalanceForInterestCalculation(it)) }, - label = stringResource(Res.string.feature_recurring_deposit_minimum_balance_for_interest), - config = MifosTextFieldConfig( - keyboardOptions = KeyboardOptions( - keyboardType = KeyboardType.Number, - imeAction = ImeAction.Next, + ), + modifier = Modifier.fillMaxWidth(), + ) + Spacer(Modifier.height(DesignToken.padding.small)) + MifosTextFieldDropdown( + value = if (settingsState.maxDepositTerm.frequencyTypeIndex != -1) { + state.template.periodFrequencyTypeOptions?.getOrNull(settingsState.maxDepositTerm.frequencyTypeIndex)?.value.orEmpty() + } else { + "" + }, + options = state.template.periodFrequencyTypeOptions?.map { + it.value.orEmpty() + } ?: emptyList(), + onValueChanged = {}, + onOptionSelected = { id, name -> + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetMaxDepositTermFreqType( + id, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_type), + modifier = Modifier.fillMaxWidth(), + ) + Spacer(Modifier.height(DesignToken.padding.large)) + Text( + stringResource(Res.string.feature_recurring_deposit_for_pre_mature_closure), + style = MifosTypography.labelLargeEmphasized, + ) + Spacer(Modifier.height(DesignToken.padding.small)) + MifosCheckBox( + text = stringResource(Res.string.feature_recurring_deposit_apply_penal_interest), + checked = settingsState.preMatureClosure.applyPenalInterest, + onCheckChanged = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.TogglePreMatureClosureApplyPenalInterest) }, + ) + + AnimatedVisibility( + visible = settingsState.preMatureClosure.applyPenalInterest, + ) { + Column { + MifosOutlinedTextField( + value = settingsState.preMatureClosure.penalInterest, + onValueChange = { + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetPreMatureClosurePenalInterest( + it, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_penal_interest_percentage), + config = MifosTextFieldConfig( + keyboardOptions = KeyboardOptions( + keyboardType = KeyboardType.Number, + imeAction = ImeAction.Next, + ), ), - prefix = { - Text(state.template.currency?.displaySymbol.orEmpty()) + ) + + Spacer(Modifier.height(DesignToken.padding.large)) + + MifosTextFieldDropdown( + value = if (settingsState.preMatureClosure.interestPeriodIndex != -1) { + state.template.preClosurePenalInterestOnTypeOptions + ?.getOrNull(settingsState.preMatureClosure.interestPeriodIndex)?.value.orEmpty() + } else { + "" }, - ), - modifier = Modifier.fillMaxWidth(), - ) + options = state.template.preClosurePenalInterestOnTypeOptions?.map { + it.value.orEmpty() + } ?: emptyList(), + onValueChanged = {}, + onOptionSelected = { id, name -> + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetPreMatureClosureInterestPeriodIndex( + id, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_period), + ) + MifosOutlinedTextField( + value = settingsState.preMatureClosure.minimumBalanceForInterestCalculation, + onValueChange = { + onAction( + RecurringAccountAction.RecurringAccountSettingsAction.SetPreMatureClosureMinimumBalanceForInterestCalculation( + it, + ), + ) + }, + label = stringResource(Res.string.feature_recurring_deposit_minimum_balance_for_interest), + config = MifosTextFieldConfig( + keyboardOptions = KeyboardOptions( + keyboardType = KeyboardType.Number, + imeAction = ImeAction.Next, + ), + prefix = { + Text(state.template.currency?.displaySymbol.orEmpty()) + }, + ), + ) + Spacer(Modifier.height(DesignToken.padding.large)) + } } } @@ -344,9 +451,7 @@ fun SettingPage( 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, - isSecondButtonEnabled = settingsState.isSettingsNextEnabled, + onSecondBtnClick = { onAction(RecurringAccountAction.RecurringAccountSettingsAction.OnSettingNext) }, ) } } 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 8986c382fc2..0ec747bc11d 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 @@ -16,16 +16,20 @@ import androidclient.feature.recurringdeposit.generated.resources.feature_recurr 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 androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_step_terms import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +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.core.ui.components.MifosProgressIndicatorMini +import com.mifos.core.designsystem.theme.MifosTypography import com.mifos.core.ui.components.MifosTwoButtonRow import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountAction import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountState @@ -36,92 +40,95 @@ fun TermsPage( state: RecurringAccountState, onAction: (RecurringAccountAction) -> Unit, ) { - Column(horizontalAlignment = Alignment.CenterHorizontally) { - MifosTextFieldDropdown( - value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == -1) { - "" - } else { - state.template.interestCompoundingPeriodTypeOptions?.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 == -1) { - "" - } 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 == -1) { - "" - } 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 == -1) { - "" - } 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), - ) - if (state.recurringDepositAccountDetail.isMiniLoaderActive) { - MifosProgressIndicatorMini() + Column(Modifier.fillMaxSize().padding(bottom = DesignToken.padding.large)) { + Column( + modifier = Modifier.weight(1f).verticalScroll(rememberScrollState()), + ) { + Text( + text = stringResource(Res.string.feature_recurring_deposit_step_terms), + style = MifosTypography.labelLargeEmphasized, + ) + Spacer(Modifier.height(DesignToken.padding.large)) + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == -1) { + "" + } else { + state.template.interestCompoundingPeriodTypeOptions?.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), + ) + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestPostingPeriodType == -1) { + "" + } 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), + ) + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestCalculationType == -1) { + "" + } 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), + ) + MifosTextFieldDropdown( + value = if (state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType == -1) { + "" + } 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), + ) } MifosTwoButtonRow( @@ -129,9 +136,7 @@ fun TermsPage( secondBtnText = stringResource(Res.string.feature_recurring_deposit_next), onFirstBtnClick = { onAction(RecurringAccountAction.OnBackPress) }, onSecondBtnClick = { onAction(RecurringAccountAction.OnNextPress) }, - isSecondButtonEnabled = state.recurringDepositAccountInterestChart.isTermsButtonEnabled, - isButtonIconVisible = true, - + modifier = Modifier.padding(top = DesignToken.padding.small), ) } } diff --git a/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/ChargesPage.kt b/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/ChargesPage.kt index 9799a433109..0fce0c0765e 100644 --- a/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/ChargesPage.kt +++ b/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/ChargesPage.kt @@ -49,7 +49,7 @@ fun ChargesPage( onAction: (SavingsAccountAction) -> Unit, modifier: Modifier = Modifier, ) { - Column(modifier = Modifier.fillMaxSize()) { + Column(modifier = Modifier.fillMaxSize().padding(bottom = DesignToken.padding.large)) { Column( modifier = modifier.weight(1f).verticalScroll(rememberScrollState()), ) { diff --git a/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/DetailsPage.kt b/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/DetailsPage.kt index b2196b77fa9..d038159ebe6 100644 --- a/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/DetailsPage.kt +++ b/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/DetailsPage.kt @@ -98,7 +98,7 @@ fun DetailsPage( } } - Column(modifier = Modifier.fillMaxSize()) { + Column(modifier = Modifier.fillMaxSize().padding(bottom = DesignToken.padding.large)) { Column( modifier = modifier.weight(1f).verticalScroll(rememberScrollState()), ) { diff --git a/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/PreviewPage.kt b/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/PreviewPage.kt index a048f3abf9c..3fad37fb7b3 100644 --- a/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/PreviewPage.kt +++ b/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/PreviewPage.kt @@ -129,7 +129,7 @@ fun PreviewPage( ) - Column(modifier = Modifier.fillMaxSize()) { + Column(modifier = Modifier.fillMaxSize().padding(bottom = DesignToken.padding.large)) { LazyColumn(modifier = modifier.weight(1f)) { item { Text( diff --git a/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/TermsPage.kt b/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/TermsPage.kt index 60f23528a5f..7f4acadc982 100644 --- a/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/TermsPage.kt +++ b/feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/TermsPage.kt @@ -63,7 +63,7 @@ fun TermsPage( onAction: (SavingsAccountAction) -> Unit, modifier: Modifier = Modifier, ) { - Column(modifier = Modifier.fillMaxSize()) { + Column(modifier = Modifier.fillMaxSize().padding(bottom = DesignToken.padding.large)) { Column( modifier = modifier.weight(1f).verticalScroll(rememberScrollState()), ) {