private fun dqmStringCheckForFirstName() { val parameters = JsonObject() parameters.addProperty("userFirstName", uiState.value.firstName.value) viewModelScope.launch(Dispatchers.IO) { when(val result = getCountryDataUseCase.checkDqmStringChecker( body = parameters )) { is RemoteResponse.Success -> { result.value.results.forEach { if (it.fieldName == "CP_FIRSTNAME" && it.severity == "E") { when (val value = validateUserInformationScreen(errorTypeForFirst = ErrorType.Error)) { null -> {  } else -> { displayUserInformationErrors(value) } } } else if (it.fieldName == "CP_FIRSTNAME" && it.severity == "W") { when (val value = validateUserInformationScreen(errorTypeForFirst = ErrorType.Warning)) { null -> {  } else -> { displayUserInformationErrors(value) } } } else if (it.fieldName == "CP_FIRSTNAME" && it.valid) { dqmStringCheckForLastName() } } } is RemoteResponse.Failure -> {  } } } }
This function runs the dqm checker API for the first name