TP-77625 | Mehul | bbps litmus call removed (#13007)

This commit is contained in:
Mehul Garg
2024-10-16 14:11:09 +05:30
committed by GitHub
parent 283f8ee910
commit dbed003f6c
3 changed files with 9 additions and 26 deletions

View File

@@ -78,13 +78,6 @@ class NaviBbpsAnalytics private constructor() {
)
}
fun logABExperimentFailure(source: String, error: String) {
NaviTrackEvent.trackEventOnClickStream(
eventName = "NaviBBPS_CategoryPage_FetchABExperimentFailed",
eventValues = mapOf(NAVI_BBPS_SOURCE to source, "error" to error)
)
}
fun onCategorySelected(
source: String,
categoryGroupId: String,

View File

@@ -7,7 +7,6 @@
package com.navi.bbps.feature.category
import com.navi.bbps.common.NAVI_BBPS_LITMUS
import com.navi.bbps.common.NaviBbpsScreen
import com.navi.bbps.feature.category.model.network.BillCategoriesResponse
import com.navi.bbps.feature.category.model.network.RewardDetailsResponse
@@ -39,7 +38,4 @@ constructor(private val naviBbpsRetrofitService: NaviBbpsRetrofitService) : Resp
)
)
}
suspend fun fetchLitmusABExperiment(experimentName: String) =
naviBbpsRetrofitService.fetchABExperiment(name = experimentName, header = NAVI_BBPS_LITMUS)
}

View File

@@ -1017,23 +1017,17 @@ constructor(
_rewardsDetailsEntity.update { rewardDataEntity }
}
private fun fetchBillCategoriesABExperiment() {
private suspend fun fetchBillCategoriesABExperiment() {
viewModelScope.launch(dispatcherProvider.io) {
val response =
billCategoriesRepository.fetchLitmusABExperiment(
AB_NEW_LANDING_PAGE_ENABLED_EXPERIMENT_NAME
val newBillCategoryExperiment =
getABTestingExperimentUseCase.execute(
experimentName = AB_NEW_LANDING_PAGE_ENABLED_EXPERIMENT_NAME
)
if (response.isSuccessful) {
PreferenceManager.setBooleanPreference(
AB_NEW_LANDING_PAGE_ENABLED_EXPERIMENT_NAME,
response.body()?.result.orFalse()
)
} else {
naviBbpsAnalytics.logABExperimentFailure(
source = source,
error = response.errorBody()?.string().orEmpty()
)
}
PreferenceManager.setBooleanPreference(
AB_NEW_LANDING_PAGE_ENABLED_EXPERIMENT_NAME,
newBillCategoryExperiment?.isEnabled.orFalse()
)
}
}
}