Skip to content

feat : New Recurring deposits details screen#2539

Merged
therajanmaurya merged 4 commits intoopenMF:developmentfrom
revanthkumarJ:newFixedDeposits_details
Nov 7, 2025
Merged

feat : New Recurring deposits details screen#2539
therajanmaurya merged 4 commits intoopenMF:developmentfrom
revanthkumarJ:newFixedDeposits_details

Conversation

@revanthkumarJ
Copy link
Contributor

@revanthkumarJ revanthkumarJ commented Nov 7, 2025

Fixes - Jira-#550

Next is Enabled even External id is empty because it is an optional parameter.

WhatsApp.Video.2025-11-07.at.11.38.49.AM.mp4

@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

Walkthrough

Adds a recurring deposit feature: DI registration and build dependency, navigation updated to pass clientId, new RecurringAccountViewModel with richer state and actions, state-driven UI/screens with loading/error handling, plus small UI and data-layer adjustments.

Changes

Cohort / File(s) Summary
Build & Navigation DI
cmp-navigation/build.gradle.kts, cmp-navigation/src/commonMain/kotlin/cmp/navigation/di/KoinModules.kt
Added implementation(projects.feature.recurringDeposit) and registered RecurringDepositModule in Koin wiring.
Data Manager DI
core/network/src/commonMain/kotlin/com/mifos/core/network/di/DataMangerModule.kt, core/network/src/commonMain/kotlin/com/mifos/core/network/datamanager/DataManagerRecurringAccount.kt
Added DI binding single { DataManagerRecurringAccount(get()) }. Removed UserPreferencesRepository from DataManagerRecurringAccount constructor.
UI Component
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosProgressIndicator.kt
Added MifosProgressIndicatorMini composable and preview.
Client Navigation & Callbacks
feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientApplyNewApplications/ClientApplyNewApplicationRoute.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientApplyNewApplications/ClientApplyNewApplicationsScreen.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt
Changed recurring-account navigation callbacks to accept clientId: Int and updated call sites to forward the id; updated destination invocation to pass navController.
Recurring Deposit Routing
feature/recurringDeposit/src/commonMain/kotlin/.../newRecurringDepositAccount/RecurringAccountRoute.kt
Converted RecurringAccountRoute from a data object to data class RecurringAccountRoute(val clientId: Int = -1); recurringAccountDestination now takes NavController; navigateToRecurringAccountRoute now accepts clientId: Int.
Recurring Deposit Feature DI
feature/recurringDeposit/src/commonMain/kotlin/.../newRecurringDepositAccount/di/RecurringDepositModule.kt
Added RecurringDepositModule Koin module wiring RecurringAccountViewModel via viewModelOf(::RecurringAccountViewModel).
ViewModel & Screen
feature/recurringDeposit/src/commonMain/kotlin/.../newRecurringDepositAccount/RecurringAccountViewModel.kt, feature/recurringDeposit/src/commonMain/kotlin/.../newRecurringDepositAccount/RecurringAccountScreen.kt
Introduced DI-backed RecurringAccountViewModel (constructor: RecurringAccountRepository, SavedStateHandle), richer RecurringAccountState (clientId, template, field officers, submission date, mini loader, State sealed type), many new actions, initial template loading, and handlers. Screen switched to koinViewModel(), accepts NavController, and renders Loading/Error/Success states.
Details Page & Interactions
feature/recurringDeposit/src/commonMain/kotlin/.../newRecurringDepositAccount/pages/DetailsPage.kt
Refactored DetailsPage signature to DetailsPage(state: RecurringAccountState, onAction: (RecurringAccountAction) -> Unit). Added product dropdown, date picker, field officer dropdown, external id input, mini loader, and Back/Next two-button row emitting structured actions.
Strings
feature/recurringDeposit/src/commonMain/composeResources/values/string.xml
Added UI strings: select, cancel, product_name, submitted_on, field_officer, external_id, back, next (plus other minor string updates).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Nav as Navigation
    participant Screen as RecurringAccountScreen
    participant VM as RecurringAccountViewModel
    participant Repo as RecurringAccountRepository
    participant UI as DetailsPage / Components

    User->>Nav: navigateToRecurringAccountRoute(clientId)
    Nav->>Screen: open with clientId
    Screen->>VM: init(savedStateHandle -> clientId)
    VM->>Repo: loadRecurringAccountTemplate()
    Repo-->>VM: template / error
    VM-->>Screen: state = Loading / Success / Error
    Screen->>UI: render according to state

    alt Success
      User->>UI: select product
      UI->>VM: OnProductNameChange(index)
      VM->>Repo: loadRecurringAccountTemplateWithProduct()
      Repo-->>VM: product template
      VM-->>Screen: update state (isMiniLoaderActive false)
      User->>UI: fill date/officer/external id
      UI->>VM: OnSubmissionDateChange / OnFieldOfficerChange / OnExternalIdChange
      UI->>VM: OnAction(NextStep)
    else Error
      User->>Screen: retry
      Screen->>VM: OnAction(Retry)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Focus review on:
    • RecurringAccountViewModel.kt — initialization via SavedStateHandle, state transitions, coroutine usage, and action handlers.
    • RecurringAccountScreen.kt and DetailsPage.kt — ensure UI correctly reflects new state model and actions; date picker and mini-loader correctness.
    • Navigation changes — ensure clientId is threaded correctly through routes and NavController usage.
    • DI updates — verify RecurringDepositModule registration and DataManagerRecurringAccount binding match constructor changes.

Poem

🐰
I hopped in code to wire a route,
With forms and loaders, not a doubt,
Products picked and dates that shine,
States aligned, one step, then nine,
A tiny feature, stitched just right — hooray, delight!

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
Title check ✅ Passed The title accurately describes the main change: introducing a new Recurring deposits details screen with proper feature prefix and clear scope.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ 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.

@revanthkumarJ revanthkumarJ marked this pull request as ready for review November 7, 2025 05:32
@revanthkumarJ revanthkumarJ changed the title feat : New fixed deposits details screen feat : New Recurring deposits details screen Nov 7, 2025
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: 7

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4af9cd8 and 207ec3c.

📒 Files selected for processing (13)
  • cmp-navigation/build.gradle.kts (1 hunks)
  • cmp-navigation/src/commonMain/kotlin/cmp/navigation/di/KoinModules.kt (2 hunks)
  • core/network/src/commonMain/kotlin/com/mifos/core/network/datamanager/DataManagerRecurringAccount.kt (0 hunks)
  • core/network/src/commonMain/kotlin/com/mifos/core/network/di/DataMangerModule.kt (2 hunks)
  • core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosProgressIndicator.kt (2 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientApplyNewApplications/ClientApplyNewApplicationRoute.kt (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientApplyNewApplications/ClientApplyNewApplicationsScreen.kt (2 hunks)
  • feature/recurringDeposit/src/commonMain/composeResources/values/string.xml (1 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountRoute.kt (2 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt (4 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt (3 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/di/RecurringDepositModule.kt (1 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt (1 hunks)
💤 Files with no reviewable changes (1)
  • core/network/src/commonMain/kotlin/com/mifos/core/network/datamanager/DataManagerRecurringAccount.kt
🧰 Additional context used
🧬 Code graph analysis (3)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosProgressIndicator.kt (1)
core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/theme/Theme.kt (1)
  • MifosTheme (250-275)
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt (4)
core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/component/MifosTextFieldDropdown.kt (1)
  • MifosTextFieldDropdown (39-112)
core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/component/MifosOutlinedTextField.kt (1)
  • MifosDatePickerTextField (363-402)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosProgressIndicator.kt (1)
  • MifosProgressIndicatorMini (122-146)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosTwoButtonRow.kt (1)
  • MifosTwoButtonRow (31-91)
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt (3)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosErrorComponent.kt (1)
  • MifosErrorComponent (41-60)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosProgressIndicator.kt (1)
  • MifosProgressIndicator (41-68)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosStepper.kt (1)
  • MifosStepper (47-139)
⏰ 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 (9)
core/network/src/commonMain/kotlin/com/mifos/core/network/di/DataMangerModule.kt (1)

27-27: LGTM!

The DI wiring for DataManagerRecurringAccount follows the established pattern and is correctly integrated into the module.

Also applies to: 56-56

core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosProgressIndicator.kt (1)

156-162: LGTM!

The preview function is correctly structured and follows the established pattern.

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

19-27: LGTM!

The new string resources are well-structured and follow naming conventions.

feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientApplyNewApplications/ClientApplyNewApplicationsScreen.kt (2)

65-65: LGTM!

The signature change to accept clientId as a parameter is correct and aligns with the PR objectives to properly pass client context.


82-84: LGTM!

The call site correctly passes state.clientId to the navigation callback.

feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientApplyNewApplications/ClientApplyNewApplicationRoute.kt (1)

28-28: LGTM!

The route signature update is consistent with the screen changes and properly propagates the clientId parameter through the navigation flow.

cmp-navigation/src/commonMain/kotlin/cmp/navigation/di/KoinModules.kt (1)

34-34: LGTM!

The DI module registration follows the established pattern and is correctly positioned alphabetically among other feature modules.

Also applies to: 87-87

cmp-navigation/build.gradle.kts (1)

49-49: LGTM!

The dependency addition is necessary and correctly placed in the commonMain dependencies block.

feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/di/RecurringDepositModule.kt (1)

1-18: LGTM!

The DI module is correctly structured and follows the established pattern for feature modules in the codebase. The viewModelOf binding properly wires the RecurringAccountViewModel.

@revanthkumarJ revanthkumarJ force-pushed the newFixedDeposits_details branch from 207ec3c to 146d0f2 Compare November 7, 2025 05:49
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

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

114-153: CRITICAL: Submission date and External ID are still blocked when field officers are absent.

This critical issue was flagged in a previous review but remains unresolved. Lines 115-121 (submission date picker) and 140-151 (external ID field) are inside the if (!state.template?.fieldOfficerOptions.isNullOrEmpty()) guard. When the API returns no field officers (a common scenario), these required fields become inaccessible, preventing users from entering data needed to enable the Next button, effectively dead-ending the flow.

Move the submission date picker (lines 115-121), the External ID field (lines 140-151), and their associated spacers OUTSIDE the conditional block. Keep only the field officer dropdown (lines 124-138) and its spacer inside the conditional:

         label = stringResource(Res.string.product_name),
     )
 
+    MifosDatePickerTextField(
+        value = state.submissionDate,
+        label = stringResource(Res.string.submitted_on),
+        openDatePicker = {
+            onAction(RecurringAccountAction.OnSubmissionDatePick(true))
+        },
+    )
+
+    Spacer(Modifier.height(DesignToken.padding.large))
+
     if (!state.template?.fieldOfficerOptions.isNullOrEmpty()) {
-        MifosDatePickerTextField(
-            value = state.submissionDate,
-            label = stringResource(Res.string.submitted_on),
-            openDatePicker = {
-                onAction(RecurringAccountAction.OnSubmissionDatePick(true))
-            },
-        )
-
-        Spacer(Modifier.height(DesignToken.padding.large))
         MifosTextFieldDropdown(
             value = if (state.fieldOfficerIndex == -1) {
                 ""
@@ -136,19 +136,21 @@
             } ?: emptyList(),
             label = stringResource(Res.string.field_officer),
         )
-
-        MifosOutlinedTextField(
-            value = state.externalId,
-            onValueChange = {
-                onAction(RecurringAccountAction.OnExternalIdChange(it))
-            },
-            label = stringResource(Res.string.external_id),
-            config = MifosTextFieldConfig(
-                keyboardOptions = KeyboardOptions(
-                    keyboardType = KeyboardType.Text,
-                ),
-            ),
-        )
         Spacer(Modifier.height(DesignToken.padding.large))
     }
+
+    MifosOutlinedTextField(
+        value = state.externalId,
+        onValueChange = {
+            onAction(RecurringAccountAction.OnExternalIdChange(it))
+        },
+        label = stringResource(Res.string.external_id),
+        config = MifosTextFieldConfig(
+            keyboardOptions = KeyboardOptions(
+                keyboardType = KeyboardType.Text,
+            ),
+        ),
+    )
+    Spacer(Modifier.height(DesignToken.padding.large))
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 207ec3c and 977ec34.

📒 Files selected for processing (5)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt (1 hunks)
  • feature/recurringDeposit/src/commonMain/composeResources/values/string.xml (1 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountRoute.kt (1 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt (4 hunks)
  • feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt (1)
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountRoute.kt (1)
  • recurringAccountDestination (22-32)
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountRoute.kt (1)
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt (1)
  • RecurringAccountScreen (43-66)
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt (5)
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt (1)
  • DetailsPage (51-168)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosBreadCrumb.kt (1)
  • MifosBreadcrumbNavBar (36-107)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosErrorComponent.kt (1)
  • MifosErrorComponent (41-60)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosProgressIndicator.kt (1)
  • MifosProgressIndicator (41-68)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosStepper.kt (1)
  • MifosStepper (47-139)
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt (4)
core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/component/MifosTextFieldDropdown.kt (1)
  • MifosTextFieldDropdown (39-112)
core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/component/MifosOutlinedTextField.kt (1)
  • MifosDatePickerTextField (363-402)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosProgressIndicator.kt (1)
  • MifosProgressIndicatorMini (122-146)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosTwoButtonRow.kt (1)
  • MifosTwoButtonRow (31-91)
⏰ 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 / Build Android Application
🔇 Additional comments (10)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt (1)

359-359: LGTM!

The navController parameter correctly aligns with the updated recurringAccountDestination signature in RecurringAccountRoute.kt.

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

18-27: LGTM!

The new string resources follow proper naming conventions and will support the state-driven Details Page UI components.

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

22-31: LGTM!

The navController parameter integration is correctly implemented and aligns with the updated RecurringAccountScreen signature.

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

57-64: Date picker constraints look reasonable.

The selectable dates constraint prevents selecting dates before yesterday, which is appropriate for submission dates.


66-95: DatePickerDialog implementation is correct.

The dialog properly handles state management and dispatches the appropriate actions for date selection.


98-112: Product name dropdown is correctly implemented.

The dropdown properly handles the unselected state and dispatches product name changes via actions.


159-166: Button row is correctly placed outside the conditional block.

The navigation buttons are properly rendered regardless of field officer availability, allowing users to navigate once required fields are filled.

feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt (3)

45-49: Proper dependency injection with Koin.

The switch from viewModel() to koinViewModel() correctly integrates with the DI module setup for the recurring deposit feature.


109-140: Well-structured state machine with proper error recovery.

The state-driven UI correctly handles Loading, Error, and Success states. The addition of isRetryEnabled = true at Line 119 resolves the previous issue where users couldn't recover from errors.


114-114: Breadcrumb navigation enhances UX.

The MifosBreadcrumbNavBar provides clear navigation context for users in multi-step flows.

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