Skip to content

Commit e827209

Browse files
authored
Ios,web,dev testing (openMF#1830)
1 parent c6b889d commit e827209

File tree

22 files changed

+80
-93
lines changed

22 files changed

+80
-93
lines changed

feature/accounts/src/commonMain/kotlin/org/mifospay/feature/accounts/beneficiary/AddEditBeneficiaryViewModel.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ internal class AddEditBeneficiaryViewModel(
7373
started = SharingStarted.WhileSubscribed(5_000),
7474
)
7575

76-
init {
77-
stateFlow
78-
.onEach { savedStateHandle[KEY] = it }
79-
.launchIn(viewModelScope)
80-
}
76+
// init {
77+
// stateFlow
78+
// .onEach { savedStateHandle[KEY] = it }
79+
// .launchIn(viewModelScope)
80+
// }
8181

8282
override fun handleAction(action: AEBAction) {
8383
when (action) {

feature/accounts/src/commonMain/kotlin/org/mifospay/feature/accounts/savingsaccount/AddEditSavingViewModel.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ internal class AddEditSavingViewModel(
6262
)
6363

6464
init {
65-
stateFlow
66-
.onEach { savedStateHandle[KEY] = it }
67-
.launchIn(viewModelScope)
65+
// stateFlow
66+
// .onEach { savedStateHandle[KEY] = it }
67+
// .launchIn(viewModelScope)
6868

6969
repository.getSavingAccountTemplate(state.clientId).onEach {
7070
sendAction(HandleSavingTemplateResult(it))

feature/auth/src/commonMain/kotlin/org/mifospay/feature/auth/mobileVerify/MobileVerificationViewModel.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class MobileVerificationViewModel(
3232
initialState = savedStateHandle[KEY_STATE] ?: MobileVerificationState.VerifyPhoneState(),
3333
) {
3434

35-
init {
36-
stateFlow.onEach { savedStateHandle[KEY_STATE] = it }.launchIn(viewModelScope)
37-
}
35+
// init {
36+
// stateFlow.onEach { savedStateHandle[KEY_STATE] = it }.launchIn(viewModelScope)
37+
// }
3838

3939
override fun handleAction(action: MobileVerificationAction) {
4040
when (action) {

feature/auth/src/commonMain/kotlin/org/mifospay/feature/auth/signup/SignupViewModel.kt

+6-20
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import kotlinx.coroutines.flow.onEach
1717
import kotlinx.coroutines.flow.update
1818
import kotlinx.coroutines.launch
1919
import org.mifospay.core.common.DataState
20+
import org.mifospay.core.common.IgnoredOnParcel
2021
import org.mifospay.core.common.Parcelable
2122
import org.mifospay.core.common.Parcelize
2223
import org.mifospay.core.common.utils.isValidEmail
@@ -48,9 +49,9 @@ class SignupViewModel(
4849
private var passwordStrengthJob: Job = Job().apply { complete() }
4950

5051
init {
51-
stateFlow
52-
.onEach { savedStateHandle[KEY_STATE] = it }
53-
.launchIn(viewModelScope)
52+
// stateFlow
53+
// .onEach { savedStateHandle[KEY_STATE] = it }
54+
// .launchIn(viewModelScope)
5455

5556
savedStateHandle.get<String>("mobileNumber")?.let {
5657
viewModelScope.launch {
@@ -511,6 +512,7 @@ data class SignUpState(
511512
val dialogState: SignUpDialog? = null,
512513
val passwordStrengthState: PasswordStrengthState = PasswordStrengthState.NONE,
513514
) : Parcelable {
515+
@IgnoredOnParcel
514516
val isPasswordStrong: Boolean
515517
get() = when (passwordStrengthState) {
516518
PasswordStrengthState.NONE,
@@ -525,25 +527,9 @@ data class SignUpState(
525527
-> true
526528
}
527529

530+
@IgnoredOnParcel
528531
val isPasswordMatch: Boolean
529532
get() = passwordInput == confirmPasswordInput
530-
531-
val isSubmitEnabled: Boolean
532-
get() = firstNameInput.isNotEmpty() &&
533-
lastNameInput.isNotEmpty() &&
534-
emailInput.isNotEmpty() &&
535-
userNameInput.isNotEmpty() &&
536-
addressLine1Input.isNotEmpty() &&
537-
addressLine2Input.isNotEmpty() &&
538-
pinCodeInput.isNotEmpty() &&
539-
mobileNumberInput.isNotEmpty() &&
540-
passwordInput.isNotEmpty() &&
541-
confirmPasswordInput.isNotEmpty() &&
542-
stateInput.isNotEmpty() &&
543-
countryInput.isNotEmpty() &&
544-
passwordInput.length >= MIN_PASSWORD_LENGTH &&
545-
isPasswordStrong && isPasswordMatch &&
546-
savingsProductId != 0
547533
}
548534

549535
sealed interface SignUpDialog : Parcelable {

feature/editpassword/src/commonMain/kotlin/org/mifospay/feature/editpassword/EditPasswordViewModel.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ internal class EditPasswordViewModel(
5050

5151
private var passwordStrengthJob: Job = Job().apply { complete() }
5252

53-
init {
54-
stateFlow
55-
.onEach { savedStateHandle[KEY_STATE] = it }
56-
.launchIn(viewModelScope)
57-
}
53+
// init {
54+
// stateFlow
55+
// .onEach { savedStateHandle[KEY_STATE] = it }
56+
// .launchIn(viewModelScope)
57+
// }
5858

5959
override fun handleAction(action: EditPasswordAction) {
6060
when (action) {

feature/invoices/src/commonMain/kotlin/org/mifospay/feature/invoices/InvoicesViewModel.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ class InvoicesViewModel(
3939
InvoiceState(clientId = clientId)
4040
},
4141
) {
42-
init {
43-
stateFlow
44-
.onEach { savedStateHandle[KEY_STATE] = it }
45-
.launchIn(viewModelScope)
46-
}
42+
// init {
43+
// stateFlow
44+
// .onEach { savedStateHandle[KEY_STATE] = it }
45+
// .launchIn(viewModelScope)
46+
// }
4747

4848
val invoiceUiState = invoiceRepository.getInvoices(state.clientId).mapLatest { result ->
4949
when (result) {

feature/invoices/src/commonMain/kotlin/org/mifospay/feature/invoices/details/InvoiceDetailViewModel.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ internal class InvoiceDetailViewModel(
4545
) {
4646

4747
init {
48-
stateFlow
49-
.onEach { savedStateHandle[KEY_STATE] = it }
50-
.launchIn(viewModelScope)
48+
// stateFlow
49+
// .onEach { savedStateHandle[KEY_STATE] = it }
50+
// .launchIn(viewModelScope)
5151

5252
repository.getInvoice(state.clientId, state.invoiceId).onEach {
5353
sendAction(InvoiceDetailResultReceived(it))

feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCDescriptionViewModel.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ class KYCDescriptionViewModel(
6363
initialValue = KYCDescriptionUiState.Loading,
6464
)
6565

66-
init {
67-
stateFlow
68-
.onEach { savedStateHandle[KEY_STATE] = it }
69-
.launchIn(viewModelScope)
70-
}
66+
// init {
67+
// stateFlow
68+
// .onEach { savedStateHandle[KEY_STATE] = it }
69+
// .launchIn(viewModelScope)
70+
// }
7171

7272
override fun handleAction(action: KycAction) {
7373
when (action) {

feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel1ViewModel.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ internal class KYCLevel1ViewModel(
4545
) {
4646

4747
init {
48-
stateFlow
49-
.onEach { savedStateHandle[KEY_STATE] = it }
50-
.launchIn(viewModelScope)
48+
// stateFlow
49+
// .onEach { savedStateHandle[KEY_STATE] = it }
50+
// .launchIn(viewModelScope)
5151

5252
kycLevelRepository.fetchKYCLevel1Details(state.clientId)
5353
.takeUntilResultSuccess()

feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel2ViewModel.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ internal class KYCLevel2ViewModel(
4343
},
4444
) {
4545

46-
init {
47-
stateFlow
48-
.onEach { savedStateHandle[KEY_STATE] = it }
49-
.launchIn(viewModelScope)
50-
}
46+
// init {
47+
// stateFlow
48+
// .onEach { savedStateHandle[KEY_STATE] = it }
49+
// .launchIn(viewModelScope)
50+
// }
5151

5252
override fun handleAction(action: KycLevel2Action) {
5353
when (action) {

feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel3ViewModel.kt

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ package org.mifospay.feature.kyc
1111

1212
import androidx.lifecycle.ViewModel
1313

14+
// TODO: Implement KYC Level3 View Model
1415
class KYCLevel3ViewModel : ViewModel()

feature/make-transfer/src/commonMain/kotlin/org/mifospay/feature/make/transfer/MakeTransferViewModel.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ internal class MakeTransferViewModel(
7878
initialValue = ViewState.Loading,
7979
)
8080

81-
init {
82-
stateFlow.onEach { state ->
83-
savedStateHandle[KEY_STATE] = state
84-
}.launchIn(viewModelScope)
85-
}
81+
// init {
82+
// stateFlow.onEach { state ->
83+
// savedStateHandle[KEY_STATE] = state
84+
// }.launchIn(viewModelScope)
85+
// }
8686

8787
override fun handleAction(action: MakeTransferAction) {
8888
when (action) {

feature/payments/src/commonMain/kotlin/org/mifospay/feature/payments/TransferViewModel.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class TransferViewModel(
3434
},
3535
) {
3636
init {
37-
stateFlow
38-
.onEach { savedStateHandle[KEY] = it }
39-
.launchIn(viewModelScope)
37+
// stateFlow
38+
// .onEach { savedStateHandle[KEY] = it }
39+
// .launchIn(viewModelScope)
4040
}
4141

4242
override fun handleAction(action: TransferAction) {

feature/profile/src/commonMain/kotlin/org/mifospay/feature/profile/edit/EditProfileViewModel.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ internal class EditProfileViewModel(
5151
},
5252
) {
5353
init {
54-
stateFlow
55-
.onEach { savedStateHandle[KEY] = it }
56-
.launchIn(viewModelScope)
54+
// stateFlow
55+
// .onEach { savedStateHandle[KEY] = it }
56+
// .launchIn(viewModelScope)
5757

5858
trySendAction(LoadClientImage(state.clientId))
5959
}

feature/request-money/src/commonMain/kotlin/org/mifospay/feature/request/money/ShowQrViewModel.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ class ShowQrViewModel(
7474
)
7575

7676
init {
77-
stateFlow.onEach {
78-
savedStateHandle[KEY_STATE] = it
79-
}.launchIn(viewModelScope)
77+
// stateFlow.onEach {
78+
// savedStateHandle[KEY_STATE] = it
79+
// }.launchIn(viewModelScope)
8080

8181
viewModelScope.launch {
8282
sendAction(ShowQrAction.Internal.GenerateQr)

feature/savedcards/src/commonMain/kotlin/org/mifospay/feature/savedcards/createOrUpdate/AddEditCardViewModel.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ internal class AddEditCardViewModel(
5353
) {
5454

5555
init {
56-
stateFlow
57-
.onEach { savedStateHandle[KEY] = it }
58-
.launchIn(viewModelScope)
56+
// stateFlow
57+
// .onEach { savedStateHandle[KEY] = it }
58+
// .launchIn(viewModelScope)
5959

6060
if (state.type is CardAddEditType.EditItem) {
6161
repository.getSavedCard(state.clientId, state.type.savedCardId!!).onEach {

feature/savedcards/src/commonMain/kotlin/org/mifospay/feature/savedcards/details/CardDetailViewModel.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ internal class CardDetailViewModel(
5757
initialValue = ViewState.Loading,
5858
)
5959

60-
init {
61-
stateFlow
62-
.onEach { savedStateHandle[KEY_STATE] = it }
63-
.launchIn(viewModelScope)
64-
}
60+
// init {
61+
// stateFlow
62+
// .onEach { savedStateHandle[KEY_STATE] = it }
63+
// .launchIn(viewModelScope)
64+
// }
6565

6666
override fun handleAction(action: CardDetailAction) {
6767
when (action) {

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ class SendMoneyViewModel(
7474
)
7575

7676
init {
77-
stateFlow.onEach {
78-
savedStateHandle[KEY_STATE] = it
79-
}.launchIn(viewModelScope)
77+
// stateFlow.onEach {
78+
// savedStateHandle[KEY_STATE] = it
79+
// }.launchIn(viewModelScope)
8080

8181
savedStateHandle.get<String>("requestData")?.let {
8282
trySendAction(HandleRequestData(it))

feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/StandingInstructionViewModel.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ class StandingInstructionViewModel(
6767
initialValue = SIViewState.Loading,
6868
)
6969

70-
init {
71-
stateFlow
72-
.onEach { savedStateHandle[KEY_STATE] = it }
73-
.launchIn(viewModelScope)
74-
}
70+
// init {
71+
// stateFlow
72+
// .onEach { savedStateHandle[KEY_STATE] = it }
73+
// .launchIn(viewModelScope)
74+
// }
7575

7676
override fun handleAction(action: SIAction) {
7777
when (action) {

feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/createOrUpdate/AddEditSIViewModel.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ internal class AddEditSIViewModel(
7272
val toClientAccounts = _toClientAccounts.asStateFlow()
7373

7474
init {
75-
stateFlow
76-
.onEach { savedStateHandle[KEY_STATE] = it }
77-
.launchIn(viewModelScope)
75+
// stateFlow
76+
// .onEach { savedStateHandle[KEY_STATE] = it }
77+
// .launchIn(viewModelScope)
7878

7979
repository.getStandingInstructionTemplate(
8080
fromOfficeId = state.client.officeId,

feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/details/SIDetailViewModel.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ internal class SIDetailViewModel(
3131
) {
3232

3333
init {
34-
stateFlow
35-
.onEach { savedStateHandle[KEY_STATE] = it }
36-
.launchIn(viewModelScope)
34+
// stateFlow
35+
// .onEach { savedStateHandle[KEY_STATE] = it }
36+
// .launchIn(viewModelScope)
3737

3838
val instructionId = requireNotNull(savedStateHandle.get<Long>("instructionId"))
3939

0 commit comments

Comments
 (0)