TP-55529 | Sidharth Bamba | Scratch card ipl tstore (#15770)
This commit is contained in:
@@ -197,6 +197,8 @@ fun OrderDetailsScreen(
|
||||
val orderErrorEntity by orderDetailsViewModel.orderErrorEntity.collectAsStateWithLifecycle()
|
||||
val isNewErrorWidgetExperimentEnabled by
|
||||
orderDetailsViewModel.isNewErrorWidgetExperimentEnabled.collectAsStateWithLifecycle()
|
||||
val isIplPowerPlayThemeExperimentEnabled by
|
||||
orderDetailsViewModel.isIplPowerPlayThemeExperimentEnabled.collectAsStateWithLifecycle()
|
||||
|
||||
val onCheckBalanceCtaClicked = {
|
||||
naviPayAnalytics.onCheckBalanceCtaClicked(orderId = orderEntity?.orderReferenceId.orEmpty())
|
||||
@@ -516,6 +518,7 @@ fun OrderDetailsScreen(
|
||||
orderDetailsViewModel.onHelpClicked()
|
||||
},
|
||||
isNewErrorWidgetExperimentEnabled = isNewErrorWidgetExperimentEnabled,
|
||||
isIplPowerPlayThemeExperimentEnabled = isIplPowerPlayThemeExperimentEnabled,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,6 +108,7 @@ fun OrderDetailsScreenContent(
|
||||
onHowToUseRrnClicked: () -> Unit,
|
||||
onContactUsClicked: () -> Unit,
|
||||
isNewErrorWidgetExperimentEnabled: Boolean,
|
||||
isIplPowerPlayThemeExperimentEnabled: Boolean,
|
||||
) {
|
||||
val lifecycleOwner = LocalLifecycleOwner.current
|
||||
|
||||
@@ -229,6 +230,7 @@ fun OrderDetailsScreenContent(
|
||||
onHowToUseRrnClicked = onHowToUseRrnClicked,
|
||||
onContactUsClicked = onContactUsClicked,
|
||||
isNewErrorWidgetExperimentEnabled = isNewErrorWidgetExperimentEnabled,
|
||||
isIplPowerPlayThemeExperimentEnabled = isIplPowerPlayThemeExperimentEnabled,
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -134,6 +134,7 @@ internal fun OrderDetailsSummarySection(
|
||||
onHowToUseRrnClicked: () -> Unit,
|
||||
onContactUsClicked: () -> Unit,
|
||||
isNewErrorWidgetExperimentEnabled: Boolean,
|
||||
isIplPowerPlayThemeExperimentEnabled: Boolean,
|
||||
) {
|
||||
|
||||
paymentStatusWidgetProperties?.let {
|
||||
@@ -270,6 +271,7 @@ internal fun OrderDetailsSummarySection(
|
||||
onRewardPopUpStateUpdate = onRewardPopUpStateUpdate,
|
||||
onRewardsWonGratificationClicked = onRewardsWonGratificationClicked,
|
||||
naviPayAnalytics = naviPayAnalytics,
|
||||
isIplPowerPlayThemeExperimentEnabled = isIplPowerPlayThemeExperimentEnabled,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ import com.navi.pay.tstore.details.viewmodel.ScratchCardState
|
||||
import com.navi.pay.utils.COIN_IMAGE_MAPPING_ID
|
||||
import com.navi.pay.utils.COMMA
|
||||
import com.navi.pay.utils.SCRATCH_CARD_BANNER_BG
|
||||
import com.navi.pay.utils.SCRATCH_CARD_BANNER_BG_IPL
|
||||
|
||||
@Composable
|
||||
fun ScratchCardSection(
|
||||
@@ -67,6 +68,7 @@ fun ScratchCardSection(
|
||||
onRewardPopUpStateUpdate: (Boolean) -> Unit,
|
||||
onRewardsWonGratificationClicked: () -> Unit,
|
||||
naviPayAnalytics: NaviPayAnalytics.OrderDetails,
|
||||
isIplPowerPlayThemeExperimentEnabled: Boolean,
|
||||
) {
|
||||
when (scratchCardState) {
|
||||
is ScratchCardState.Unscratched -> {
|
||||
@@ -77,6 +79,7 @@ fun ScratchCardSection(
|
||||
onRewardsWonGratificationClicked = onRewardsWonGratificationClicked,
|
||||
daysUntilExpiry = scratchCardState.daysUntilExpiry,
|
||||
naviPayAnalytics = naviPayAnalytics,
|
||||
isIplPowerPlayThemeExperimentEnabled = isIplPowerPlayThemeExperimentEnabled,
|
||||
)
|
||||
}
|
||||
is ScratchCardState.Scratched -> {
|
||||
@@ -161,6 +164,7 @@ private fun ScratchCardLocked(
|
||||
onRewardsWonGratificationClicked: () -> Unit,
|
||||
daysUntilExpiry: String,
|
||||
naviPayAnalytics: NaviPayAnalytics.OrderDetails,
|
||||
isIplPowerPlayThemeExperimentEnabled: Boolean,
|
||||
) {
|
||||
AnimatedVisibility(
|
||||
visible =
|
||||
@@ -180,7 +184,9 @@ private fun ScratchCardLocked(
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
AsyncImage(
|
||||
model = SCRATCH_CARD_BANNER_BG,
|
||||
model =
|
||||
if (isIplPowerPlayThemeExperimentEnabled) SCRATCH_CARD_BANNER_BG_IPL
|
||||
else SCRATCH_CARD_BANNER_BG,
|
||||
contentDescription = EMPTY,
|
||||
contentScale = ContentScale.FillWidth,
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
|
||||
@@ -38,6 +38,8 @@ import com.navi.common.payments.arc.util.getCoinDaysPairForUPI
|
||||
import com.navi.common.usecase.LitmusExperimentsUseCase
|
||||
import com.navi.common.usecase.RewardsNudgeEntityFetchUseCase
|
||||
import com.navi.common.utils.CommonUtils.getDisplayableAmount
|
||||
import com.navi.common.utils.Constants.LITMUS_EXPERIMENT_NAVIPAY_NAVI_POWER_PLAY
|
||||
import com.navi.common.utils.Constants.ScratchCardExperiment
|
||||
import com.navi.common.utils.NaviApiPoller
|
||||
import com.navi.pay.R
|
||||
import com.navi.pay.analytics.NaviPayAnalytics
|
||||
@@ -372,6 +374,9 @@ constructor(
|
||||
|
||||
private var scratchCardExpiryDate: Int? = null
|
||||
|
||||
private val _isIplPowerPlayThemeExperimentEnabled = MutableStateFlow(false)
|
||||
val isIplPowerPlayThemeExperimentEnabled = _isIplPowerPlayThemeExperimentEnabled.asStateFlow()
|
||||
|
||||
init {
|
||||
viewModelScope.launch(dispatcherProvider.io) {
|
||||
launch { orderErrorMappingManager.syncErrorMappings(screenName = screenName) }
|
||||
@@ -380,6 +385,7 @@ constructor(
|
||||
if (isError) {
|
||||
return@launch
|
||||
}
|
||||
getLitmusExperimentValues()
|
||||
updateUiState(uiState = OrderDetailsScreenUIState.Loaded)
|
||||
updateUserTransactionBankInfo()
|
||||
prepareRefundStatusWidgetProperties()
|
||||
@@ -1677,6 +1683,27 @@ constructor(
|
||||
_rewardsGratificationUiState.update { rewardsGratificationUIState }
|
||||
}
|
||||
|
||||
private suspend fun getLitmusExperimentValues() {
|
||||
when (
|
||||
litmusExperimentsUseCase
|
||||
.execute(experimentName = LITMUS_EXPERIMENT_NAVIPAY_NAVI_POWER_PLAY)
|
||||
?.variant
|
||||
?.name
|
||||
) {
|
||||
ScratchCardExperiment.DOUBLE_SCRATCH_CARD_EXPERIENCE.experimentName -> {
|
||||
_isIplPowerPlayThemeExperimentEnabled.update { true }
|
||||
}
|
||||
|
||||
ScratchCardExperiment.SINGLE_SCRATCH_CARD_EXPERIENCE.experimentName -> {
|
||||
_isIplPowerPlayThemeExperimentEnabled.update { false }
|
||||
}
|
||||
|
||||
else -> {
|
||||
_isIplPowerPlayThemeExperimentEnabled.update { false }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getOrderHistoryDetailItemProperty(
|
||||
orderEntity: OrderEntity?
|
||||
): OrderHistoryDetailItemProperty {
|
||||
|
||||
@@ -390,6 +390,8 @@ const val NAVI_LOGO_TRANSACTION_HISTORY_PLACEHOLDER_URL =
|
||||
"https://public-assets.prod.navi-sa.in/navipay/bbps_th_default_placeholder.png"
|
||||
const val SCRATCH_CARD_BANNER_BG =
|
||||
"https://public-assets.prod.navi-sa.in/navi-pay/png/scratch_card_banner_bg.png"
|
||||
const val SCRATCH_CARD_BANNER_BG_IPL =
|
||||
"https://public-assets.prod.navi-sa.in/navi-pay/png/scratch_card_banner_bg_ipl.png"
|
||||
const val NAVI_PAY_TNC_URL = "https://navi.com/terms-and-conditions"
|
||||
const val NAVI_PAY_BANK_LOGOS_BASE_URL =
|
||||
"https://public-assets.prod.navi-pay.in/bank-logos-v2/{bankIdentifier}.png"
|
||||
|
||||
Reference in New Issue
Block a user