mirror of
https://github.com/openMF/mobile-wallet.git
synced 2026-02-06 13:36:53 +00:00
Ios,web,dev testing (#1830)
This commit is contained in:
parent
c6b889db6e
commit
e8272092f3
@ -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) {
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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<String>("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 {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -11,4 +11,5 @@ package org.mifospay.feature.kyc
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
|
||||
// TODO: Implement KYC Level3 View Model
|
||||
class KYCLevel3ViewModel : ViewModel()
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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))
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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<String>("requestData")?.let {
|
||||
trySendAction(HandleRequestData(it))
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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<Long>("instructionId"))
|
||||
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user