feat : New Recurring deposits details screen#2539
feat : New Recurring deposits details screen#2539therajanmaurya merged 4 commits intoopenMF:developmentfrom
Conversation
WalkthroughAdds 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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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
DataManagerRecurringAccountfollows 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
clientIdas a parameter is correct and aligns with the PR objectives to properly pass client context.
82-84: LGTM!The call site correctly passes
state.clientIdto 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
clientIdparameter 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
viewModelOfbinding properly wires theRecurringAccountViewModel.
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosProgressIndicator.kt
Show resolved
Hide resolved
feature/recurringDeposit/src/commonMain/composeResources/values/string.xml
Outdated
Show resolved
Hide resolved
...in/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt
Show resolved
Hide resolved
...in/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/pages/DetailsPage.kt
Show resolved
Hide resolved
...tlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountScreen.kt
Outdated
Show resolved
Hide resolved
...n/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt
Show resolved
Hide resolved
...n/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountViewModel.kt
Show resolved
Hide resolved
207ec3c to
146d0f2
Compare
There was a problem hiding this comment.
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
📒 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
recurringAccountDestinationsignature 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()tokoinViewModel()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 = trueat Line 119 resolves the previous issue where users couldn't recover from errors.
114-114: Breadcrumb navigation enhances UX.The
MifosBreadcrumbNavBarprovides clear navigation context for users in multi-step flows.
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