Skip to content

Commit 0d10464

Browse files
authored
Documentation done for feature/third-party-transfer (#2989)
1 parent a07a625 commit 0d10464

File tree

5 files changed

+68
-2
lines changed

5 files changed

+68
-2
lines changed

feature/third-party-transfer/src/commonMain/kotlin/org/mifos/mobile/feature/third/party/transfer/di/ThirdPartyTransferModule.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import org.koin.core.module.dsl.viewModelOf
1313
import org.koin.dsl.module
1414
import org.mifos.mobile.feature.third.party.transfer.thirdPartyTransfer.TptViewModel
1515

16+
/**
17+
* Koin module for the Third Party Transfer feature.
18+
*/
1619
val ThirdPartyTransferModule = module {
1720
viewModelOf(::TptViewModel)
1821
}

feature/third-party-transfer/src/commonMain/kotlin/org/mifos/mobile/feature/third/party/transfer/navigation/ThirdPartyTransferRoute.kt

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,48 @@ import org.mifos.mobile.core.model.entity.payload.ReviewTransferPayload
1818
import org.mifos.mobile.feature.third.party.transfer.thirdPartyTransfer.TptScreenRoute
1919
import org.mifos.mobile.feature.third.party.transfer.thirdPartyTransfer.tptScreenDestination
2020

21+
/**
22+
* Sealed class representing the possible navigation destinations within the Third Party Transfer feature.
23+
*/
2124
sealed class TptNavigationDestination {
22-
// Add more as needed
25+
/** Represents the notification screen. */
2326
object Notification : TptNavigationDestination()
27+
28+
/** Represents the transfer process screen, carrying a [ReviewTransferPayload]. */
2429
class TransferProcess(val payload: ReviewTransferPayload) : TptNavigationDestination()
30+
31+
/** Represents the add beneficiary screen. */
2532
object AddBeneficiaryScreen : TptNavigationDestination()
2633
}
2734

35+
/**
36+
* Type alias for a navigator function that handles [TptNavigationDestination].
37+
*/
2838
typealias TptNavigator = (TptNavigationDestination) -> Unit
2939

40+
/**
41+
* Serializable data object representing the root route for the Third Party Transfer navigation graph.
42+
*/
3043
@Serializable
3144
data object ThirdPartyTransferNavGraphRoute
3245

46+
/**
47+
* Navigates to the Third Party Transfer navigation graph.
48+
*
49+
* @param navOptions Optional navigation options for the graph.
50+
*/
3351
fun NavController.navigateToTptGraph(navOptions: NavOptions? = null) {
3452
this.navigate(
3553
ThirdPartyTransferNavGraphRoute,
3654
navOptions = navOptions,
3755
)
3856
}
3957

58+
/**
59+
* Builds the navigation graph for the Third Party Transfer feature.
60+
*
61+
* @param onNavigate A [TptNavigator] function to handle navigation events within the graph.
62+
*/
4063
fun NavGraphBuilder.tptGraphDestination(
4164
onNavigate: TptNavigator,
4265
) {

feature/third-party-transfer/src/commonMain/kotlin/org/mifos/mobile/feature/third/party/transfer/thirdPartyTransfer/TptScreen.kt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ import org.mifos.mobile.core.ui.utils.ScreenUiState
6161
import org.mifos.mobile.feature.third.party.transfer.navigation.TptNavigationDestination
6262
import org.mifos.mobile.feature.third.party.transfer.navigation.TptNavigator
6363

64+
/**
65+
* Composable function for the Third Party Transfer screen.
66+
*
67+
* @param onNavigate A [TptNavigator] function to handle navigation events from this screen.
68+
* @param viewModel The view model for the Third Party Transfer screen, defaulting to a Koin view model.
69+
* */
6470
@Composable
6571
internal fun TptScreen(
6672
onNavigate: TptNavigator,
@@ -99,6 +105,12 @@ internal fun TptScreen(
99105
)
100106
}
101107

108+
/**
109+
* Composable function for the Third Party Transfer dialog.
110+
*
111+
* @param dialogState The dialog state for the Third Party Transfer screen.
112+
* @param onAction A [TptAction] function to handle actions from this dialog.
113+
* */
102114
@Composable
103115
internal fun TptDialog(
104116
dialogState: TptState.DialogState?,
@@ -118,6 +130,14 @@ internal fun TptDialog(
118130
}
119131
}
120132

133+
/**
134+
* Composable function for the main content of the Third Party Transfer screen.
135+
* It handles displaying the loading indicator, error messages, and the main form.
136+
*
137+
* @param state The current state of the Third Party Transfer screen.
138+
* @param onAction A function to handle actions from this composable.
139+
* @param modifier The modifier to apply to this composable.
140+
*/
121141
@Composable
122142
internal fun TprContent(
123143
state: TptState,
@@ -177,6 +197,13 @@ internal fun TprContent(
177197
}
178198
}
179199

200+
/**
201+
* Composable function for the Third Party Transfer form.
202+
*
203+
* @param state The state for the Third Party Transfer screen.
204+
* @param onAction A [TptAction] function to handle actions from this form.
205+
* @param modifier The modifier to apply to this composable.
206+
* */
180207
@Composable
181208
internal fun TptForm(
182209
state: TptState,

feature/third-party-transfer/src/commonMain/kotlin/org/mifos/mobile/feature/third/party/transfer/thirdPartyTransfer/TptScreenRoute.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,26 @@ import kotlinx.serialization.Serializable
1616
import org.mifos.mobile.core.ui.composableWithSlideTransitions
1717
import org.mifos.mobile.feature.third.party.transfer.navigation.TptNavigator
1818

19+
/**
20+
* Serializable data object representing the route for the Third Party Transfer screen.
21+
*/
1922
@Serializable
2023
data object TptScreenRoute
2124

25+
/**
26+
* Navigates to the Third Party Transfer screen.
27+
*
28+
* @param navOptions Optional navigation options.
29+
*/
2230
fun NavController.navigateToTptScreen(navOptions: NavOptions? = null) {
2331
this.navigate(TptScreenRoute, navOptions)
2432
}
2533

34+
/**
35+
* Defines the destination for the Third Party Transfer screen within the navigation graph.
36+
*
37+
* @param onNavigate A [TptNavigator] function to handle navigation events from this screen.
38+
*/
2639
fun NavGraphBuilder.tptScreenDestination(
2740
onNavigate: TptNavigator,
2841
) {

feature/third-party-transfer/src/commonMain/kotlin/org/mifos/mobile/feature/third/party/transfer/thirdPartyTransfer/TptViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ internal class TptViewModel(
6161

6262
private var validationJob: Job? = null
6363

64-
/*
64+
/**
6565
* Functions related to UI State and Dialogs
6666
*/
6767

0 commit comments

Comments
 (0)