Skip to content

Commit c2c5fe1

Browse files
committed
feat(feature:send-money): handle upi ids in pay anyone feature
1 parent dfd7a00 commit c2c5fe1

File tree

5 files changed

+651
-52
lines changed

5 files changed

+651
-52
lines changed

cmp-shared/src/commonMain/kotlin/org/mifospay/shared/navigation/MifosNavHost.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,8 @@ internal fun MifosNavHost(
332332
navController.navigateToContactsPickerScreen()
333333
},
334334
onContactSelected = { phoneNumber ->
335-
// Handle contact selection - this would typically update the input field
336-
// For now, we'll just navigate back
337-
navController.popBackStack()
335+
// Contact selection updates the input field via ViewModel
336+
// No navigation needed - user stays on Pay Anyone screen
338337
},
339338
)
340339

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2024 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/mobile-wallet/blob/master/LICENSE.md
9+
*/
10+
package org.mifospay.feature.send.money
11+
12+
import kotlinx.serialization.Serializable
13+
14+
enum class ContactType {
15+
PERSON,
16+
BUSINESS,
17+
}
18+
19+
@Serializable
20+
data class Contact(
21+
val id: String,
22+
val name: String,
23+
val phoneNumber: String,
24+
val upiId: String? = null,
25+
val type: ContactType = ContactType.PERSON,
26+
)

feature/send-money/src/commonMain/kotlin/org/mifospay/feature/send/money/ContactsPickerScreen.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import androidx.compose.ui.text.input.ImeAction
4141
import androidx.compose.ui.text.input.KeyboardType
4242
import androidx.compose.ui.text.style.TextAlign
4343
import androidx.compose.ui.unit.dp
44-
import kotlinx.serialization.Serializable
4544
import org.jetbrains.compose.ui.tooling.preview.Preview
4645
import org.mifospay.core.designsystem.component.MifosGradientBackground
4746
import org.mifospay.core.designsystem.component.MifosOutlinedTextField
@@ -54,14 +53,6 @@ import template.core.base.designsystem.theme.KptTheme
5453
@Composable
5554
expect fun ContactPermissionHandler()
5655

57-
@Serializable
58-
data class Contact(
59-
val id: String,
60-
val name: String,
61-
val phoneNumber: String,
62-
val upiId: String? = null,
63-
)
64-
6556
@Composable
6657
fun ContactsPickerScreen(
6758
onBackClick: () -> Unit,

0 commit comments

Comments
 (0)