NTP-62422 | tstore order error query crash and bbps my bills crash fix (#16078)

This commit is contained in:
Mohit Rajput
2025-05-07 05:15:48 -07:00
committed by GitHub
parent f9187534da
commit eddd3e2053
4 changed files with 9 additions and 10 deletions

View File

@@ -203,7 +203,7 @@ constructor(
private val _refreshBillItemAndStatus = MutableStateFlow(RefreshBillState())
val refreshBillItemAndStatus = _refreshBillItemAndStatus.asStateFlow()
private val myAllBills = mutableListOf<MyBillEntity>()
private val myAllBills = mutableListOf<MyBillEntity?>()
var arcNudgeResponse: ArcNudgeResponse? = null
@@ -224,11 +224,11 @@ constructor(
val openBottomSheet = _openBottomSheet.asSharedFlow()
init {
viewModelScope.launch(dispatcherProvider.default) {
viewModelScope.launch(dispatcherProvider.io) {
initConfig()
observeMyBillCounts(
onFetchSuccess = {
viewModelScope.launch(Dispatchers.IO) {
viewModelScope.launch(dispatcherProvider.io) {
fetchOffersForMultipleBills(offerRequestList = getOfferRequestList())
}
}
@@ -586,8 +586,7 @@ constructor(
}
private fun getTotalUnpaidBills(): List<MyBillEntity> {
val bills = myAllBills.toList()
return bills.filter { it.isBillPaid.not() }
return myAllBills.filterNotNull().filter { !it.isBillPaid }
}
private fun updateMyUnpaidBills() {

View File

@@ -1889,7 +1889,7 @@ constructor(
errorCode = orderEntity.orderDetails.errorCode
)
naviPayAnalytics.onOrderErrorDetailsFetchedDevEvent(
errorCode = orderEntity.orderDetails.errorCode,
errorCode = orderEntity.orderDetails.errorCode.orEmpty(),
orderErrorEntity = orderErrorEntity,
isExperimentEnabled = isNewErrorWidgetExperimentEnabled.value,
productType = orderEntity.productType,

View File

@@ -23,6 +23,6 @@ data class OrderDetailEntity(
@SerializedName("coinsUsed") val coinsUsed: String?,
@SerializedName("coinEquivalentCash") val coinEquivalentCash: String?,
@SerializedName("rewardList") val rewardList: List<RewardMetadata>? = null,
@SerializedName("errorCode") val errorCode: String,
@SerializedName("errorCode") val errorCode: String?,
@SerializedName("naviUpiAccInfo") val naviUpiAccInfo: NaviUpiAccInfo?,
) : Parcelable

View File

@@ -82,9 +82,9 @@ constructor(
}
}
suspend fun getErrorEntityByCode(errorCode: String): OrderErrorEntity {
return orderRepository.getOrderErrorEntity(errorCode) ?: getDefaultError()
}
suspend fun getErrorEntityByCode(errorCode: String?): OrderErrorEntity =
errorCode?.takeIf { it.isNotBlank() }?.let { orderRepository.getOrderErrorEntity(it) }
?: getDefaultError()
private fun getDefaultError() =
OrderErrorEntity(