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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ import kotlinx.coroutines.flow.Flow
interface FixedDepositRepository {
fun getFixedDepositTemplate(
clientId: Int,
productId: Int?,
productId: Int? = null,
): Flow<DataState<FixedDepositTemplate>>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/android-client/blob/master/LICENSE.md
*/
package com.mifos.core.model.objects.template.recurring

import kotlinx.serialization.Serializable

@Serializable
data class MaturityInstructionOption(
val code: String? = null,
val id: Int? = null,
val value: String? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ package com.mifos.core.network.model

import com.mifos.core.model.objects.account.saving.FieldOfficerOptions
import com.mifos.core.model.objects.template.recurring.Currency
import com.mifos.core.model.objects.template.recurring.MaturityInstructionOption
import com.mifos.core.model.objects.template.recurring.interest.InterestCalculationDaysInYearTypeOption
import com.mifos.core.model.objects.template.recurring.interest.InterestCalculationTypeOption
import com.mifos.core.model.objects.template.recurring.interest.InterestCompoundingPeriodTypeOption
import com.mifos.core.model.objects.template.recurring.interest.InterestPostingPeriodTypeOption
import com.mifos.core.model.objects.template.recurring.period.LockinPeriodFrequencyTypeOption
import com.mifos.core.model.objects.template.recurring.period.PeriodFrequencyTypeOption
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down Expand Up @@ -52,4 +54,6 @@ data class FixedDepositTemplate(
@SerialName("interestCalculationTypeOptions")
val interestCalculationTypeOptions: List<InterestCalculationTypeOption>? = null,

val lockinPeriodFrequencyTypeOptions: List<LockinPeriodFrequencyTypeOption>? = null,
val maturityInstructionOptions: List<MaturityInstructionOption>? = null,
)
15 changes: 15 additions & 0 deletions feature/client/src/commonMain/composeResources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -605,4 +605,19 @@
<string name="feature_fixed_deposit_terms_page">Terms</string>
<string name="feature_fixed_deposit_deposit_period">Deposit Period</string>

<string name="feature_fixed_deposit_setting_lock_in_period">Lock-in-Period</string>
<string name="feature_fixed_deposit_setting_frequency">Frequency</string>
<string name="feature_fixed_deposit_setting_type">Type</string>
<string name="feature_fixed_deposit_setting_minimum_deposit_term">Minimum Deposit Term</string>
<string name="feature_fixed_deposit_setting_thereafter_in_multiples">And thereafter, in Multiples of</string>
<string name="feature_fixed_deposit_setting_maximum_deposit_term">Maximum Deposit Term</string>
<string name="feature_fixed_deposit_setting_interest_transfer">Interest Transfer</string>
<string name="feature_fixed_deposit_setting_linked_saving_account">Transfer Interest to Linked Savings Account?</string>
<string name="feature_fixed_deposit_setting_maturity_instructions">Maturity Instructions</string>
<string name="feature_fixed_deposit_setting_investing_account">Investing Account</string>
<string name="feature_fixed_deposit_setting_pre_mature_closure">For Pre-mature closure</string>
<string name="feature_fixed_deposit_setting_apply_penal_interest">Apply Penal Interest (less)</string>
<string name="feature_fixed_deposit_setting_penal_interest">Penal Interest (%%)</string>
<string name="feature_fixed_deposit_setting_period">Period</string>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ fun ChargesPage(
text = state.addedCharges.size.toString() + " " + stringResource(Res.string.feature_share_account_charge_active_charge),
btnEnabled = state.addedCharges.isNotEmpty(),
)
Spacer(Modifier.height(DesignToken.padding.large))
}
MifosTwoButtonRow(
firstBtnText = stringResource(Res.string.feature_share_account_back),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ fun DetailsPage(
onSecondBtnClick = {
onAction(CreateShareAccountAction.OnDetailNext)
},
modifier = Modifier.padding(top = DesignToken.padding.small),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ import androidclient.feature.client.generated.resources.feature_share_account_te
import androidclient.feature.client.generated.resources.feature_share_account_terms_total_shares
import androidx.compose.foundation.layout.Arrangement
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
Expand Down Expand Up @@ -87,6 +89,7 @@ fun PreviewPage(
text = state.addedCharges.size.toString() + " " + stringResource(Res.string.feature_share_account_charge_active_charge),
btnEnabled = state.addedCharges.isNotEmpty(),
)
Spacer(Modifier.height(DesignToken.padding.large))
}
MifosTwoButtonRow(
firstBtnText = stringResource(Res.string.feature_share_account_back),
Expand All @@ -97,7 +100,6 @@ fun PreviewPage(
onSecondBtnClick = {
onAction(CreateShareAccountAction.SubmitShareAccount)
},
modifier = Modifier.padding(top = DesignToken.padding.small),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ fun TermsPage(
errorMessage = state.minActivePeriodFreqTypeError?.let { stringResource(it) },
)

Spacer(Modifier.height(DesignToken.padding.small))

Text(
text = stringResource(Res.string.feature_share_account_terms_lock_in_period),
style = MifosTypography.labelLargeEmphasized,
Expand Down Expand Up @@ -263,6 +265,7 @@ fun TermsPage(
label = stringResource(Res.string.feature_share_account_terms_type),
errorMessage = state.lockInPeriodFreqTypeError?.let { stringResource(it) },
)
Spacer(Modifier.height(DesignToken.padding.large))
}
MifosTwoButtonRow(
firstBtnText = stringResource(Res.string.feature_share_account_back),
Expand All @@ -273,7 +276,6 @@ fun TermsPage(
onSecondBtnClick = {
onAction(CreateShareAccountAction.OnTermsNext)
},
modifier = Modifier.padding(top = DesignToken.padding.small),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import androidclient.feature.client.generated.resources.step_details
import androidclient.feature.client.generated.resources.step_interest
import androidclient.feature.client.generated.resources.step_settings
import androidclient.feature.client.generated.resources.step_terms
import androidclient.feature.client.generated.resources.title_new_fixed_deposit_account
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
Expand All @@ -27,6 +26,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
Expand Down Expand Up @@ -55,7 +55,7 @@ internal fun CreateFixedDepositAccountScreen(
}
FixedDepositAccountScaffold(
navController = navController,
newFixedDepositAccountState = state,
state = state,
onAction = { viewModel.trySendAction(it) },
modifier = modifier,
)
Expand All @@ -64,28 +64,29 @@ internal fun CreateFixedDepositAccountScreen(
@Composable
private fun FixedDepositAccountScaffold(
navController: NavController,
newFixedDepositAccountState: NewFixedDepositAccountState,
state: NewFixedDepositAccountState,
onAction: (NewFixedDepositAccountAction) -> Unit,
modifier: Modifier = Modifier,
) {
val steps =
listOf(
Step(stringResource(Res.string.step_details)) {
DetailsPage(
state = newFixedDepositAccountState,
state = state,
onAction = onAction,
)
},
Step(name = stringResource(Res.string.step_terms)) {
TermsPage(
state = newFixedDepositAccountState,
state = state,
onAction = onAction,
)
},

Step(name = stringResource(Res.string.step_settings)) {
SettingPage(
onNext = { onAction(NewFixedDepositAccountAction.OnNextPress) },
state = state,
onAction = onAction,
)
},
Step(name = stringResource(Res.string.step_interest)) {
Expand All @@ -101,17 +102,14 @@ private fun FixedDepositAccountScaffold(
)

MifosScaffold(
title = stringResource(Res.string.title_new_fixed_deposit_account),
onBackPressed = { onAction(NewFixedDepositAccountAction.NavigateBack) },
modifier = modifier,

) { paddingValues ->
Column {
MifosBreadcrumbNavBar(navController)
when (newFixedDepositAccountState.screenState) {
when (state.screenState) {
is NewFixedDepositAccountState.ScreenState.Error -> {
MifosErrorComponent(
message = newFixedDepositAccountState.screenState.message,
message = state.screenState.message,
isRetryEnabled = true,
) {
onAction(NewFixedDepositAccountAction.Retry)
Expand All @@ -125,7 +123,7 @@ private fun FixedDepositAccountScaffold(
is NewFixedDepositAccountState.ScreenState.Success -> {
MifosStepper(
steps = steps,
currentIndex = newFixedDepositAccountState.currentStep,
currentIndex = state.currentStep,
onStepChange = { newIndex ->
onAction(NewFixedDepositAccountAction.OnStepChange(newIndex))
},
Expand All @@ -136,5 +134,8 @@ private fun FixedDepositAccountScaffold(
}
}
}
if (state.isOverlayLoading) {
MifosProgressIndicatorOverlay()
}
}
}
Loading