Skip to content

Commit a9e273c

Browse files
committed
Client Apply New Applications
1 parent c3aaec1 commit a9e273c

13 files changed

Lines changed: 415 additions & 1 deletion

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 Mifos Initiative
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6+
If a copy of the MPL was not distributed with this file,
7+
You can obtain one at https://mozilla.org/MPL/2.0/.
8+
9+
See https://github.com/openMF/android-client/blob/master/LICENSE.md
10+
-->
11+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
12+
android:width="20dp"
13+
android:height="20dp"
14+
android:viewportWidth="20"
15+
android:viewportHeight="20">
16+
<path
17+
android:pathData="M17.083,15V15.833C17.083,16.75 16.333,17.5 15.417,17.5H3.75C2.825,17.5 2.083,16.75 2.083,15.833V4.167C2.083,3.25 2.825,2.5 3.75,2.5H15.417C16.333,2.5 17.083,3.25 17.083,4.167V5H9.583C8.658,5 7.917,5.75 7.917,6.667V13.333C7.917,14.25 8.658,15 9.583,15H17.083ZM9.583,13.333H17.917V6.667H9.583V13.333ZM12.917,11.25C12.225,11.25 11.667,10.692 11.667,10C11.667,9.308 12.225,8.75 12.917,8.75C13.608,8.75 14.167,9.308 14.167,10C14.167,10.692 13.608,11.25 12.917,11.25Z"
18+
android:strokeAlpha="0.2"
19+
android:fillColor="#191C20"
20+
android:fillAlpha="0.2"/>
21+
</vector>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 Mifos Initiative
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6+
If a copy of the MPL was not distributed with this file,
7+
You can obtain one at https://mozilla.org/MPL/2.0/.
8+
9+
See https://github.com/openMF/android-client/blob/master/LICENSE.md
10+
-->
11+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
12+
android:width="20dp"
13+
android:height="20dp"
14+
android:viewportWidth="20"
15+
android:viewportHeight="20">
16+
<path
17+
android:pathData="M15.833,3.333H15V1.666H13.333V3.333H6.667V1.666H5V3.333H4.167C3.242,3.333 2.508,4.083 2.508,5L2.5,16.667C2.5,17.583 3.242,18.333 4.167,18.333H15.833C16.75,18.333 17.5,17.583 17.5,16.667V5C17.5,4.083 16.75,3.333 15.833,3.333ZM15.833,16.667H4.167V8.333H15.833V16.667ZM7.5,11.667H5.833V10H7.5V11.667ZM10.833,11.667H9.167V10H10.833V11.667ZM14.167,11.667H12.5V10H14.167V11.667ZM7.5,15H5.833V13.333H7.5V15ZM10.833,15H9.167V13.333H10.833V15ZM14.167,15H12.5V13.333H14.167V15Z"
18+
android:strokeAlpha="0.2"
19+
android:fillColor="#191C20"
20+
android:fillAlpha="0.2"/>
21+
</vector>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 Mifos Initiative
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6+
If a copy of the MPL was not distributed with this file,
7+
You can obtain one at https://mozilla.org/MPL/2.0/.
8+
9+
See https://github.com/openMF/android-client/blob/master/LICENSE.md
10+
-->
11+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
12+
android:width="20dp"
13+
android:height="20dp"
14+
android:viewportWidth="20"
15+
android:viewportHeight="20">
16+
<path
17+
android:pathData="M16.525,6.667L14.633,4.775C14.691,4.425 14.783,4.1 14.9,3.817C14.967,3.667 15,3.509 15,3.333C15,2.642 14.441,2.083 13.75,2.083C12.383,2.083 11.175,2.742 10.417,3.75H6.25C3.717,3.75 1.666,5.8 1.666,8.333C1.666,10.867 3.75,17.917 3.75,17.917H8.333V16.25H10V17.917H14.583L15.983,13.259L18.333,12.475V6.667H16.525ZM10.833,7.917H6.667V6.25H10.833V7.917ZM13.333,9.583C12.875,9.583 12.5,9.208 12.5,8.75C12.5,8.292 12.875,7.917 13.333,7.917C13.792,7.917 14.167,8.292 14.167,8.75C14.167,9.208 13.792,9.583 13.333,9.583Z"
18+
android:strokeAlpha="0.2"
19+
android:fillColor="#191C20"
20+
android:fillAlpha="0.2"/>
21+
</vector>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 Mifos Initiative
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6+
If a copy of the MPL was not distributed with this file,
7+
You can obtain one at https://mozilla.org/MPL/2.0/.
8+
9+
See https://github.com/openMF/android-client/blob/master/LICENSE.md
10+
-->
11+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
12+
android:width="20dp"
13+
android:height="20dp"
14+
android:viewportWidth="20"
15+
android:viewportHeight="20">
16+
<path
17+
android:pathData="M10,0.833L2.5,4.167V9.167C2.5,13.792 5.7,18.117 10,19.167C14.3,18.117 17.5,13.792 17.5,9.167V4.167L10,0.833Z"
18+
android:strokeAlpha="0.2"
19+
android:fillColor="#191C20"
20+
android:fillAlpha="0.2"/>
21+
</vector>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 Mifos Initiative
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6+
If a copy of the MPL was not distributed with this file,
7+
You can obtain one at https://mozilla.org/MPL/2.0/.
8+
9+
See https://github.com/openMF/android-client/blob/master/LICENSE.md
10+
-->
11+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
12+
android:width="20dp"
13+
android:height="20dp"
14+
android:viewportWidth="20"
15+
android:viewportHeight="20">
16+
<path
17+
android:pathData="M6.667,7.5H3.333V16.667H6.667V7.5Z"
18+
android:strokeAlpha="0.2"
19+
android:fillColor="#191C20"
20+
android:fillAlpha="0.2"/>
21+
<path
22+
android:pathData="M6.667,3.333H3.333V6.667H6.667V3.333Z"
23+
android:strokeAlpha="0.2"
24+
android:fillColor="#191C20"
25+
android:fillAlpha="0.2"/>
26+
<path
27+
android:pathData="M11.667,5.833H8.333V9.167H11.667V5.833Z"
28+
android:strokeAlpha="0.2"
29+
android:fillColor="#191C20"
30+
android:fillAlpha="0.2"/>
31+
<path
32+
android:pathData="M16.667,8.333H13.333V11.667H16.667V8.333Z"
33+
android:strokeAlpha="0.2"
34+
android:fillColor="#191C20"
35+
android:fillAlpha="0.2"/>
36+
<path
37+
android:pathData="M16.667,12.5H13.333V16.667H16.667V12.5Z"
38+
android:strokeAlpha="0.2"
39+
android:fillColor="#191C20"
40+
android:fillAlpha="0.2"/>
41+
<path
42+
android:pathData="M11.667,10H8.333V16.667H11.667V10Z"
43+
android:strokeAlpha="0.2"
44+
android:fillColor="#191C20"
45+
android:fillAlpha="0.2"/>
46+
</vector>

feature/client/src/commonMain/composeResources/values/strings.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,4 +409,18 @@
409409
<string name="client_collateral_success_title">Collateral Created Successfully</string>
410410
<string name="client_collateral_success_message">Collateral created successfully. Click Continue to navigate to Client detail profile.</string>
411411
<string name="client_collateral_failure_title">Collateral Creation Failed</string>
412+
413+
<!-- Apply New Applications Screen -->
414+
<string name="client_apply_new_applications_title">Choose Application Type</string>
415+
<string name="client_apply_new_applications_loan_account">New Loan Account</string>
416+
<string name="client_apply_new_applications_savings_account">New Savings Account</string>
417+
<string name="client_apply_new_applications_share_account">New Share Account</string>
418+
<string name="client_apply_new_applications_recurring_account">New Recurring Deposit Account</string>
419+
<string name="client_apply_new_applications_fixed_account">New Fixed Deposit Account</string>
420+
<string name="client_apply_new_applications_apply_loan_account">Apply for new loan account</string>
421+
<string name="client_apply_new_applications_apply_savings_account">Apply for new savings account</string>
422+
<string name="client_apply_new_applications_apply_share_account">Apply for new share account</string>
423+
<string name="client_apply_new_applications_apply_recurring_account">Apply for new recurring deposit account</string>
424+
<string name="client_apply_new_applications_apply_fixed_account">Apply for new fixed deposit account</string>
425+
412426
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2025 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/android-client/blob/master/LICENSE.md
9+
*/
10+
package com.mifos.feature.client.clientApplyNewApplications
11+
12+
import androidx.navigation.NavController
13+
import androidx.navigation.NavGraphBuilder
14+
import androidx.navigation.compose.composable
15+
import kotlinx.serialization.Serializable
16+
17+
@Serializable
18+
object ClientApplyNewApplicationRoute
19+
20+
fun NavGraphBuilder.clientApplyNewApplicationRoute(
21+
onNavigateBack: () -> Unit,
22+
onNavigateApplyLoanAccount: () -> Unit,
23+
onNavigateApplySavingsAccount: () -> Unit,
24+
onNavigateApplyShareAccount: () -> Unit,
25+
onNavigateApplyRecurringAccount: () -> Unit,
26+
onNavigateApplyFixedAccount: () -> Unit,
27+
) {
28+
composable<ClientApplyNewApplicationRoute> {
29+
ClientApplyNewApplicationsScreen(
30+
onNavigateBack = onNavigateBack,
31+
onNavigateApplyLoanAccount = onNavigateApplyLoanAccount,
32+
onNavigateApplySavingsAccount = onNavigateApplySavingsAccount,
33+
onNavigateApplyShareAccount = onNavigateApplyShareAccount,
34+
onNavigateApplyRecurringAccount = onNavigateApplyRecurringAccount,
35+
onNavigateApplyFixedAccount = onNavigateApplyFixedAccount,
36+
)
37+
}
38+
}
39+
40+
fun NavController.navigateToClientApplyNewApplicationScreen() {
41+
this.navigate(ClientApplyNewApplicationRoute)
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
/*
2+
* Copyright 2025 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/android-client/blob/master/LICENSE.md
9+
*/
10+
package com.mifos.feature.client.clientApplyNewApplications
11+
12+
import androidclient.feature.client.generated.resources.Res
13+
import androidclient.feature.client.generated.resources.account_balance_wallet
14+
import androidclient.feature.client.generated.resources.calendar_month
15+
import androidclient.feature.client.generated.resources.client_apply_new_applications_apply_fixed_account
16+
import androidclient.feature.client.generated.resources.client_apply_new_applications_apply_loan_account
17+
import androidclient.feature.client.generated.resources.client_apply_new_applications_apply_recurring_account
18+
import androidclient.feature.client.generated.resources.client_apply_new_applications_apply_savings_account
19+
import androidclient.feature.client.generated.resources.client_apply_new_applications_fixed_account
20+
import androidclient.feature.client.generated.resources.client_apply_new_applications_loan_account
21+
import androidclient.feature.client.generated.resources.client_apply_new_applications_recurring_account
22+
import androidclient.feature.client.generated.resources.client_apply_new_applications_savings_account
23+
import androidclient.feature.client.generated.resources.client_apply_new_applications_share_account
24+
import androidclient.feature.client.generated.resources.client_apply_new_applications_title
25+
import androidclient.feature.client.generated.resources.savings
26+
import androidclient.feature.client.generated.resources.shield
27+
import androidclient.feature.client.generated.resources.stacked_bar_chart
28+
import androidx.compose.foundation.clickable
29+
import androidx.compose.foundation.layout.Box
30+
import androidx.compose.foundation.layout.Column
31+
import androidx.compose.foundation.layout.Spacer
32+
import androidx.compose.foundation.layout.height
33+
import androidx.compose.foundation.layout.padding
34+
import androidx.compose.material3.MaterialTheme
35+
import androidx.compose.material3.Text
36+
import androidx.compose.runtime.Composable
37+
import androidx.compose.runtime.remember
38+
import androidx.compose.ui.Modifier
39+
import com.mifos.core.designsystem.component.MifosScaffold
40+
import com.mifos.core.designsystem.theme.DesignToken
41+
import com.mifos.core.designsystem.theme.MifosTypography
42+
import com.mifos.core.ui.components.MifosRowCard
43+
import com.mifos.core.ui.util.EventsEffect
44+
import com.mifos.core.ui.util.TextUtil
45+
import kotlinx.collections.immutable.ImmutableList
46+
import kotlinx.collections.immutable.persistentListOf
47+
import org.jetbrains.compose.resources.DrawableResource
48+
import org.jetbrains.compose.resources.StringResource
49+
import org.jetbrains.compose.resources.stringResource
50+
import org.koin.compose.viewmodel.koinViewModel
51+
52+
@Composable
53+
internal fun ClientApplyNewApplicationsScreen(
54+
onNavigateBack: () -> Unit,
55+
onNavigateApplyLoanAccount: () -> Unit,
56+
onNavigateApplySavingsAccount: () -> Unit,
57+
onNavigateApplyShareAccount: () -> Unit,
58+
onNavigateApplyRecurringAccount: () -> Unit,
59+
onNavigateApplyFixedAccount: () -> Unit,
60+
viewModel: ClientApplyNewApplicationsViewModel = koinViewModel(),
61+
) {
62+
EventsEffect(viewModel.eventFlow) { event ->
63+
when (event) {
64+
ClientApplyNewApplicationsEvent.NavigateBack -> onNavigateBack()
65+
is ClientApplyNewApplicationsEvent.OnActionClick -> {
66+
when (event.action) {
67+
ClientApplyNewApplicationsItem.NewFixedAccount -> onNavigateApplyFixedAccount()
68+
ClientApplyNewApplicationsItem.NewLoanAccount -> onNavigateApplyLoanAccount()
69+
ClientApplyNewApplicationsItem.NewRecurringAccount -> onNavigateApplyRecurringAccount()
70+
ClientApplyNewApplicationsItem.NewSavingsAccount -> onNavigateApplySavingsAccount()
71+
ClientApplyNewApplicationsItem.NewShareAccount -> onNavigateApplyShareAccount()
72+
}
73+
}
74+
}
75+
}
76+
77+
ClientApplyNewApplicationsContent(
78+
onAction = remember(viewModel) { { viewModel.trySendAction(it) } },
79+
)
80+
}
81+
82+
@Composable
83+
private fun ClientApplyNewApplicationsContent(
84+
onAction: (ClientApplyNewApplicationsAction) -> Unit,
85+
) {
86+
MifosScaffold(
87+
title = "",
88+
onBackPressed = {
89+
onAction(ClientApplyNewApplicationsAction.NavigateBack)
90+
},
91+
) { paddingValues ->
92+
Box(
93+
modifier = Modifier.padding(paddingValues),
94+
) {
95+
Column(
96+
modifier = Modifier.padding(horizontal = DesignToken.padding.large),
97+
) {
98+
Text(
99+
text = stringResource(Res.string.client_apply_new_applications_title),
100+
style = MifosTypography.labelLargeEmphasized,
101+
)
102+
103+
Spacer(modifier = Modifier.height(DesignToken.spacing.medium))
104+
105+
clientApplyNewApplicationsItems.forEach {
106+
MifosRowCard(
107+
title = stringResource(it.title),
108+
imageVector = it.icon,
109+
leftValues = listOf(
110+
TextUtil(
111+
text = stringResource(it.subTitle),
112+
style = MifosTypography.bodySmall,
113+
color = MaterialTheme.colorScheme.secondary,
114+
),
115+
),
116+
rightValues = emptyList(),
117+
modifier = Modifier
118+
.clickable {
119+
onAction(ClientApplyNewApplicationsAction.OnActionClick(it))
120+
}
121+
.padding(vertical = DesignToken.padding.medium),
122+
)
123+
}
124+
}
125+
}
126+
}
127+
}
128+
129+
sealed class ClientApplyNewApplicationsItem(
130+
val title: StringResource,
131+
val subTitle: StringResource,
132+
val icon: DrawableResource,
133+
) {
134+
data object NewLoanAccount : ClientApplyNewApplicationsItem(
135+
title = Res.string.client_apply_new_applications_loan_account,
136+
subTitle = Res.string.client_apply_new_applications_apply_loan_account,
137+
icon = Res.drawable.account_balance_wallet,
138+
)
139+
140+
data object NewSavingsAccount : ClientApplyNewApplicationsItem(
141+
title = Res.string.client_apply_new_applications_savings_account,
142+
subTitle = Res.string.client_apply_new_applications_apply_savings_account,
143+
icon = Res.drawable.savings,
144+
)
145+
146+
data object NewShareAccount : ClientApplyNewApplicationsItem(
147+
title = Res.string.client_apply_new_applications_share_account,
148+
subTitle = Res.string.client_apply_new_applications_apply_loan_account,
149+
icon = Res.drawable.stacked_bar_chart,
150+
)
151+
152+
data object NewRecurringAccount : ClientApplyNewApplicationsItem(
153+
title = Res.string.client_apply_new_applications_recurring_account,
154+
subTitle = Res.string.client_apply_new_applications_apply_recurring_account,
155+
icon = Res.drawable.calendar_month,
156+
)
157+
158+
data object NewFixedAccount : ClientApplyNewApplicationsItem(
159+
title = Res.string.client_apply_new_applications_fixed_account,
160+
subTitle = Res.string.client_apply_new_applications_apply_fixed_account,
161+
icon = Res.drawable.shield,
162+
)
163+
}
164+
165+
internal val clientApplyNewApplicationsItems: ImmutableList<ClientApplyNewApplicationsItem> =
166+
persistentListOf(
167+
ClientApplyNewApplicationsItem.NewLoanAccount,
168+
ClientApplyNewApplicationsItem.NewSavingsAccount,
169+
ClientApplyNewApplicationsItem.NewShareAccount,
170+
ClientApplyNewApplicationsItem.NewRecurringAccount,
171+
ClientApplyNewApplicationsItem.NewFixedAccount,
172+
)

0 commit comments

Comments
 (0)