Skip to content
Open
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 @@ -13,6 +13,9 @@ import org.koin.core.module.dsl.viewModelOf
import org.koin.dsl.module
import org.mifos.mobile.feature.recent.transaction.viewmodel.RecentTransactionViewModel

/**
* Koin module that provides the [RecentTransactionViewModel] for dependency injection.
*/
val recentTransactionModule = module {
viewModelOf(::RecentTransactionViewModel)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,20 @@ import androidx.navigation.compose.composable
import androidx.navigation.compose.navigation
import org.mifos.mobile.feature.recent.transaction.screen.RecentTransactionScreen

/**
* Navigates to the recent transactions feature graph.
*/
fun NavController.navigateToRecentTransactionScreen() {
navigate(RecentTransactionNavigation.RecentTransactionBase.route)
}

/**
* Defines the nested navigation graph for the recent transactions feature.
*
* This graph includes all screens related to recent transactions.
*
* @param navController The [NavController] used to handle navigation events.
*/
Comment on lines +25 to +31
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Document the missing parameter.

The KDoc is missing documentation for the navigateToDetails parameter.

🔎 Suggested fix to add missing parameter documentation
 /**
  * Defines the nested navigation graph for the recent transactions feature.
  *
  * This graph includes all screens related to recent transactions.
  *
  * @param navController The [NavController] used to handle navigation events.
+ * @param navigateToDetails Callback to navigate to transaction details screen with account type, account ID, and transaction ID.
  */
📝 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
/**
* Defines the nested navigation graph for the recent transactions feature.
*
* This graph includes all screens related to recent transactions.
*
* @param navController The [NavController] used to handle navigation events.
*/
/**
* Defines the nested navigation graph for the recent transactions feature.
*
* This graph includes all screens related to recent transactions.
*
* @param navController The [NavController] used to handle navigation events.
* @param navigateToDetails Callback to navigate to transaction details screen with account type, account ID, and transaction ID.
*/
🤖 Prompt for AI Agents
In
feature/recent-transaction/src/commonMain/kotlin/org/mifos/mobile/feature/recent/transaction/navigation/RecentTransactionNavGraph.kt
around lines 25 to 31, the KDoc block for the RecentTransactionNavGraph function
is missing a @param entry for navigateToDetails; add a @param navigateToDetails
description that explains its purpose (e.g., a lambda or function used to
navigate to the transaction details screen) and any expected parameters or
behavior so the documentation fully documents all function parameters.

fun NavGraphBuilder.recentTransactionNavGraph(
navController: NavController,
navigateToDetails: (String, String, Long) -> Unit,
Expand All @@ -34,6 +44,11 @@ fun NavGraphBuilder.recentTransactionNavGraph(
}
}

/**
* Defines the composable route for the main [RecentTransactionScreen].
*
* @param navigateBack Callback to navigate back to the previous screen.
*/
Comment on lines +47 to +51
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Document the missing parameter.

The KDoc is missing documentation for the navigateToDetails parameter.

🔎 Suggested fix to add missing parameter documentation
 /**
  * Defines the composable route for the main [RecentTransactionScreen].
  *
  * @param navigateBack Callback to navigate back to the previous screen.
+ * @param navigateToDetails Callback to navigate to transaction details screen with account type, account ID, and transaction ID.
  */
📝 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
/**
* Defines the composable route for the main [RecentTransactionScreen].
*
* @param navigateBack Callback to navigate back to the previous screen.
*/
/**
* Defines the composable route for the main [RecentTransactionScreen].
*
* @param navigateBack Callback to navigate back to the previous screen.
* @param navigateToDetails Callback to navigate to transaction details screen with account type, account ID, and transaction ID.
*/
🤖 Prompt for AI Agents
In
feature/recent-transaction/src/commonMain/kotlin/org/mifos/mobile/feature/recent/transaction/navigation/RecentTransactionNavGraph.kt
around lines 47 to 51, the KDoc for the composable route documents navigateBack
but omits the navigateToDetails parameter; add a @param navigateToDetails entry
that briefly describes its purpose (e.g., "Callback to navigate to the
transaction details screen, receiving the transaction id or relevant payload")
so both parameters are documented consistently and the KDoc remains complete.

fun NavGraphBuilder.recentTransactionScreenRoute(
navigateBack: () -> Unit,
navigateToDetails: (String, String, Long) -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ package org.mifos.mobile.feature.recent.transaction.navigation
const val RECENT_TRANSACTION_NAVIGATION_ROUTE_BASE = "recent_transaction_base_route"
const val RECENT_TRANSACTION_SCREEN_ROUTE = "recent_transaction_screen_route"

/**
* A sealed class that encapsulates all navigation routes related to recent transactions feature.
*
* @param route The unique string identifier for a navigation destination.
*/
sealed class RecentTransactionNavigation(val route: String) {
data object RecentTransactionBase : RecentTransactionNavigation(
route = RECENT_TRANSACTION_NAVIGATION_ROUTE_BASE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ import org.mifos.mobile.feature.recent.transaction.utils.TransactionFilterType
import org.mifos.mobile.feature.recent.transaction.viewmodel.RecentTransactionViewModel
import template.core.base.designsystem.theme.KptTheme

/**
* The main screen for displaying recent transaction history.
* bottom sheet for filtering. It observes the UI state from [RecentTransactionViewModel]
* to display loading, error, empty, or content views.
*
* @param navigateBack Callback to navigate to the previous screen.
* @param viewModel Instance of [RecentTransactionViewModel] for state management.
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun RecentTransactionScreen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ import org.mifos.mobile.feature.recent.transaction.utils.RecentTransactionUiStat
import org.mifos.mobile.feature.recent.transaction.utils.RecentTransactionUiState.ViewState
import org.mifos.mobile.feature.recent.transaction.utils.TransactionFilterType

/**
* Manages the UI state and data logic for the Recent Transactions screen.
*
* This ViewModel is responsible for fetching all savings accounts for a client, loading the
* transaction history for a selected account, and applying filters (e.g., by credit or debit)
* to the displayed transaction list. It uses a MVI-style architecture with [RecentTransactionAction]
* to process user intents and data-loading events.
*
* @param accountsRepositoryImpl Repository for fetching client accounts.
* @param savingsAccountRepositoryImpl Repository for fetching savings account details and transactions.
* @param networkMonitor Monitors the device's network connectivity status.
* @param userPreferencesRepository Repository for accessing stored user data like client ID.
*/
class RecentTransactionViewModel(
private val accountsRepositoryImpl: AccountsRepository,
private val savingsAccountRepositoryImpl: SavingsAccountRepository,
Expand Down
Loading