diff --git a/feature/accounts/src/commonMain/kotlin/org/mifospay/feature/accounts/beneficiary/AddEditBeneficiaryViewModel.kt b/feature/accounts/src/commonMain/kotlin/org/mifospay/feature/accounts/beneficiary/AddEditBeneficiaryViewModel.kt index d0c49976b..dcd90478a 100644 --- a/feature/accounts/src/commonMain/kotlin/org/mifospay/feature/accounts/beneficiary/AddEditBeneficiaryViewModel.kt +++ b/feature/accounts/src/commonMain/kotlin/org/mifospay/feature/accounts/beneficiary/AddEditBeneficiaryViewModel.kt @@ -73,11 +73,11 @@ internal class AddEditBeneficiaryViewModel( started = SharingStarted.WhileSubscribed(5_000), ) - init { - stateFlow - .onEach { savedStateHandle[KEY] = it } - .launchIn(viewModelScope) - } +// init { +// stateFlow +// .onEach { savedStateHandle[KEY] = it } +// .launchIn(viewModelScope) +// } override fun handleAction(action: AEBAction) { when (action) { diff --git a/feature/accounts/src/commonMain/kotlin/org/mifospay/feature/accounts/savingsaccount/AddEditSavingViewModel.kt b/feature/accounts/src/commonMain/kotlin/org/mifospay/feature/accounts/savingsaccount/AddEditSavingViewModel.kt index a86278487..06cfd24b9 100644 --- a/feature/accounts/src/commonMain/kotlin/org/mifospay/feature/accounts/savingsaccount/AddEditSavingViewModel.kt +++ b/feature/accounts/src/commonMain/kotlin/org/mifospay/feature/accounts/savingsaccount/AddEditSavingViewModel.kt @@ -62,9 +62,9 @@ internal class AddEditSavingViewModel( ) init { - stateFlow - .onEach { savedStateHandle[KEY] = it } - .launchIn(viewModelScope) +// stateFlow +// .onEach { savedStateHandle[KEY] = it } +// .launchIn(viewModelScope) repository.getSavingAccountTemplate(state.clientId).onEach { sendAction(HandleSavingTemplateResult(it)) diff --git a/feature/auth/src/commonMain/kotlin/org/mifospay/feature/auth/mobileVerify/MobileVerificationViewModel.kt b/feature/auth/src/commonMain/kotlin/org/mifospay/feature/auth/mobileVerify/MobileVerificationViewModel.kt index 925cb7751..6a02827d3 100644 --- a/feature/auth/src/commonMain/kotlin/org/mifospay/feature/auth/mobileVerify/MobileVerificationViewModel.kt +++ b/feature/auth/src/commonMain/kotlin/org/mifospay/feature/auth/mobileVerify/MobileVerificationViewModel.kt @@ -32,9 +32,9 @@ class MobileVerificationViewModel( initialState = savedStateHandle[KEY_STATE] ?: MobileVerificationState.VerifyPhoneState(), ) { - init { - stateFlow.onEach { savedStateHandle[KEY_STATE] = it }.launchIn(viewModelScope) - } +// init { +// stateFlow.onEach { savedStateHandle[KEY_STATE] = it }.launchIn(viewModelScope) +// } override fun handleAction(action: MobileVerificationAction) { when (action) { diff --git a/feature/auth/src/commonMain/kotlin/org/mifospay/feature/auth/signup/SignupViewModel.kt b/feature/auth/src/commonMain/kotlin/org/mifospay/feature/auth/signup/SignupViewModel.kt index 82b7cd68d..0ce65ae00 100644 --- a/feature/auth/src/commonMain/kotlin/org/mifospay/feature/auth/signup/SignupViewModel.kt +++ b/feature/auth/src/commonMain/kotlin/org/mifospay/feature/auth/signup/SignupViewModel.kt @@ -17,6 +17,7 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import org.mifospay.core.common.DataState +import org.mifospay.core.common.IgnoredOnParcel import org.mifospay.core.common.Parcelable import org.mifospay.core.common.Parcelize import org.mifospay.core.common.utils.isValidEmail @@ -48,9 +49,9 @@ class SignupViewModel( private var passwordStrengthJob: Job = Job().apply { complete() } init { - stateFlow - .onEach { savedStateHandle[KEY_STATE] = it } - .launchIn(viewModelScope) +// stateFlow +// .onEach { savedStateHandle[KEY_STATE] = it } +// .launchIn(viewModelScope) savedStateHandle.get("mobileNumber")?.let { viewModelScope.launch { @@ -511,6 +512,7 @@ data class SignUpState( val dialogState: SignUpDialog? = null, val passwordStrengthState: PasswordStrengthState = PasswordStrengthState.NONE, ) : Parcelable { + @IgnoredOnParcel val isPasswordStrong: Boolean get() = when (passwordStrengthState) { PasswordStrengthState.NONE, @@ -525,25 +527,9 @@ data class SignUpState( -> true } + @IgnoredOnParcel val isPasswordMatch: Boolean get() = passwordInput == confirmPasswordInput - - val isSubmitEnabled: Boolean - get() = firstNameInput.isNotEmpty() && - lastNameInput.isNotEmpty() && - emailInput.isNotEmpty() && - userNameInput.isNotEmpty() && - addressLine1Input.isNotEmpty() && - addressLine2Input.isNotEmpty() && - pinCodeInput.isNotEmpty() && - mobileNumberInput.isNotEmpty() && - passwordInput.isNotEmpty() && - confirmPasswordInput.isNotEmpty() && - stateInput.isNotEmpty() && - countryInput.isNotEmpty() && - passwordInput.length >= MIN_PASSWORD_LENGTH && - isPasswordStrong && isPasswordMatch && - savingsProductId != 0 } sealed interface SignUpDialog : Parcelable { diff --git a/feature/editpassword/src/commonMain/kotlin/org/mifospay/feature/editpassword/EditPasswordViewModel.kt b/feature/editpassword/src/commonMain/kotlin/org/mifospay/feature/editpassword/EditPasswordViewModel.kt index 2ef978ea5..f9101ffcc 100644 --- a/feature/editpassword/src/commonMain/kotlin/org/mifospay/feature/editpassword/EditPasswordViewModel.kt +++ b/feature/editpassword/src/commonMain/kotlin/org/mifospay/feature/editpassword/EditPasswordViewModel.kt @@ -50,11 +50,11 @@ internal class EditPasswordViewModel( private var passwordStrengthJob: Job = Job().apply { complete() } - init { - stateFlow - .onEach { savedStateHandle[KEY_STATE] = it } - .launchIn(viewModelScope) - } +// init { +// stateFlow +// .onEach { savedStateHandle[KEY_STATE] = it } +// .launchIn(viewModelScope) +// } override fun handleAction(action: EditPasswordAction) { when (action) { diff --git a/feature/invoices/src/commonMain/kotlin/org/mifospay/feature/invoices/InvoicesViewModel.kt b/feature/invoices/src/commonMain/kotlin/org/mifospay/feature/invoices/InvoicesViewModel.kt index 6cf210bf4..fb3d5db7c 100644 --- a/feature/invoices/src/commonMain/kotlin/org/mifospay/feature/invoices/InvoicesViewModel.kt +++ b/feature/invoices/src/commonMain/kotlin/org/mifospay/feature/invoices/InvoicesViewModel.kt @@ -39,11 +39,11 @@ class InvoicesViewModel( InvoiceState(clientId = clientId) }, ) { - init { - stateFlow - .onEach { savedStateHandle[KEY_STATE] = it } - .launchIn(viewModelScope) - } +// init { +// stateFlow +// .onEach { savedStateHandle[KEY_STATE] = it } +// .launchIn(viewModelScope) +// } val invoiceUiState = invoiceRepository.getInvoices(state.clientId).mapLatest { result -> when (result) { diff --git a/feature/invoices/src/commonMain/kotlin/org/mifospay/feature/invoices/details/InvoiceDetailViewModel.kt b/feature/invoices/src/commonMain/kotlin/org/mifospay/feature/invoices/details/InvoiceDetailViewModel.kt index d2c89ecb3..80f1fa9e4 100644 --- a/feature/invoices/src/commonMain/kotlin/org/mifospay/feature/invoices/details/InvoiceDetailViewModel.kt +++ b/feature/invoices/src/commonMain/kotlin/org/mifospay/feature/invoices/details/InvoiceDetailViewModel.kt @@ -45,9 +45,9 @@ internal class InvoiceDetailViewModel( ) { init { - stateFlow - .onEach { savedStateHandle[KEY_STATE] = it } - .launchIn(viewModelScope) +// stateFlow +// .onEach { savedStateHandle[KEY_STATE] = it } +// .launchIn(viewModelScope) repository.getInvoice(state.clientId, state.invoiceId).onEach { sendAction(InvoiceDetailResultReceived(it)) diff --git a/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCDescriptionViewModel.kt b/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCDescriptionViewModel.kt index 19658b811..f651624c7 100644 --- a/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCDescriptionViewModel.kt +++ b/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCDescriptionViewModel.kt @@ -63,11 +63,11 @@ class KYCDescriptionViewModel( initialValue = KYCDescriptionUiState.Loading, ) - init { - stateFlow - .onEach { savedStateHandle[KEY_STATE] = it } - .launchIn(viewModelScope) - } +// init { +// stateFlow +// .onEach { savedStateHandle[KEY_STATE] = it } +// .launchIn(viewModelScope) +// } override fun handleAction(action: KycAction) { when (action) { diff --git a/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel1ViewModel.kt b/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel1ViewModel.kt index ec6885466..e0e1e5ed7 100644 --- a/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel1ViewModel.kt +++ b/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel1ViewModel.kt @@ -45,9 +45,9 @@ internal class KYCLevel1ViewModel( ) { init { - stateFlow - .onEach { savedStateHandle[KEY_STATE] = it } - .launchIn(viewModelScope) +// stateFlow +// .onEach { savedStateHandle[KEY_STATE] = it } +// .launchIn(viewModelScope) kycLevelRepository.fetchKYCLevel1Details(state.clientId) .takeUntilResultSuccess() diff --git a/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel2ViewModel.kt b/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel2ViewModel.kt index 3835790ea..acc54fbf0 100644 --- a/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel2ViewModel.kt +++ b/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel2ViewModel.kt @@ -43,11 +43,11 @@ internal class KYCLevel2ViewModel( }, ) { - init { - stateFlow - .onEach { savedStateHandle[KEY_STATE] = it } - .launchIn(viewModelScope) - } +// init { +// stateFlow +// .onEach { savedStateHandle[KEY_STATE] = it } +// .launchIn(viewModelScope) +// } override fun handleAction(action: KycLevel2Action) { when (action) { diff --git a/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel3ViewModel.kt b/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel3ViewModel.kt index 09585d4e4..d94877386 100644 --- a/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel3ViewModel.kt +++ b/feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel3ViewModel.kt @@ -11,4 +11,5 @@ package org.mifospay.feature.kyc import androidx.lifecycle.ViewModel +// TODO: Implement KYC Level3 View Model class KYCLevel3ViewModel : ViewModel() diff --git a/feature/make-transfer/src/commonMain/kotlin/org/mifospay/feature/make/transfer/MakeTransferViewModel.kt b/feature/make-transfer/src/commonMain/kotlin/org/mifospay/feature/make/transfer/MakeTransferViewModel.kt index 5bf1730d5..84b0e8a72 100644 --- a/feature/make-transfer/src/commonMain/kotlin/org/mifospay/feature/make/transfer/MakeTransferViewModel.kt +++ b/feature/make-transfer/src/commonMain/kotlin/org/mifospay/feature/make/transfer/MakeTransferViewModel.kt @@ -78,11 +78,11 @@ internal class MakeTransferViewModel( initialValue = ViewState.Loading, ) - init { - stateFlow.onEach { state -> - savedStateHandle[KEY_STATE] = state - }.launchIn(viewModelScope) - } +// init { +// stateFlow.onEach { state -> +// savedStateHandle[KEY_STATE] = state +// }.launchIn(viewModelScope) +// } override fun handleAction(action: MakeTransferAction) { when (action) { diff --git a/feature/payments/src/commonMain/kotlin/org/mifospay/feature/payments/TransferViewModel.kt b/feature/payments/src/commonMain/kotlin/org/mifospay/feature/payments/TransferViewModel.kt index e0cdce776..6da2b7870 100644 --- a/feature/payments/src/commonMain/kotlin/org/mifospay/feature/payments/TransferViewModel.kt +++ b/feature/payments/src/commonMain/kotlin/org/mifospay/feature/payments/TransferViewModel.kt @@ -34,9 +34,9 @@ class TransferViewModel( }, ) { init { - stateFlow - .onEach { savedStateHandle[KEY] = it } - .launchIn(viewModelScope) +// stateFlow +// .onEach { savedStateHandle[KEY] = it } +// .launchIn(viewModelScope) } override fun handleAction(action: TransferAction) { diff --git a/feature/profile/src/commonMain/kotlin/org/mifospay/feature/profile/edit/EditProfileViewModel.kt b/feature/profile/src/commonMain/kotlin/org/mifospay/feature/profile/edit/EditProfileViewModel.kt index a74e1e851..5880d2f64 100644 --- a/feature/profile/src/commonMain/kotlin/org/mifospay/feature/profile/edit/EditProfileViewModel.kt +++ b/feature/profile/src/commonMain/kotlin/org/mifospay/feature/profile/edit/EditProfileViewModel.kt @@ -51,9 +51,9 @@ internal class EditProfileViewModel( }, ) { init { - stateFlow - .onEach { savedStateHandle[KEY] = it } - .launchIn(viewModelScope) +// stateFlow +// .onEach { savedStateHandle[KEY] = it } +// .launchIn(viewModelScope) trySendAction(LoadClientImage(state.clientId)) } diff --git a/feature/request-money/src/commonMain/kotlin/org/mifospay/feature/request/money/ShowQrViewModel.kt b/feature/request-money/src/commonMain/kotlin/org/mifospay/feature/request/money/ShowQrViewModel.kt index b5d9301e6..0a3de6292 100644 --- a/feature/request-money/src/commonMain/kotlin/org/mifospay/feature/request/money/ShowQrViewModel.kt +++ b/feature/request-money/src/commonMain/kotlin/org/mifospay/feature/request/money/ShowQrViewModel.kt @@ -74,9 +74,9 @@ class ShowQrViewModel( ) init { - stateFlow.onEach { - savedStateHandle[KEY_STATE] = it - }.launchIn(viewModelScope) +// stateFlow.onEach { +// savedStateHandle[KEY_STATE] = it +// }.launchIn(viewModelScope) viewModelScope.launch { sendAction(ShowQrAction.Internal.GenerateQr) diff --git a/feature/savedcards/src/commonMain/kotlin/org/mifospay/feature/savedcards/createOrUpdate/AddEditCardViewModel.kt b/feature/savedcards/src/commonMain/kotlin/org/mifospay/feature/savedcards/createOrUpdate/AddEditCardViewModel.kt index eb06d9524..340122154 100644 --- a/feature/savedcards/src/commonMain/kotlin/org/mifospay/feature/savedcards/createOrUpdate/AddEditCardViewModel.kt +++ b/feature/savedcards/src/commonMain/kotlin/org/mifospay/feature/savedcards/createOrUpdate/AddEditCardViewModel.kt @@ -53,9 +53,9 @@ internal class AddEditCardViewModel( ) { init { - stateFlow - .onEach { savedStateHandle[KEY] = it } - .launchIn(viewModelScope) +// stateFlow +// .onEach { savedStateHandle[KEY] = it } +// .launchIn(viewModelScope) if (state.type is CardAddEditType.EditItem) { repository.getSavedCard(state.clientId, state.type.savedCardId!!).onEach { diff --git a/feature/savedcards/src/commonMain/kotlin/org/mifospay/feature/savedcards/details/CardDetailViewModel.kt b/feature/savedcards/src/commonMain/kotlin/org/mifospay/feature/savedcards/details/CardDetailViewModel.kt index a700f35e3..0cd07a273 100644 --- a/feature/savedcards/src/commonMain/kotlin/org/mifospay/feature/savedcards/details/CardDetailViewModel.kt +++ b/feature/savedcards/src/commonMain/kotlin/org/mifospay/feature/savedcards/details/CardDetailViewModel.kt @@ -57,11 +57,11 @@ internal class CardDetailViewModel( initialValue = ViewState.Loading, ) - init { - stateFlow - .onEach { savedStateHandle[KEY_STATE] = it } - .launchIn(viewModelScope) - } +// init { +// stateFlow +// .onEach { savedStateHandle[KEY_STATE] = it } +// .launchIn(viewModelScope) +// } override fun handleAction(action: CardDetailAction) { when (action) { diff --git a/feature/send-money/src/commonMain/kotlin/org/mifospay/feature/send/money/SendMoneyViewModel.kt b/feature/send-money/src/commonMain/kotlin/org/mifospay/feature/send/money/SendMoneyViewModel.kt index f239c4ad2..d8778d57f 100644 --- a/feature/send-money/src/commonMain/kotlin/org/mifospay/feature/send/money/SendMoneyViewModel.kt +++ b/feature/send-money/src/commonMain/kotlin/org/mifospay/feature/send/money/SendMoneyViewModel.kt @@ -74,9 +74,9 @@ class SendMoneyViewModel( ) init { - stateFlow.onEach { - savedStateHandle[KEY_STATE] = it - }.launchIn(viewModelScope) +// stateFlow.onEach { +// savedStateHandle[KEY_STATE] = it +// }.launchIn(viewModelScope) savedStateHandle.get("requestData")?.let { trySendAction(HandleRequestData(it)) diff --git a/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/StandingInstructionViewModel.kt b/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/StandingInstructionViewModel.kt index 52c589e12..de63f4d63 100644 --- a/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/StandingInstructionViewModel.kt +++ b/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/StandingInstructionViewModel.kt @@ -67,11 +67,11 @@ class StandingInstructionViewModel( initialValue = SIViewState.Loading, ) - init { - stateFlow - .onEach { savedStateHandle[KEY_STATE] = it } - .launchIn(viewModelScope) - } +// init { +// stateFlow +// .onEach { savedStateHandle[KEY_STATE] = it } +// .launchIn(viewModelScope) +// } override fun handleAction(action: SIAction) { when (action) { diff --git a/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/createOrUpdate/AddEditSIViewModel.kt b/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/createOrUpdate/AddEditSIViewModel.kt index 4c84260be..27ecd61a5 100644 --- a/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/createOrUpdate/AddEditSIViewModel.kt +++ b/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/createOrUpdate/AddEditSIViewModel.kt @@ -72,9 +72,9 @@ internal class AddEditSIViewModel( val toClientAccounts = _toClientAccounts.asStateFlow() init { - stateFlow - .onEach { savedStateHandle[KEY_STATE] = it } - .launchIn(viewModelScope) +// stateFlow +// .onEach { savedStateHandle[KEY_STATE] = it } +// .launchIn(viewModelScope) repository.getStandingInstructionTemplate( fromOfficeId = state.client.officeId, diff --git a/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/details/SIDetailViewModel.kt b/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/details/SIDetailViewModel.kt index 144419333..d151fe49b 100644 --- a/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/details/SIDetailViewModel.kt +++ b/feature/standing-instruction/src/commonMain/kotlin/org/mifospay/feature/standing/instruction/details/SIDetailViewModel.kt @@ -31,9 +31,9 @@ internal class SIDetailViewModel( ) { init { - stateFlow - .onEach { savedStateHandle[KEY_STATE] = it } - .launchIn(viewModelScope) +// stateFlow +// .onEach { savedStateHandle[KEY_STATE] = it } +// .launchIn(viewModelScope) val instructionId = requireNotNull(savedStateHandle.get("instructionId")) diff --git a/mifospay-ios/iosApp.xcodeproj/project.xcworkspace/xcuserdata/kapilmaurya.xcuserdatad/UserInterfaceState.xcuserstate b/mifospay-ios/iosApp.xcodeproj/project.xcworkspace/xcuserdata/kapilmaurya.xcuserdatad/UserInterfaceState.xcuserstate index 21507917e..ffa0bd0e3 100644 Binary files a/mifospay-ios/iosApp.xcodeproj/project.xcworkspace/xcuserdata/kapilmaurya.xcuserdatad/UserInterfaceState.xcuserstate and b/mifospay-ios/iosApp.xcodeproj/project.xcworkspace/xcuserdata/kapilmaurya.xcuserdatad/UserInterfaceState.xcuserstate differ