Skip to content

Conversation

@Arinyadav1
Copy link
Contributor

@Arinyadav1 Arinyadav1 commented Dec 10, 2025

Fixes - Jira-#560

Screenshot 2025-12-10 161819

Summary by CodeRabbit

  • New Features

    • Added interest rate chart display for fixed deposits with configurable date ranges and descriptions.
    • Extended account data model to include optional description field.
  • Bug Fixes

    • Fixed dialog state clearing when navigating between account creation steps.
    • Corrected product template loading to trigger consistently during product selection.
    • Updated empty date display text in recurring deposits.
  • Refactor

    • Standardized UI component layouts with customizable modifier parameters across account creation flows.
    • Improved dialog state management and interest chart rendering.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

Walkthrough

This PR introduces dialog state management for rate charts in fixed deposit and recurring deposit account creation flows, refactors the InterestPage to a state-driven component, extends data models with new optional fields (description in AccountChart, accountChart in FixedDepositTemplate), standardizes Composable parameter ordering across multiple features (moving modifier before onAction), adds modifier parameters to several page composables for layout customization, and extends UI string resources for fixed deposit interest functionality.

Changes

Cohort / File(s) Summary
Data Model Extensions
core/model/src/commonMain/kotlin/com/mifos/core/model/objects/template/recurring/AccountChart.kt, core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositTemplate.kt
Added optional description: String? = null field to AccountChart; added optional accountChart: AccountChart? field to FixedDepositTemplate with corresponding import.
Fixed Deposit Rate Chart & Dialog Handling
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountScreen.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountViewmodel.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/InterestPage.kt
Introduced CreateFixedDepositAccountDialog to render FixedDepositRateChart via state-driven dialogState; refactored InterestPage from callback-based to state-driven composable with new FixedDepositRateChart composable; added dialog action handlers (OnDismissDialog, OnShowRateChart) and DialogState sealed type to viewmodel; added isRateChartEmpty computed property.
String Resources
feature/client/src/commonMain/composeResources/values/strings.xml, feature/recurringDeposit/src/commonMain/composeResources/values/feature_recurring_deposit_string.xml
Added feature_fixed_deposit_interest_* string resources (name, valid_from_date, end_date, description, grouping_by_amount, interest_rate_chart variants, no_interest_chart, yes/no options, empty_date); updated feature_recurring_deposit_empty_date from "Empty Date" to "Date Not Found".
Composable Parameter Reordering — Share Account Pages
feature/client/src/commonMain/kotlin/com/mifos/feature/client/createShareAccount/pages/DetailsPage.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/createShareAccount/pages/TermsPage.kt
Reordered parameters: moved onAction after modifier in DetailsPage and TermsPage.
Composable Parameter Reordering — Fixed Deposit Pages
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/DetailsPage.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/TermsPage.kt
Reordered parameters: moved onAction after modifier in DetailsPage and TermsPage.
Composable Parameter Reordering — Loan Pages
feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/ChargesPage.kt, feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/DetailsPage.kt, feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/SchedulePage.kt, feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/TermsPage.kt
Reordered parameters: moved onAction after modifier in all four pages.
Composable Parameter Reordering — Savings Pages
feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/ChargesPage.kt, feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/DetailsPage.kt, feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/PreviewPage.kt, feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/TermsPage.kt
Reordered parameters: moved onAction after modifier in all four pages.
Modifier Parameter Additions — Recurring Deposit Pages
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/ChargesPage.kt, feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt, feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt, feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/SettingsPage.kt, feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt
Added optional modifier: Modifier = Modifier parameter and threaded it into inner Column layout chains.
Modifier Parameter Additions — Fixed Deposit & Share Account Pages
feature/client/src/commonMain/kotlin/com/mifos/feature/client/createShareAccount/pages/PreviewPage.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/PreviewPage.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/SettingsPage.kt
Added optional modifier: Modifier = Modifier parameter and applied to inner Column.
Modifier Parameter Additions — Loan Pages
feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/PreviewPage.kt
Added optional modifier: Modifier = Modifier parameter and threaded into Column layout.
Dialog State & Viewmodel Updates
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt
Updated moveToNextStep to clear dialogState; removed conditional loading in handleProductNameChange, now unconditionally loads template on product change.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify parameter reordering consistency: Across ~15 Composable functions, confirm all call sites use named arguments or are updated for positional changes.
  • Dialog state integration: Review the new DialogState sealed type, RateChartDialog variant, and action handlers in CreateFixedDepositAccountViewmodel for correctness.
  • FixedDepositRateChart composable: Ensure new rate chart composable integrates correctly with dialog state and state-driven callback flow.
  • Modifier threading logic: Confirm modifier parameters are correctly applied in inner Column layouts across recurring deposit and other pages.
  • Unconditional template loading: Verify the removal of conditional checks in handleProductNameChange doesn't break existing logic.

Possibly related PRs

  • openMF/android-client#2552: Extends interest-rate chart UI flow and data model with template.accountChart and dialog/rate-chart handling for recurring deposits.
  • openMF/android-client#2555: Modifies FixedDepositTemplate data model with additional template fields (lockinPeriodFrequencyTypeOptions, maturityInstructionOptions).
  • openMF/android-client#2542: Introduces FixedDepositTemplate network model and fixed-deposit API/repository scaffolding, directly related to this PR's accountChart field addition.

Suggested reviewers

  • TheKalpeshPawar
  • revanthkumarJ

Poem

🐰 Hop, hop, we refactor the way,
Parameters dance in a cleaner ballet,
Modal charts bloom from the state-driven stream,
Layout modifiers fulfill the design dream,
Consistency blooms across every page—
A tidy composable stage!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'New Fixed Deposits Account Interest Charts Step' directly aligns with the primary changes in the PR: adding interest chart UI support (FixedDepositRateChart), new account chart fields, and interest-related string resources for the fixed deposit account workflow.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountViewmodel.kt (1)

306-348: Method name loadRecurringAccountTemplateWithProduct is misleading.

This method loads a Fixed Deposit template (calling fixedDepositRepository.getFixedDepositTemplate), but the name suggests it handles recurring deposits. This appears to be a copy-paste from the recurring deposit feature.

Rename for clarity:

-    private fun loadRecurringAccountTemplateWithProduct() = viewModelScope.launch {
+    private fun loadFixedDepositTemplateWithProduct() = viewModelScope.launch {

And update the call site at line 383:

-        loadRecurringAccountTemplateWithProduct()
+        loadFixedDepositTemplateWithProduct()
🧹 Nitpick comments (8)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/createShareAccount/pages/PreviewPage.kt (1)

53-64: Modifier parameter wiring is safe; consider whether it should scope the whole page

The new modifier: Modifier = Modifier parameter and its use on the inner scrollable Column are correct and source‑compatible with existing call sites. Right now, any modifier passed by callers will only affect the scrollable content area, while the outer Column (and thus the bottom MifosTwoButtonRow) still uses a fixed Modifier.fillMaxSize().padding(bottom = ...).

If the intent is to allow screen‑level layout customization (padding, background, etc.) that also applies to the button row, consider applying the external modifier to the outer Column and keeping a local Modifier for the inner scroll container, for example:

-    Column(
-        Modifier.fillMaxSize().padding(bottom = DesignToken.padding.large),
-    ) {
-        Column(
-            modifier = modifier.weight(1f).verticalScroll(rememberScrollState()),
+    Column(
+        modifier = modifier.fillMaxSize().padding(bottom = DesignToken.padding.large),
+    ) {
+        Column(
+            modifier = Modifier.weight(1f).verticalScroll(rememberScrollState()),
             verticalArrangement = Arrangement.spacedBy(20.dp),
         ) {

If the current behavior (customization limited to the scroll area) is intentional and consistent with other pages, you can keep it as is.

feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt (1)

53-61: Modifier plumbing looks good; note it only affects scrollable content

Adding modifier: Modifier = Modifier and applying it as modifier.weight(1f).verticalScroll(...) is consistent and non-breaking. Just be aware this customizes only the scrollable content column; the outer Column (and bottom button row) still use a fixed Modifier.fillMaxSize().padding(...). If you ever need page-level padding or insets, you may want to thread the modifier into the root Column as well.

feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt (2)

151-165: Avoid calling template reload with an invalid product id

handleProductNameChange now always calls loadRecurringAccountTemplateWithProduct, but falls back to productId = -1 when the selected option or its id is missing:

loadRecurringAccountTemplateWithProduct(
    state.clientId,
    state.template.productOptions?.get(state.recurringDepositAccountDetail.loanProductSelected)?.id
        ?: -1,
)

It would be cleaner (and cheaper) to guard the call and skip the reload when no valid product id is available, instead of pushing -1 down to the repository.


685-699: DialogState modeling is solid; consider renaming isRateChartEmpty for clarity

The introduction of a sealed DialogState and central handling for OnDismissDialog / OnShowRateChartDialog looks good and should make dialog flows easier to reason about.

However, in RecurringAccountState:

val isRateChartEmpty = !template.accountChart?.chartSlabs.isNullOrEmpty()

This property evaluates to true when there are chart slabs, which is opposite to what “Empty” suggests. Since this flag is used to enable the “View” button and choose the label in InterestPage, consider either:

  • renaming it to something like hasRateChart, or
  • flipping the boolean and adjusting the usages.

This will reduce confusion for future readers.

Also applies to: 809-827

feature/client/src/commonMain/composeResources/values/strings.xml (1)

623-633: New fixed-deposit interest strings look consistent

The added feature_fixed_deposit_interest_* strings are well-namespaced and match the existing naming style. Minor nit: "Grouping By Amount" here vs "Grouping by Amount" in recurring-deposit resources is a small capitalization inconsistency; align them if you care about uniform UI copy.

feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/InterestPage.kt (2)

96-107: Confusing conditional due to inverted naming in isRateChartEmpty.

The isRateChartEmpty flag is true when the rate chart has data (see ViewModel line 540: !template.accountChart?.chartSlabs.isNullOrEmpty()). This makes the conditional here read counterintuitively:

  • When data exists (isRateChartEmpty = true): shows "interest rate chart" and enables button ✓
  • When no data (isRateChartEmpty = false): shows "no interest chart" and disables button ✓

The logic produces correct behavior, but the naming is misleading. Consider renaming to hasRateChartData in the ViewModel for clarity.


139-155: Consider extracting chart slab item rendering to improve readability.

The MifosActionsChargeListingComponent is being repurposed for displaying rate chart slabs. The component's parameter names (chargeTitle, collectedOn) don't semantically match their usage here. This works but could be confusing for future maintainers.

Also, the onActionClicked, isExpanded, and onExpandToggle parameters are effectively no-ops here. Consider either:

  1. Creating a dedicated RateChartSlabItem composable
  2. Adding a comment explaining this reuse pattern
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountScreen.kt (1)

93-124: Inconsistent Step() constructor usage.

Some Step instantiations use the named parameter name = while others use positional arguments. Consider using a consistent style throughout for better readability.

     val steps = listOf(
-        Step(stringResource(Res.string.step_details)) {
+        Step(name = stringResource(Res.string.step_details)) {
             DetailsPage(
                 state = state,
                 onAction = onAction,
             )
         },
         Step(name = stringResource(Res.string.step_terms)) {
             ...
         },
         Step(name = stringResource(Res.string.step_settings)) {
             ...
         },
         Step(name = stringResource(Res.string.step_interest)) {
             ...
         },
-        Step(stringResource(Res.string.step_charges)) {
+        Step(name = stringResource(Res.string.step_charges)) {
             ChargesPage(
                 onNext = { onAction(NewFixedDepositAccountAction.OnNextPress) },
             )
         },
     )
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 48b1dee and 295c77d.

📒 Files selected for processing (28)
  • core/model/src/commonMain/kotlin/com/mifos/core/model/objects/template/recurring/AccountChart.kt (1 hunks)
  • core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositTemplate.kt (2 hunks)
  • feature/client/src/commonMain/composeResources/values/strings.xml (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/createShareAccount/pages/DetailsPage.kt (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/createShareAccount/pages/PreviewPage.kt (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/createShareAccount/pages/TermsPage.kt (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountScreen.kt (3 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountViewmodel.kt (7 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/DetailsPage.kt (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/InterestPage.kt (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/SettingsPage.kt (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/TermsPage.kt (1 hunks)
  • feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/ChargesPage.kt (1 hunks)
  • feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/DetailsPage.kt (1 hunks)
  • feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/PreviewPage.kt (1 hunks)
  • feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/SchedulePage.kt (1 hunks)
  • feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/TermsPage.kt (1 hunks)
  • feature/recurringDeposit/src/commonMain/composeResources/values/feature_recurring_deposit_string.xml (1 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt (2 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/ChargesPage.kt (1 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt (2 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/InterestPage.kt (1 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/SettingsPage.kt (1 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt (1 hunks)
  • feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/ChargesPage.kt (1 hunks)
  • feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/DetailsPage.kt (1 hunks)
  • feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/PreviewPage.kt (1 hunks)
  • feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/TermsPage.kt (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt (1)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountViewmodel.kt (1)
  • loadRecurringAccountTemplateWithProduct (306-348)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountViewmodel.kt (1)
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt (1)
  • loadRecurringAccountTemplateWithProduct (294-328)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountScreen.kt (1)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/InterestPage.kt (2)
  • FixedDepositRateChart (120-170)
  • InterestPage (53-118)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: PR Checks / Static Analysis Check
🔇 Additional comments (26)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/createShareAccount/pages/TermsPage.kt (1)

63-67: Parameter reordering looks good; ensure all call sites are updated

Moving onAction after modifier aligns this composable with the normalized API pattern across the PR and matches common Compose conventions. The change is source-compatible only for callers using named arguments; any positional calls like TermsPage(state, onAction) will now fail to compile or misinterpret arguments.

Please verify that all TermsPage invocations have been updated to either:

  • use named arguments (TermsPage(state = ..., onAction = ...)), or
  • follow the new positional order (TermsPage(state, modifier, onAction)).
feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/ChargesPage.kt (1)

47-51: Verify call sites for ChargesPage parameter order change

Parameter order was changed to state, modifier, onAction. This aligns with Compose conventions (required params, modifier with default, then callbacks), but any existing call sites using positional arguments will now bind modifier and onAction incorrectly. Ensure all callers use named arguments or are updated to match the new order.

feature/client/src/commonMain/kotlin/com/mifos/feature/client/createShareAccount/pages/DetailsPage.kt (1)

52-56: Verify all call sites have been updated for the new parameter order.

The parameter reordering (moving modifier before onAction) aligns with standard Compose conventions where modifier typically appears early in the parameter list, after required parameters. This improves consistency across the codebase.

Since this changes the function signature's parameter order, all call sites of DetailsPage must be verified to ensure they use the correct parameter order. Any code using positional arguments will break with this change. Check that either:

  • All call sites have been updated to use the new order, or
  • All call sites use named arguments (which would be unaffected by the reordering)
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt (1)

65-71: Clearing dialogState when moving to the next step is a good safety net

Resetting dialogState alongside currentStep avoids leaking an open dialog into the next step and keeps the UI state machine simpler.

feature/recurringDeposit/src/commonMain/composeResources/values/feature_recurring_deposit_string.xml (1)

64-64: Updated empty-date copy is fine

Changing "Empty Date" to "Date Not Found" is a safe UX text improvement with no behavioral impact. Just ensure any other locales (if present) are kept in sync.

feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/SettingsPage.kt (1)

55-63: Modifier injection follows the shared pattern

Exposing modifier: Modifier = Modifier and applying it to the scrollable inner Column (modifier.weight(1f).verticalScroll(...)) is consistent with other screens and keeps existing behavior for the bottom button row. Looks good.

feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt (1)

56-60: Composable now exposes a modifier; implementation matches the shared pattern

DetailsPage for recurring deposits now takes modifier: Modifier = Modifier and applies it to the scrollable inner Column via modifier.weight(1f).verticalScroll(...), which is consistent with other screens in this PR. This keeps the bottom button row layout stable while allowing callers to tweak the content area’s layout.

Also applies to: 113-116

feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/PreviewPage.kt (1)

75-87: Composable now supports external layout control; verify call sites after signature change

Adding modifier: Modifier = Modifier and using it as modifier.weight(1f).verticalScroll(...) is idiomatic and preserves internal behavior. Since the parameter was inserted before onAction, any positional calls like PreviewPage(state, onAction) must be updated (e.g., to named args) to compile. Verify that all call sites have been updated accordingly.

feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/DetailsPage.kt (1)

56-60: Parameter reordering may break positional callers; modifier wiring is fine

Reordering to DetailsPage(state, modifier: Modifier = Modifier, onAction) aligns with other composables and the modifier is correctly applied to the scrollable Column. However, any existing positional calls like DetailsPage(state, onAction) will now mis-bind arguments. Please confirm all call sites were updated to use the new ordering (or named parameters).

Also applies to: 101-104

feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/ChargesPage.kt (1)

46-50: LGTM! Parameter ordering follows Compose conventions.

The reordering of modifier before onAction aligns with Compose API guidelines where modifier parameters conventionally precede trailing lambdas. This improves API consistency across the codebase.

feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/DetailsPage.kt (1)

54-57: LGTM! Consistent parameter ordering.

The parameter reordering matches the pattern applied across other pages in this PR, improving consistency and following Compose best practices.

feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/TermsPage.kt (1)

49-52: LGTM! Parameter ordering improvement.

Consistent with the standardization effort across the codebase to place modifier before action callbacks.

feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/DetailsPage.kt (1)

63-66: LGTM! Consistent API improvement.

The parameter reordering aligns with Compose conventions and matches the pattern applied throughout this PR.

feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/PreviewPage.kt (1)

57-60: LGTM! Standard Compose parameter ordering.

The signature update maintains consistency with other pages being refactored in this PR.

feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/ChargesPage.kt (1)

61-68: LGTM! Modifier parameter properly added and wired.

The addition of the modifier parameter with a default value maintains backward compatibility while enabling external layout customization. The modifier is correctly threaded to the inner Column at line 68.

feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/TermsPage.kt (1)

39-46: LGTM! Modifier parameter correctly implemented.

The modifier parameter is properly added with a default value and correctly propagated to the inner Column, enabling external layout control while maintaining backward compatibility.

feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/SchedulePage.kt (1)

39-42: LGTM! Completes the consistent parameter ordering refactor.

This change aligns with the standardization pattern applied throughout the PR, placing modifier before the action callback per Compose conventions.

feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/SettingsPage.kt (1)

64-73: LGTM!

The modifier parameter addition follows Compose conventions (state → modifier → callbacks). The modifier is appropriately applied to the scrollable content area while keeping the outer container's layout fixed.

feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/pages/TermsPage.kt (1)

103-107: LGTM!

Parameter reordering to place modifier before onAction aligns with Compose conventions and is consistent with changes across other page composables in this PR.

feature/savings/src/commonMain/kotlin/com/mifos/feature/savings/savingsAccountv2/pages/TermsPage.kt (1)

61-68: LGTM!

Parameter reordering follows Compose conventions and maintains consistency with the broader pattern established across the PR.

feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountViewmodel.kt (2)

243-256: LGTM on dialog state management.

The OnDismissDialog and OnShowRateChart action handlers correctly update dialogState. The pattern is consistent with dialog management practices in Android/Compose.


488-500: LGTM on resetting dialog state during step navigation.

Resetting dialogState = null when moving to the next step ensures dialogs are dismissed automatically, preventing stale UI state.

feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountScreen.kt (2)

69-84: Clean dialog state management implementation.

The separation of dialog handling into its own composable with the sealed DialogState pattern is well-structured and follows good Compose practices for managing dialog visibility.


119-123: ChargesPage uses a different callback pattern than other pages.

Other pages receive state and onAction, but ChargesPage only receives onNext. If ChargesPage will eventually need access to state or additional actions, consider aligning its signature with the other pages for consistency. If this is intentional (e.g., ChargesPage doesn't need state), this is acceptable as-is.

core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositTemplate.kt (1)

58-61: Verify the JSON key for accountChart.

The new accountChart field lacks a @SerialName annotation, similar to lockinPeriodFrequencyTypeOptions and maturityInstructionOptions. This means kotlinx.serialization will use "accountChart" as the JSON key. Ensure this matches the actual API response field name.

core/model/src/commonMain/kotlin/com/mifos/core/model/objects/template/recurring/AccountChart.kt (1)

33-35: LGTM!

The description field addition is consistent with the existing data class patterns - nullable type with null default, no @IgnoredOnParcel annotation (appropriate for simple types), and logically placed near the related name field.

data object RateChartDialog : DialogState
}

val isRateChartEmpty = !template.accountChart?.chartSlabs.isNullOrEmpty()
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Property isRateChartEmpty has inverted semantics.

The property returns true when the chart slabs are not empty, which contradicts what the name suggests. This will confuse anyone reading the code.

Rename to reflect actual semantics:

-    val isRateChartEmpty = !template.accountChart?.chartSlabs.isNullOrEmpty()
+    val hasRateChartData = !template.accountChart?.chartSlabs.isNullOrEmpty()

Then update InterestPage.kt accordingly:

-                text = if (state.isRateChartEmpty) {
+                text = if (state.hasRateChartData) {
                     stringResource(Res.string.feature_fixed_deposit_interest_interest_rate_chart)
                 } else {
                     stringResource(Res.string.feature_fixed_deposit_interest_no_interest_chart)
                 },
-                btnEnabled = state.isRateChartEmpty,
+                btnEnabled = state.hasRateChartData,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
val isRateChartEmpty = !template.accountChart?.chartSlabs.isNullOrEmpty()
val hasRateChartData = !template.accountChart?.chartSlabs.isNullOrEmpty()
🤖 Prompt for AI Agents
In
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/CreateFixedDepositAccountViewmodel.kt
around line 540, the property currently named isRateChartEmpty has inverted
semantics (it returns true when chart slabs are NOT empty); rename it to reflect
actual meaning (e.g., hasRateChart or isRateChartPresent) and invert the boolean
expression to match the new name (or if you keep the name, invert the logic to
use isNullOrEmpty correctly). Then update all usages (specifically
InterestPage.kt) to reference the new property name and adjust any conditional
logic to preserve original behavior.

@therajanmaurya therajanmaurya merged commit 9bbe791 into openMF:development Dec 10, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants