Skip to content

Commit 86d0abd

Browse files
committed
some main updates
1 parent 04d2ed2 commit 86d0abd

File tree

6 files changed

+28
-72
lines changed

6 files changed

+28
-72
lines changed

feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryApplication/BeneficiaryApplicationScreen.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ private fun BeneficiaryApplicationDialogs(
122122
/**
123123
* Composable function to display the beneficiary application screen.
124124
*
125-
* It displays a progress indicator when the UI state is loading, a network error component when the network status is false, and the beneficiary application content when the UI state is success.
125+
* It displays a progress indicator when the UI state is loading, a network error component
126+
* when the network status is false, and the beneficiary application content when the UI state is success.
126127
*
127128
* @param state the current state of the screen.
128129
* @param onAction a function to handle user actions.

feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryDetail/BeneficiaryDetailViewModel.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,8 @@ internal class BeneficiaryDetailViewModel(
130130

131131
/**
132132
* Handles the response from the beneficiary list API and updates the view model state accordingly.
133-
*
134-
* If the response is loading, the view model state is updated to show a loading state.
135-
* If the response is an error, the view model state is updated to show an error state.
136-
* If the response is successful, the view model state is updated to show a success state and the beneficiary is updated to the one with the matching ID.
133+
* If the response is successful, the view model state is updated to show a success state and
134+
* the beneficiary is updated to the one with the matching ID.
137135
*
138136
* @param beneficiary The response from the beneficiary list API.
139137
*/
@@ -198,7 +196,8 @@ internal class BeneficiaryDetailViewModel(
198196
* Processes the result of the delete beneficiary API.
199197
*
200198
* If the response is loading, the view model state is updated to show an overlay.
201-
* If the response is an error, the view model state is updated to show an error state and a dialog is shown with a generic error message.
199+
* If the response is an error, the view model state is updated to show an error state and a dialog
200+
* is shown with a generic error message.
202201
* If the response is successful, the view model state is updated to navigate back to the previous screen.
203202
*
204203
* @param response The response from the delete beneficiary API.

feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryList/BeneficiaryListNavigation.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ fun NavController.navigateToBeneficiaryListScreen() {
3131
*
3232
* @param navigateBack a function to navigate back to the previous screen.
3333
* @param addBeneficiaryClicked a function to navigate to the add beneficiary screen.
34-
* @param onBeneficiaryItemClick a function to navigate to a beneficiary detail screen when a beneficiary item is clicked.
34+
* @param onBeneficiaryItemClick a function to navigate to a beneficiary detail screen when a
35+
* beneficiary item is clicked.
3536
*/
3637
fun NavGraphBuilder.beneficiaryListScreen(
3738
navigateBack: () -> Unit,

feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryList/BeneficiaryListScreen.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ import org.mifos.mobile.core.ui.utils.ScreenUiState
8080
*
8181
* @param navigateBack The callback to navigate back to the previous screen.
8282
* @param addBeneficiaryClicked The callback to navigate to the add beneficiary screen.
83-
* @param onBeneficiaryItemClick The callback to navigate to a beneficiary detail screen when a beneficiary item is clicked.
83+
* @param onBeneficiaryItemClick The callback to navigate to a beneficiary detail screen when a
84+
* beneficiary item is clicked.
8485
* @param modifier The modifier to apply to the composable.
8586
* @param viewModel The view model to use for the beneficiary list screen.
8687
*/

feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryList/BeneficiaryListViewModel.kt

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -406,72 +406,31 @@ data class BeneficiaryListState(
406406
* @param OnAccountChange Change the selected account.
407407
*/
408408
sealed interface BeneficiaryListAction {
409-
/**
410-
* Refresh the list of beneficiaries.
411-
*/
409+
412410
data object RefreshBeneficiaries : BeneficiaryListAction
413411

414-
/**
415-
* Add a new beneficiary.
416-
*/
417412
data object OnAddBeneficiaryClicked : BeneficiaryListAction
418413

419-
/**
420-
* Click on a beneficiary item.
421-
*/
422414
data class OnBeneficiaryItemClick(val position: Long) : BeneficiaryListAction
423415

424-
/**
425-
* Navigate to another screen.
426-
*/
427416
data object OnNavigate : BeneficiaryListAction
428417

429-
/**
430-
* Toggle the filter dialog.
431-
*/
432418
data object ToggleFilter : BeneficiaryListAction
433419

434-
/**
435-
* Reset the filters.
436-
*/
437420
data object ResetFilters : BeneficiaryListAction
438421

439-
/**
440-
* Get the filter results.
441-
*/
442422
data object GetFilterResults : BeneficiaryListAction
443423

444-
/**
445-
* Dismiss the dialog.
446-
*/
447424
data object DismissDialog : BeneficiaryListAction
448425

449-
/**
450-
* Change the selected account.
451-
*/
452426
data class OnAccountChange(val account: String) : BeneficiaryListAction
453427

454-
/**
455-
* Change the selected office.
456-
*/
457428
data class OnOfficeChange(val office: String) : BeneficiaryListAction
458429

459-
/**
460-
* Load the beneficiaries.
461-
*/
462430
data object LoadBeneficiaries : BeneficiaryListAction
463-
464-
/**
465-
* Receive the network status.
466-
*/
467431
data class ReceiveNetworkStatus(val isOnline: Boolean) : BeneficiaryListAction
468432

469433
sealed interface Internal : BeneficiaryListAction {
470-
471-
/**
472-
* Receive the beneficiary result.
473-
* @param beneficiaryList The list of beneficiaries.
474-
*/
475434
data class ReceiveBeneficiaryResult(
476435
val beneficiaryList: DataState<List<Beneficiary>>,
477436
) : Internal
@@ -486,18 +445,7 @@ sealed interface BeneficiaryListAction {
486445
* @param Navigate Navigate to another screen.
487446
*/
488447
sealed interface BeneficiaryListEvent {
489-
/**
490-
* Add a new beneficiary.
491-
*/
492448
data object AddBeneficiaryClicked : BeneficiaryListEvent
493-
494-
/**
495-
* Click on a beneficiary item.
496-
*/
497449
data class BeneficiaryItemClick(val position: Long) : BeneficiaryListEvent
498-
499-
/**
500-
* Navigate to another screen.
501-
*/
502450
data object Navigate : BeneficiaryListEvent
503451
}

feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/navigation/BeneficiaryNavRoute.kt

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,24 @@ fun NavController.navigateToBeneficiaryNavGraph(navOptions: NavOptions? = null)
4141
navigate(BeneficiaryNavRoute, navOptions)
4242

4343
/**
44-
* Adds a navigation graph for the beneficiary feature to the NavGraphBuilder.
44+
* Adds a navigation graph for the beneficiary feature.
4545
*
46-
* @param navController the NavController that will be used to navigate through the graph.
47-
* @param navigateToQR a function that will be called when the user clicks on the QR code button.
48-
* @param navigateToStatusScreen a function that will be called when the user needs to view the status of a beneficiary.
49-
* The function takes in the following parameters:
50-
* - beneficiaryId: the ID of the beneficiary.
51-
* - name: the name of the beneficiary.
52-
* - accountType: the account type of the beneficiary.
53-
* - accountNumber: the account number of the beneficiary.
54-
* - officeName: the office name of the beneficiary.
55-
* @param navigateToAuthenticateScreen a function that will be called when the user needs to authenticate to complete an action.
46+
* The navigation graph has the following destinations:
47+
* - Beneficiary List Screen: The screen that displays the list of all beneficiaries.
48+
* - Manual Beneficiary Add Screen: The screen that allows the user to manually add a beneficiary.
49+
* - Beneficiary Application Confirmation Screen: The screen that confirms the addition of a beneficiary.
50+
* - Beneficiary Detail Screen: The screen that displays the details of a beneficiary.
51+
*
52+
* The navigation graph is structured as follows:
53+
* - The Beneficiary List Screen is the starting point of the graph.
54+
* - The Manual Beneficiary Add Screen is reachable from the Beneficiary List Screen.
55+
* - The Beneficiary Application Confirmation Screen is reachable from the Manual Beneficiary Add Screen.
56+
* - The Beneficiary Detail Screen is reachable from the Beneficiary List Screen and the Manual Beneficiary Add Screen.
57+
*
58+
* @param navController The navigation controller to use for navigation.
59+
* @param navigateToQR A function to navigate to the QR code screen.
60+
* @param navigateToStatusScreen A function to navigate to the status screen.
61+
* @param navigateToAuthenticateScreen A function to navigate to the authentication screen.
5662
*/
5763
fun NavGraphBuilder.beneficiaryNavGraph(
5864
navController: NavController,

0 commit comments

Comments
 (0)