Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c721f03
feat: enhance recurring deposit account settings and UI components
TheKalpeshPawar Oct 21, 2025
f36b374
feat: add keyboard options for number input in recurring deposit sett…
TheKalpeshPawar Oct 21, 2025
f6451c8
feat: add keyboard options for number input in recurring deposit sett…
TheKalpeshPawar Oct 21, 2025
c95396f
fix: add missing commas and improve formatting in recurring deposit a…
TheKalpeshPawar Oct 21, 2025
8d71c75
spotless fixes
TheKalpeshPawar Oct 21, 2025
142f37c
feat: implement loading state indicator and refactor dialog state man…
TheKalpeshPawar Oct 22, 2025
acf6209
feat: add RecurringDepositAccountDialogBox to RecurringAccountScreen
TheKalpeshPawar Oct 22, 2025
e1f16fb
fix: remove unnecessary blank line in RecurringAccountViewModel
TheKalpeshPawar Oct 22, 2025
1a40db7
refactor: rename dialogState to screenState and update related logic …
TheKalpeshPawar Oct 23, 2025
acd510a
fix: clean up formatting and remove unnecessary blank lines in Recurr…
TheKalpeshPawar Oct 23, 2025
57eb5cc
feat: enhance recurring deposit account settings and UI components
TheKalpeshPawar Oct 21, 2025
09c4ba1
refactor: rename dialogState to screenState and update related logic …
TheKalpeshPawar Oct 23, 2025
0ccaf11
feat: improve amount formatting logic and enhance UI layout in Recurr…
TheKalpeshPawar Oct 28, 2025
cb277b8
fix: remove duplicate import of RecurringDepositModule in KoinModules
TheKalpeshPawar Oct 28, 2025
be3bb4e
feat: enhance amount formatting and validate network connectivity in …
TheKalpeshPawar Oct 28, 2025
71d3b57
feat: rename network observation method and enhance connectivity chec…
TheKalpeshPawar Oct 28, 2025
d22f064
refactor: clean up code formatting and improve readability in DataMan…
TheKalpeshPawar Oct 28, 2025
cb2c4a8
feat: rename string resources for recurring deposit feature
TheKalpeshPawar Oct 29, 2025
7fa9360
Merge branch 'development' into settings-recurring-deposit-account
TheKalpeshPawar Nov 5, 2025
c2ec400
feat: update navigation for recurring account flow and improve layout…
TheKalpeshPawar Nov 5, 2025
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
1 change: 1 addition & 0 deletions cmp-navigation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ kotlin {
implementation(projects.feature.pathTracking)
implementation(projects.feature.report)
implementation(projects.feature.savings)
implementation(projects.feature.recurringDeposit)
implementation(projects.feature.settings)
implementation(projects.feature.search)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.mifos.feature.loan.di.LoanModule
import com.mifos.feature.note.di.NoteModule
import com.mifos.feature.offline.di.OfflineModule
import com.mifos.feature.path.tracking.di.PathTrackingModule
import com.mifos.feature.recurringDeposit.di.RecurringDepositModule
import com.mifos.feature.report.di.ReportModule
import com.mifos.feature.savings.di.SavingsModule
import com.mifos.feature.search.di.SearchModule
Expand Down Expand Up @@ -83,6 +84,7 @@ object KoinModules {
OfflineModule,
PathTrackingModule,
ReportModule,
RecurringDepositModule,
SavingsModule,
SearchModule,
SettingsModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import kotlinx.coroutines.flow.Flow

interface RecurringAccountRepository {

fun getRecuttingAccountRepository(): Flow<DataState<RecurringDepositAccountTemplate>>
fun getRecurringAccountTemplate(): Flow<DataState<RecurringDepositAccountTemplate>>

fun getRecuttingAccountRepositoryBtProduct(
fun getRecurringAccountTemplateByProduct(
clientId: Int,
productId: Int,
): Flow<DataState<RecurringDepositAccountTemplate>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import kotlinx.coroutines.flow.Flow
class RecurringAccountRepositoryImp(
val dataManagerRecurringAccount: DataManagerRecurringAccount,
) : RecurringAccountRepository {
override fun getRecuttingAccountRepository(): Flow<DataState<RecurringDepositAccountTemplate>> {
override fun getRecurringAccountTemplate(): Flow<DataState<RecurringDepositAccountTemplate>> {
return dataManagerRecurringAccount.getRecurringDepositAccountTemplate
.asDataStateFlow()
}

override fun getRecuttingAccountRepositoryBtProduct(
override fun getRecurringAccountTemplateByProduct(
clientId: Int,
productId: Int,
): Flow<DataState<RecurringDepositAccountTemplate>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import kotlinx.serialization.Serializable

@Serializable
data class RecurringDepositAccountPayload(
// val charges: List<Any>? = null,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you tell me why this has been commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't find a representation of that parameter in the api call.
It sends an empty array or object.

I also couldn't find its use.
So, in future, if someone does find its use or the proper representation of the data type, they can update the code.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to add a TODO comment for future reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay sir. I will keep this in mind.

val adjustAdvanceTowardsFuturePayments: Boolean? = null,
val allowWithdrawal: Boolean? = null,
// val charges: List<Any>? = null,
val clientId: Int? = null,
val dateFormat: String? = null,
val depositPeriod: Int? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
package com.mifos.core.network.datamanager

import com.mifos.core.datastore.UserPreferencesRepository
import com.mifos.core.model.objects.payloads.RecurringDepositAccountPayload
import com.mifos.core.network.BaseApiManager
import com.mifos.room.entities.accounts.recurring.RecurringDeposit
Expand All @@ -18,7 +17,6 @@ import kotlinx.coroutines.flow.Flow

class DataManagerRecurringAccount(
val mBaseApiManager: BaseApiManager,
private val prefManager: UserPreferencesRepository,
) {

fun createRecurringDepositAccount(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.mifos.core.network.datamanager.DataManagerIdentifiers
import com.mifos.core.network.datamanager.DataManagerLoan
import com.mifos.core.network.datamanager.DataManagerNote
import com.mifos.core.network.datamanager.DataManagerOffices
import com.mifos.core.network.datamanager.DataManagerRecurringAccount
import com.mifos.core.network.datamanager.DataManagerRunReport
import com.mifos.core.network.datamanager.DataManagerSavings
import com.mifos.core.network.datamanager.DataManagerSearch
Expand Down Expand Up @@ -52,5 +53,6 @@ val DataManagerModule = module {
single { DataManagerStaff(get(), get(), get()) }
single { DataManagerSurveys(get(), get(), get()) }
single { DataManagerIdentifiers(get()) }
single { DataManagerRecurringAccount(get()) }
single { DataManagerShare(get()) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fun NavGraphBuilder.clientApplyNewApplicationRoute(
onNavigateApplyLoanAccount: (Int) -> Unit,
onNavigateApplySavingsAccount: (Int) -> Unit,
onNavigateApplyShareAccount: (Int) -> Unit,
onNavigateApplyRecurringAccount: () -> Unit,
onNavigateApplyRecurringAccount: (Int) -> Unit,
onNavigateApplyFixedAccount: () -> Unit,
navController: NavController,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ internal fun ClientApplyNewApplicationsScreen(
onNavigateApplyLoanAccount: (Int) -> Unit,
onNavigateApplySavingsAccount: (Int) -> Unit,
onNavigateApplyShareAccount: (Int) -> Unit,
onNavigateApplyRecurringAccount: () -> Unit,
onNavigateApplyRecurringAccount: (Int) -> Unit,
onNavigateApplyFixedAccount: () -> Unit,
navController: NavController,
viewModel: ClientApplyNewApplicationsViewModel = koinViewModel(),
Expand All @@ -75,15 +75,9 @@ internal fun ClientApplyNewApplicationsScreen(
is ClientApplyNewApplicationsEvent.OnActionClick -> {
when (event.action) {
ClientApplyNewApplicationsItem.NewFixedAccount -> onNavigateApplyFixedAccount()
ClientApplyNewApplicationsItem.NewLoanAccount -> onNavigateApplyLoanAccount(
state.clientId,
)

ClientApplyNewApplicationsItem.NewRecurringAccount -> onNavigateApplyRecurringAccount()
ClientApplyNewApplicationsItem.NewSavingsAccount -> onNavigateApplySavingsAccount(
state.clientId,
)

ClientApplyNewApplicationsItem.NewLoanAccount -> onNavigateApplyLoanAccount(state.clientId)
ClientApplyNewApplicationsItem.NewRecurringAccount -> onNavigateApplyRecurringAccount(state.clientId)
ClientApplyNewApplicationsItem.NewSavingsAccount -> onNavigateApplySavingsAccount(state.clientId)
ClientApplyNewApplicationsItem.NewShareAccount -> onNavigateApplyShareAccount(state.clientId)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ fun NavGraphBuilder.clientNavGraph(
createShareAccountDestination(
navController = navController,
)
recurringAccountDestination()
recurringAccountDestination(
navController = navController,
)
fixedAccountDestination()
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2024 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
-->
<resources>
<string name="feature_recurringDeposit_step_details">Details</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the convention followed for modules names with two words.

Suggested change
<string name="feature_recurringDeposit_step_details">Details</string>
<string name="feature_recurring_deposit_step_details">Details</string>

<string name="feature_recurringDeposit_step_terms">Terms</string>
<string name="feature_recurringDeposit_step_settings">Settings</string>
<string name="feature_recurringDeposit_step_interest">Interest</string>
<string name="feature_recurringDeposit_step_charges">Charges</string>
<string name="feature_recurringDeposit_create_recurring_deposit_account">Create Recurring Deposit Account</string>
<string name="feature_recurringDeposit_is_mandatory_deposit">Is Mandatory Deposit?</string>
<string name="feature_recurringDeposit_adjust_advance_payments">Adjust advance payments toward future installments?</string>
<string name="feature_recurringDeposit_allow_withdrawals">Allow Withdrawals?</string>
<string name="feature_recurringDeposit_lock_in_period">Lock-in Period</string>
<string name="feature_recurringDeposit_frequency">Frequency</string>
<string name="feature_recurringDeposit_type">Type</string>
<string name="feature_recurringDeposit_recurring_deposit_details">Recurring Deposit Details</string>
<string name="feature_recurringDeposit_recurring_deposit_amount">Recurring Deposit Amount</string>
<string name="feature_recurringDeposit_deposit_period">Deposit Period</string>
<string name="feature_recurringDeposit_deposit_frequency_same_as_meeting">Deposit Frequency Same as Group/Center meeting</string>
<string name="feature_recurringDeposit_minimum_deposit_term">Minimum Deposit Term</string>
<string name="feature_recurringDeposit_in_multiples_of">And thereafter, in Multiples of</string>
<string name="feature_recurringDeposit_maximum_deposit_term">Maximum Deposit Term</string>
<string name="feature_recurringDeposit_for_pre_mature_closure">For Pre-mature closure</string>
<string name="feature_recurringDeposit_apply_penal_interest">Apply Penal Interest (less)</string>
<string name="feature_recurringDeposit_penal_interest_percentage">Penal Interest (%)</string>
<string name="feature_recurringDeposit_period">Period</string>
<string name="feature_recurringDeposit_minimum_balance_for_interest">Minimum Balance For Interest Calculation</string>
<string name="feature_recurringDeposit_back">Back</string>
<string name="feature_recurringDeposit_next">Next</string>
<string name="feature_recurringDeposit_no_internet_connection">No Internet Connection</string>
</resources>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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.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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,26 @@ import androidx.navigation.compose.composable
import kotlinx.serialization.Serializable

@Serializable
data object RecurringAccountRoute
data class RecurringAccountRoute(
val clientId: Int = -1,
)
Comment on lines +18 to +20
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Validate or remove the default clientId value.

The default value of -1 suggests an invalid/unset state. Consider either:

  • Removing the default to force callers to provide a valid clientId
  • Adding validation to ensure clientId > 0 before proceeding
-data class RecurringAccountRoute(
-    val clientId: Int = -1,
-)
+data class RecurringAccountRoute(
+    val clientId: Int,
+)
📝 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
data class RecurringAccountRoute(
val clientId: Int = -1,
)
data class RecurringAccountRoute(
val clientId: Int,
)
🤖 Prompt for AI Agents
In
feature/recurringDeposit/src/commonMain/kotlin/com/mifos/feature/recurringDeposit/newRecurringDepositAccount/RecurringAccountRoute.kt
around lines 18 to 20, the data class uses a default clientId = -1 which
represents an invalid/unset state; either remove the default so callers must
supply a clientId, or keep the field but add validation where instances are
created/used to enforce clientId > 0 and throw or return a clear error when
invalid; implement one of these two options consistently across
constructors/factory functions and any deserialization paths.


fun NavGraphBuilder.recurringAccountDestination() {
fun NavGraphBuilder.recurringAccountDestination(
navController: NavController,
) {
composable<RecurringAccountRoute> {
RecurringAccountScreen(
navController = navController,
onNavigateBack = {},
onFinish = {},
)
}
}

fun NavController.navigateToRecurringAccountRoute() {
fun NavController.navigateToRecurringAccountRoute(
clientId: Int,
) {
this.navigate(
RecurringAccountRoute,
RecurringAccountRoute(clientId = clientId),
)
}
Loading