diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/LocalJsonDataSource.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/LocalJsonDataSource.kt deleted file mode 100644 index 411c8bec0c..0000000000 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/LocalJsonDataSource.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright © 2024 by Navi Technologies Limited - * * All rights reserved. Strictly confidential - * - */ - -package com.navi.bbps.common - -import com.google.gson.GsonBuilder -import com.google.gson.JsonObject -import com.google.gson.JsonParser -import com.navi.base.AppServiceManager -import java.lang.reflect.Type -import java.nio.charset.StandardCharsets -import javax.inject.Inject -import org.joda.time.DateTime - -class LocalJsonDataSource @Inject constructor() { - private val gson = - GsonBuilder().registerTypeAdapter(DateTime::class.java, DateTimeConverterAdapter()).create() - - fun getDataFromJsonFile(type: Type, jsonKey: String, filePath: Int): T { - val inputStream = AppServiceManager.application.resources.openRawResource(filePath) - val dataString = String(inputStream.readBytes(), StandardCharsets.UTF_8) - val jsonElement = (JsonParser.parseString(dataString) as? JsonObject)?.get(jsonKey) - return gson.fromJson(jsonElement, type) - } -} diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/NaviBbpsAnalytics.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/NaviBbpsAnalytics.kt index fe3e71bccb..24af82806e 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/NaviBbpsAnalytics.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/NaviBbpsAnalytics.kt @@ -35,7 +35,6 @@ import com.navi.bbps.feature.prepaidrecharge.NextAction import com.navi.bbps.feature.prepaidrecharge.model.view.CircleItemEntity import com.navi.bbps.feature.prepaidrecharge.model.view.OperatorItemEntity import com.navi.bbps.feature.prepaidrecharge.model.view.PlanItemEntity -import com.navi.bbps.feature.transactiondetails.model.view.EngagementBannerEntity import com.navi.bbps.feature.transactiondetails.model.view.ReceiptDetailsEntity import com.navi.common.geocoding.model.DeviceLocation import com.navi.common.network.models.RepoResult @@ -162,7 +161,7 @@ class NaviBbpsAnalytics private constructor() { NAVI_BBPS_SOURCE to source, NAVI_BBPS_SESSION_ID to sessionAttribute[NAVI_BBPS_SESSION_ID].orEmpty(), NAVI_BBPS_INITIAL_SOURCE to initialSource, - "payloadError" to errorMessage.toString(), + "payloadError" to errorMessage, ), ) } @@ -2985,31 +2984,6 @@ class NaviBbpsAnalytics private constructor() { ) } - fun onDoneClicked( - isSourcePaymentSummary: Boolean, - myBillEntity: MyBillEntity, - billTransactionItemEntity: BillTransactionItemEntity, - sessionAttribute: Map, - source: String, - initialSource: String, - ) { - NaviTrackEvent.trackEventOnClickStream( - eventName = "NaviBBPS_PostPaymentV2_Done_Clicked", - eventValues = - mapOf( - "isSourcePaymentSummary" to isSourcePaymentSummary.toString(), - "billerId" to myBillEntity.billerId, - "categoryId" to myBillEntity.categoryId, - "paymentStatus" to myBillEntity.status, - "amount" to billTransactionItemEntity.formattedAmount, - "payment_mode" to billTransactionItemEntity.transactionDetails.paymentMode, - NAVI_BBPS_SESSION_ID to sessionAttribute[NAVI_BBPS_SESSION_ID].orEmpty(), - NAVI_BBPS_SOURCE to source, - NAVI_BBPS_INITIAL_SOURCE to initialSource, - ), - ) - } - fun onHelpClicked( isSourcePaymentSummary: Boolean, myBillEntity: MyBillEntity, @@ -3034,33 +3008,6 @@ class NaviBbpsAnalytics private constructor() { ) } - fun onUpSellBannerClicked( - isSourcePaymentSummary: Boolean, - upsellEntity: EngagementBannerEntity, - billEntity: MyBillEntity, - billTransactionItemEntity: BillTransactionItemEntity, - sessionAttribute: Map, - source: String, - initialSource: String, - ) { - NaviTrackEvent.trackEventOnClickStream( - eventName = "NaviBBPS_PostPaymentV2_Upsell_Banner_Clicked", - eventValues = - mapOf( - "isSourcePaymentSummary" to isSourcePaymentSummary.toString(), - "billerId" to billEntity.billerId, - "categoryId" to billEntity.categoryId, - "paymentStatus" to billEntity.status, - "amount" to billTransactionItemEntity.formattedAmount, - "name_of_card" to upsellEntity.title, - "card_details" to upsellEntity.description, - NAVI_BBPS_SESSION_ID to sessionAttribute[NAVI_BBPS_SESSION_ID].orEmpty(), - NAVI_BBPS_SOURCE to source, - NAVI_BBPS_INITIAL_SOURCE to initialSource, - ), - ) - } - fun onArcProtectNudgeClicked(sessionAttribute: Map) { NaviTrackEvent.trackEventOnClickStream( eventName = "NaviBBPS_PostPaymentV2_ArcProtectNudge_Clicked", diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/NaviBbpsConstants.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/NaviBbpsConstants.kt index e2f5cbbf1c..1dfce5bf72 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/NaviBbpsConstants.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/NaviBbpsConstants.kt @@ -57,13 +57,8 @@ const val CATEGORY_ID_CABLE = "CABLE" const val CATEGORY_ID_DTH = "DTH" const val CATEGORY_ID_MOBILE_PREPAID = "MOBILE-PREPAID" const val CATEGORY_ID_ELECTRICITY = "ELECTRICITY" -const val CATEGORY_ID_LOAN = "LOAN" -const val CATEGORY_ID_INSURANCE = "INSURANCE" -const val CATEGORY_ID_LPG_GAS = "GAS" const val CATEGORY_ID_BROADBAND = "BROADBAND-POSTPAID" -const val CATEGORY_ID_LANDLINE = "LANDLINE-POSTPAID" const val CATEGORY_ID_CREDIT_CARD = "CREDIT-CARD" -const val CATEGORY_ID_PIPED_GAS = "LPG-GAS" const val CATEGORY_ID_WATER = "WATER" const val CATEGORY_ID_EDUCATION = "EDUCATION" @@ -104,7 +99,6 @@ const val KEY_BBPS_PHONE_SERIES_MAPPING_REFRESHED_TIMESTAMP = const val KEY_BBPS_ABTESTING_LAST_REFRESHED_TIMESTAMP = "KEY_BBPS_ABTESTING_LAST_REFRESHED_TIMESTAMP" -const val KEY_BBPS_BANNERS_SEEN_MAP = "KEY_BBPS_BANNERS_SEEN_MAP" const val KEY_BBPS_ORIGIN_SMS_NUX_SEEN = "KEY_BBPS_ORIGIN_NUX_SEEN" const val KEY_BBPS_ORIGIN_EMAIL_NUX_SEEN = "KEY_BBPS_ORIGIN_EMAIL_NUX_SEEN" const val KEY_BBPS_ORIGIN_WIDGET = "KEY_BBPS_ORIGIN_WIDGET" @@ -126,7 +120,6 @@ const val AB_TESTING_CUSTOM_PREPAID_PLANS_EXPERIMENT_NAME = "NaviBBPS-Custom-Pre const val AB_TESTING_PROJECT_ORIGIN_EMAIL_SUB_EXPERIMENT_NAME = "NaviBBPS-Project-Origin-Email" // Navi Bbps Constants -const val NAVI_PAY_NUDGE_DETAILS_AMOUNT = "1000.0" const val NAVI_BBPS_REWARD_BANNER = "reward" const val NAVI_BBPS_CROSS_SELL_BANNER = "cross-sell" const val ERROR_CODE_ORIGIN_NOTIFY_LATER = "ORIGIN_NOTIFY_LATER" diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/ui/CreditCardNumberBottomSheetContent.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/ui/CreditCardNumberBottomSheetContent.kt index 4d495160fc..7e6c927ec3 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/ui/CreditCardNumberBottomSheetContent.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/ui/CreditCardNumberBottomSheetContent.kt @@ -5,6 +5,8 @@ * */ +package com.navi.bbps.common.ui + import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -24,7 +26,6 @@ import coil.compose.AsyncImage import com.navi.bbps.R import com.navi.bbps.common.ICON_CREDIT_CARD_LAST_FOUR_DIGITS_BOTTOMSHEET import com.navi.bbps.common.theme.NaviBbpsColor -import com.navi.bbps.common.ui.ThemeRoundedButton import com.navi.design.font.FontWeightEnum import com.navi.design.font.getFontWeight import com.navi.design.font.naviFontFamily @@ -77,5 +78,5 @@ fun CreditCardNumberBottomSheetContent(closeSheet: () -> Unit) { @Preview(showBackground = true) @Composable fun CreditCardNumberBottomSheetContentPreview() { - CreditCardNumberBottomSheetContent({}) + CreditCardNumberBottomSheetContent {} } diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/utils/NaviBbpsExt.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/utils/NaviBbpsExt.kt index b9939f4149..a6d32ca012 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/utils/NaviBbpsExt.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/utils/NaviBbpsExt.kt @@ -45,7 +45,7 @@ import com.navi.uitron.model.data.UiTronAction fun String.getDisplayableAmount(): String { var amount = this - var displayableAmount = "0" + var displayableAmount: String try { amount = amount.formattedCurrency() diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/viewmodel/NaviBbpsBaseVM.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/viewmodel/NaviBbpsBaseVM.kt index 6b1da8745d..417fe79246 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/viewmodel/NaviBbpsBaseVM.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/common/viewmodel/NaviBbpsBaseVM.kt @@ -128,10 +128,7 @@ abstract class NaviBbpsBaseVM(open val naviBbpsVmData: NaviBbpsVmData) : BaseVM( * @param cancelable whether to dismiss error dialog on outside touch or not. * @return [NaviBbpsErrorConfig] */ - suspend fun getError( - response: RepoResult, - cancelable: Boolean = true, - ): NaviBbpsErrorConfig { + fun getError(response: RepoResult, cancelable: Boolean = true): NaviBbpsErrorConfig { return if (isServerErrorNotAvailable(response)) { prepareErrorUsingHttpStatus(response.error, cancelable) } else { @@ -275,7 +272,7 @@ abstract class NaviBbpsBaseVM(open val naviBbpsVmData: NaviBbpsVmData) : BaseVM( description = noInternetGenericResponse.message ?: AppServiceManager.application.resources.getString( - com.navi.common.R.string.check_internet_connectivity_and_try_again + CommonR.string.check_internet_connectivity_and_try_again ), buttonConfigs = listOf(defaultButtonConfig().copy(text = "Retry")), code = NO_INTERNET_CODE, @@ -299,13 +296,11 @@ abstract class NaviBbpsBaseVM(open val naviBbpsVmData: NaviBbpsVmData) : BaseVM( ) } - suspend fun fetchOffersAndCoinBurnForProduct( + fun fetchOffersAndCoinBurnForProduct( product: String = ModuleNameV2.BBPS.name, tags: List? = null, attributes: Map? = null, requestId: String? = null, - offerType: String? = null, - strategy: String? = null, ) { val offersMapper = OfferResponseToOfferDataMapper() // Instantiate the mapper @@ -365,12 +360,9 @@ abstract class NaviBbpsBaseVM(open val naviBbpsVmData: NaviBbpsVmData) : BaseVM( } } - suspend fun fetchOffersForMultipleBills( + fun fetchOffersForMultipleBills( product: String = ModuleNameV2.BBPS.name, offerRequestList: List, - requestId: String? = null, - offerType: String? = null, - strategy: String? = null, ) { viewModelScope.launch(Dispatchers.IO) { try { diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/entry/NaviBbpsMainScreen.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/entry/NaviBbpsMainScreen.kt index a5d0ecfdb9..e7aad0a076 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/entry/NaviBbpsMainScreen.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/entry/NaviBbpsMainScreen.kt @@ -31,6 +31,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavBackStackEntry import androidx.navigation.compose.rememberNavController import androidx.navigation.plusAssign +import com.navi.base.utils.EMPTY import com.navi.base.utils.orFalse import com.navi.bbps.common.NaviBbpsAnalytics import com.navi.bbps.common.START_SCREEN_NAME @@ -87,8 +88,7 @@ fun NaviBbpsMainScreen( DestinationsNavHost( startRoute = NaviBbpsRouter.getStartRoute( - naviBbpsActivity.intent.getStringExtra(START_SCREEN_NAME) - ?: naviBbpsMainViewModel.getDefaultScreenName() + naviBbpsActivity.intent.getStringExtra(START_SCREEN_NAME) ?: EMPTY ), navGraph = NavGraphs.root, engine = naviHostEngine(), diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/entry/NaviBbpsMainViewModel.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/entry/NaviBbpsMainViewModel.kt index 7d8415c18f..717133e99a 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/entry/NaviBbpsMainViewModel.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/entry/NaviBbpsMainViewModel.kt @@ -52,8 +52,6 @@ constructor( } } - fun getDefaultScreenName() = "" - private fun updateNaviBbpsSessionId() { naviBbpsSessionHelper.createNewSessionId() } diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/billerlist/BillerListViewModel.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/billerlist/BillerListViewModel.kt index 69ce297932..52e0a55af3 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/billerlist/BillerListViewModel.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/billerlist/BillerListViewModel.kt @@ -140,9 +140,6 @@ constructor( private val _showSnackBar = MutableStateFlow(false) val showSnackBar = _showSnackBar.asStateFlow() - private val _isDeleteBillInProgress = MutableStateFlow(false) - val isDeleteBillInProgress = _isDeleteBillInProgress.asStateFlow() - val phoneNumber = BaseUtils.getPhoneNumber().toString() val normalisedPhoneNumber = getNormalisedPhoneNumber(phoneNumber = phoneNumber) @@ -178,9 +175,6 @@ constructor( initialValue = false, ) - private val _isRecentBillsMoreThanZero = MutableStateFlow(false) - val isRecentBillsMoreThanZero = _isRecentBillsMoreThanZero.asStateFlow() - private val _isSearchBillerRunning = MutableStateFlow(false) val isSearchBillerRunning = _isSearchBillerRunning.asStateFlow() @@ -202,9 +196,6 @@ constructor( initialValue = false, ) - private val _isScrolledFromTop = MutableStateFlow(false) - val isScrolledFromTop = _isScrolledFromTop.asStateFlow() - init { initConfig() initSearchFlow() @@ -359,7 +350,6 @@ constructor( ) ) } - updateRecentBillsState() updateSnackBarState(showSnackBar = true) naviBbpsAnalytics.billDeletedSuccessfully( data = deleteBillResponse.data!!, @@ -439,15 +429,6 @@ constructor( return destination } - private fun updateRecentBillsState() { - val currentBillerListState = billerListState.value - if (currentBillerListState is BillerListState.Loaded) { - _isRecentBillsMoreThanZero.update { - currentBillerListState.recentBills.bills.isNotEmpty() - } - } - } - @OptIn(FlowPreview::class) private fun initSearchFlow() { searchQuery @@ -542,7 +523,6 @@ constructor( } updateBillerListState(createLoadedStateFromBillerResponse(billerListResponse)) - updateRecentBillsState() _isQueriedListEmpty.update { fullBillerList.isEmpty() } } else { updateBillerListState(BillerListState.Error) @@ -594,7 +574,6 @@ constructor( popularBillers = popularBillers, ) ) - updateRecentBillsState() } } @@ -708,10 +687,6 @@ constructor( } } - fun updateIsScrolledFromTop(isScrolledFromTop: Boolean) { - _isScrolledFromTop.update { isScrolledFromTop } - } - suspend fun findLastOrderWithSuccessfulPayment(billId: String?): OrderEntity? = findLastOrderWithSuccessfulPaymentUseCase.find(billId) diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/billhistorydetail/BillHistoryDetailsViewModel.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/billhistorydetail/BillHistoryDetailsViewModel.kt index 6febdc023f..ae52afcca5 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/billhistorydetail/BillHistoryDetailsViewModel.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/billhistorydetail/BillHistoryDetailsViewModel.kt @@ -72,7 +72,6 @@ import com.navi.bbps.feature.prepaidrecharge.model.view.PlanItemEntity import com.navi.bbps.isPrepaidRechargePaidOrWithoutPlanDetails import com.navi.bbps.isRedirectToCustomerInputRequired import com.navi.common.di.CoroutineDispatcherProvider -import com.navi.common.extensions.or import com.navi.common.network.models.RepoResult import com.navi.common.network.models.isSuccessWithData import com.navi.common.upi.AMOUNT @@ -107,7 +106,7 @@ constructor( private val naviNetworkConnectivity: NaviNetworkConnectivity, private val naviBbpsDateUtils: NaviBbpsDateUtils, private val contactManager: PhoneContactManager, - private val stringResouceProvider: ResourceProvider, + private val stringResourceProvider: ResourceProvider, private val naviBbpsConfigUseCase: NaviBbpsConfigUseCase, private val resourceProvider: ResourceProvider, private val myBillsRepository: MyBillsRepository, @@ -182,7 +181,7 @@ constructor( val helpCta = NaviBbpsCommonUtils.getHelpCtaData(NaviBbpsScreen.NAVI_BBPS_MY_BILL_HISTORY_DETAILS.name) - var contactNameForMobileNumber = stringResouceProvider.getString(R.string.bbps_new_contact) + var contactNameForMobileNumber = stringResourceProvider.getString(R.string.bbps_new_contact) init { recordScreenLandTime(screen = naviBbpsVmData.screen.screenName) @@ -223,7 +222,7 @@ constructor( fun fetchBillHistoryList() { viewModelScope.launch(dispatcherProvider.io) { - if (myBillEntity.value.billId.isNullOrEmpty()) { + if (myBillEntity.value.billId.isEmpty()) { _billHistoryDetailsState.update { BillTransactionsState.createEmptyState( categoryId = myBillEntity.value.categoryId, @@ -275,7 +274,7 @@ constructor( val contact = fullContactList.find { it.normalisedPhoneNumber == primaryCustomerParamValue } - return contact?.name ?: stringResouceProvider.getString(R.string.bbps_new_contact) + return contact?.name ?: stringResourceProvider.getString(R.string.bbps_new_contact) } private fun TransactionItemResponse.toBillTransactionEntity(): BillTransactionItemEntity { @@ -592,7 +591,7 @@ constructor( operatorItemEntity = operatorItemEntity, customerParams = myBillEntity.value.customerParams, billerId = billerDetails.billerId, - amount = billDetailsEntity.amount.orEmpty(), + amount = billDetailsEntity.amount, formattedLastPaidDate = myBillEntity.value.formattedLastPaidDate, formattedLastPaidAmount = myBillEntity.value.formattedLastPaidAmount, ) diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/category/BillCategoriesViewModel.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/category/BillCategoriesViewModel.kt index 21a1566733..48a421b722 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/category/BillCategoriesViewModel.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/category/BillCategoriesViewModel.kt @@ -175,7 +175,7 @@ constructor( ) val pendingBillsShowMoreLessButtonState = _pendingBillsShowMoreLessButtonState.asStateFlow() - val _billCategoryBottomSheetType = + protected val _billCategoryBottomSheetType = MutableStateFlow( BillCategoryBottomSheetType.OfferList( offerData = emptyList(), @@ -676,7 +676,7 @@ constructor( } } - private suspend fun BillCategoriesViewModel.handleRewardDetailsSuccessResponse( + private fun BillCategoriesViewModel.handleRewardDetailsSuccessResponse( rewardDetailsResponse: RepoResult ) { if (rewardDetailsResponse.data?.coinBalance.isNotNull()) { @@ -900,19 +900,14 @@ constructor( naviCacheRepository.get(key = ARC_NUDGE_RESPONSE_CACHE_KEY)?.value, ArcNudgeResponse::class.java, ) - } catch (e: Exception) { + } catch (_: Exception) { null } val isArcProtected = arcNudgeResponse?.isArcProtected.orFalse() _isArcProtected.update { isArcProtected } _arcRewardCoins.update { - arcNudgeResponse - .getCoinDaysPairForBBPS() - ?.first - ?.toString() - ?.getDisplayableAmount() - .orEmpty() + arcNudgeResponse.getCoinDaysPairForBBPS()?.first?.getDisplayableAmount().orEmpty() } } } diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/customerinput/CustomerDataInputViewModel.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/customerinput/CustomerDataInputViewModel.kt index 4bb2347dda..e9afd83324 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/customerinput/CustomerDataInputViewModel.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/customerinput/CustomerDataInputViewModel.kt @@ -81,7 +81,7 @@ constructor( private val dispatcherProvider: CoroutineDispatcherProvider, private val customerDataInputRepository: CustomerDataInputRepository, private val bbpsCommonRepository: BbpsCommonRepository, - private val customerParamValidationUsecase: CustomerParamValidationUseCase, + private val customerParamValidationUseCase: CustomerParamValidationUseCase, private val naviNetworkConnectivity: NaviNetworkConnectivity, private val naviBbpsConfigUseCase: NaviBbpsConfigUseCase, private val naviBbpsDateUtils: NaviBbpsDateUtils, @@ -584,7 +584,7 @@ constructor( private fun populateErrorOnFieldIfRequired(customerParam: CustomerParam) { val isFieldValueValid = - customerParamValidationUsecase.execute( + customerParamValidationUseCase.execute( customerParam = customerParam, customParamsMap = customParamsMap, ) diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/customerinput/ui/CustomerDataInputScreen.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/customerinput/ui/CustomerDataInputScreen.kt index 35d2dfdc0e..e72fce9e4b 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/customerinput/ui/CustomerDataInputScreen.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/customerinput/ui/CustomerDataInputScreen.kt @@ -7,7 +7,6 @@ package com.navi.bbps.feature.customerinput.ui -import CreditCardNumberBottomSheetContent import androidx.activity.compose.BackHandler import androidx.compose.foundation.Image import androidx.compose.foundation.ScrollState @@ -75,6 +74,7 @@ import com.navi.bbps.common.theme.NaviBbpsColor import com.navi.bbps.common.ui.BbpsBillerConsentView import com.navi.bbps.common.ui.BbpsCircleImage import com.navi.bbps.common.ui.BbpsOfferBottomSheet +import com.navi.bbps.common.ui.CreditCardNumberBottomSheetContent import com.navi.bbps.common.ui.DropdownFieldWithDescriptionHeader import com.navi.bbps.common.ui.DropdownOptionsBottomSheetContent import com.navi.bbps.common.ui.InputTextFieldWithDescriptionHeader diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/paybill/PayBillViewModel.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/paybill/PayBillViewModel.kt index 47f9ca2407..a3e128c5d7 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/paybill/PayBillViewModel.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/paybill/PayBillViewModel.kt @@ -204,7 +204,7 @@ constructor( MutableStateFlow(PayBillScreenState.BillDetailsUnavailable) val payBillScreenState = _payBillScreenState.asStateFlow() - open val _payBillBottomSheetType = + private val _payBillBottomSheetType = MutableStateFlow(PayBillBottomSheetType.None) val payBillBottomSheetType = _payBillBottomSheetType.asStateFlow() @@ -1094,8 +1094,8 @@ constructor( } val isArcProtected = paymentResponseMetadata.optBoolean("isArcProtected", false) var planItemEntity: PlanItemEntity? = null - var billerLogoUrl = "" - var billerName = "" + var billerLogoUrl: String + var billerName: String val redeemedCoinsValue = paymentResponseMetadata.optString("redeemedCoinsValue") ?: "" val cashToCoinsConversionAmount = naviBbpsDefaultConfig.value.coinUtilisationConfig.cashToCoinsConversionAmount @@ -1104,7 +1104,7 @@ constructor( coinEquivalentCash = redeemedCoinsValue, cashToCoinsConversionAmount = cashToCoinsConversionAmount, ) - var customerParams = mapOf() + var customerParams: Map when (val screenSource = payBillScreenSource) { is PayBillSource.Others -> { customerParams = screenSource.customerParams diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/EngagementBannerEntity.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/EngagementBannerEntity.kt deleted file mode 100644 index eb3234eb8a..0000000000 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/EngagementBannerEntity.kt +++ /dev/null @@ -1,17 +0,0 @@ -/* - * - * * Copyright © 2024-2025 by Navi Technologies Limited - * * All rights reserved. Strictly confidential - * - */ - -package com.navi.bbps.feature.transactiondetails.model.view - -data class EngagementBannerEntity( - val categoryId: String, - var isEnabled: Boolean = true, - val title: String, - val description: String, - val ctaText: String, - val iconUrl: String, -) diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/PaymentSummaryBottomSheetStateHolder.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/PaymentSummaryBottomSheetStateHolder.kt deleted file mode 100644 index 589c449102..0000000000 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/PaymentSummaryBottomSheetStateHolder.kt +++ /dev/null @@ -1,14 +0,0 @@ -/* - * - * * Copyright © 2024-2025 by Navi Technologies Limited - * * All rights reserved. Strictly confidential - * - */ - -package com.navi.bbps.feature.transactiondetails.model.view - -data class PaymentSummaryBottomSheetStateHolder( - val bottomSheetType: PaymentSummaryBottomSheetUIState, - val showBottomSheet: Boolean, - val bottomSheetStateChange: Boolean, -) diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/PaymentSummaryBottomSheetUIState.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/PaymentSummaryBottomSheetUIState.kt deleted file mode 100644 index 3c6dc024b5..0000000000 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/PaymentSummaryBottomSheetUIState.kt +++ /dev/null @@ -1,18 +0,0 @@ -/* - * - * * Copyright © 2024-2025 by Navi Technologies Limited - * * All rights reserved. Strictly confidential - * - */ - -package com.navi.bbps.feature.transactiondetails.model.view - -sealed interface PaymentSummaryBottomSheetUIState { - - data object None : PaymentSummaryBottomSheetUIState - - data class ScratchCardProcessing( - val maxCoinsFormatted: String, - val processedOnFormatted: String, - ) : PaymentSummaryBottomSheetUIState -} diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/PaymentSummaryRewardsGratificationUIState.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/PaymentSummaryRewardsGratificationUIState.kt deleted file mode 100644 index 0c956cd262..0000000000 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/model/view/PaymentSummaryRewardsGratificationUIState.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * - * * Copyright © 2024-2025 by Navi Technologies Limited - * * All rights reserved. Strictly confidential - * - */ - -package com.navi.bbps.feature.transactiondetails.model.view - -import com.navi.rr.scratchcard.model.GratificationResponse - -sealed class PaymentSummaryRewardsGratificationUIState { - data class Gratification( - val gratificationResponse: GratificationResponse, - val lottieUrl: String?, - ) : PaymentSummaryRewardsGratificationUIState() - - data class RewardsWonGratification(val amount: String) : - PaymentSummaryRewardsGratificationUIState() - - data object None : PaymentSummaryRewardsGratificationUIState() - - data object NoReward : PaymentSummaryRewardsGratificationUIState() -} diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/ui/BbpsPostPaymentScreen.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/ui/BbpsPostPaymentScreen.kt index 974b35b03c..8108c7a501 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/ui/BbpsPostPaymentScreen.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/ui/BbpsPostPaymentScreen.kt @@ -273,7 +273,6 @@ fun BbpsPostPaymentScreen( ctaData = orderDetailsCtaData, ) } - Unit } val bottomSheetState = @@ -382,8 +381,6 @@ fun BbpsPostPaymentScreen( formattedCoinsAmount = bbpsTransactionDetailsViewModel.rewardsNudgeDetailEntity.value?.formattedAmount ?: NAVI_BBPS_MAX_COIN_EARN, - naviBbpsAnalytics = naviBbpsAnalytics, - sessionAttribute = bbpsTransactionDetailsViewModel.getNaviBbpsSessionAttributes(), ) }, ) { @@ -434,7 +431,7 @@ fun BbpsPostPaymentScreen( ) bbpsTransactionDetailsViewModel.onHelpedClicked() }, - helpCtaText = bbpsTransactionDetailsViewModel.helpCta?.title, + helpCtaText = bbpsTransactionDetailsViewModel.helpCta.title, naviBbpsActivity = naviBbpsActivity, onCtaClicked = onViewDetailCtaClicked, onShareReceiptCtaClicked = @@ -1015,8 +1012,6 @@ private fun RenderPaymentSummaryBottomSheetUI( onBottomSheetDismissClicked: () -> Unit, scratchCardLoadingProgress: Float, formattedCoinsAmount: String, - naviBbpsAnalytics: NaviBbpsAnalytics.PostPaymentScreen, - sessionAttribute: Map, ) { when (bottomSheetUIState) { PaymentSummaryBottomSheetUIStateV2.None -> { @@ -1265,7 +1260,7 @@ private fun ScratchAndWinButton(modifier: Modifier = Modifier) { fontSize = 12.sp, fontFamily = naviFontFamily, fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_DEMI_BOLD), - color = NaviBbpsColor.textWhite, + color = textWhite, maxLines = 1, overflow = TextOverflow.Ellipsis, ) @@ -1622,7 +1617,7 @@ private fun CoinDiscountBanner(availableCoinsDiscount: String?, coinsUsed: Strin fontFamily = naviFontFamily, lineHeight = 16.sp, fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR), - color = NaviBbpsColor.textWhite, + color = textWhite, ) Spacer(modifier = Modifier.width(4.dp)) Image( @@ -1633,7 +1628,7 @@ private fun CoinDiscountBanner(availableCoinsDiscount: String?, coinsUsed: Strin Spacer(modifier = Modifier.width(2.dp)) NaviText( text = coinsUsed.getDisplayableAmount(), - color = NaviBbpsColor.textWhite, + color = textWhite, fontSize = 12.sp, lineHeight = 16.sp, fontFamily = naviFontFamily, @@ -1728,8 +1723,8 @@ private fun TransactionAmountSection( drawLine( color = NaviBbpsColor.bgSuccess, strokeWidth = strokeWidth, - start = Offset(-4.dp.toPx(), verticalCenter.toFloat()), - end = Offset(size.width + 3.dp.toPx(), verticalCenter.toFloat()), + start = Offset(-4.dp.toPx(), verticalCenter), + end = Offset(size.width + 3.dp.toPx(), verticalCenter), ) }, ) diff --git a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/viewmodel/BbpsPostPaymentScreenViewModel.kt b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/viewmodel/BbpsPostPaymentScreenViewModel.kt index 17c2cbdeb9..23a43bfd3e 100644 --- a/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/viewmodel/BbpsPostPaymentScreenViewModel.kt +++ b/android/navi-bbps/src/main/kotlin/com/navi/bbps/feature/transactiondetails/viewmodel/BbpsPostPaymentScreenViewModel.kt @@ -137,7 +137,7 @@ constructor( private val _arcRewardCoins = MutableStateFlow("") val arcRewardCoins = _arcRewardCoins.asStateFlow() - private val _showArcRewardFromNudgeResponse = MutableStateFlow(false) + private val _showArcRewardFromNudgeResponse = MutableStateFlow(false) val showArcRewardFromNudgeResponse = _showArcRewardFromNudgeResponse.asStateFlow() private val _showRewardsPopUp = MutableStateFlow(false) @@ -146,7 +146,7 @@ constructor( private val _bottomBarCtaStateForRewards = MutableStateFlow(BottomBarCtaStateForRewards.NONE) val bottomBarCtaStateForRewards = _bottomBarCtaStateForRewards.asStateFlow() - private val _isLocalArcTransactionCounterWidgetEnabled = MutableStateFlow(false) + private val _isLocalArcTransactionCounterWidgetEnabled = MutableStateFlow(false) val isLocalArcTransactionCounterWidgetEnabled = _isLocalArcTransactionCounterWidgetEnabled.asStateFlow() @@ -155,20 +155,14 @@ constructor( FirebaseRemoteConfigHelper.NAVI_BBPS_PPS_SHARE_RECEIPT_CALLOUT_TEXT ) - private val _isScratchCardSizeFull = MutableStateFlow(false) - val isScratchCardSizeFull = _isScratchCardSizeFull.asStateFlow() - val transactionHistoryDetailItemProperty = billTransactionItemEntity - .map { getTransactionHistoryDetailItemProperty(billTransactionItemEntity = it) } + .map { getTransactionHistoryDetailItemProperty() } .flowOn(Dispatchers.IO) .stateIn( scope = viewModelScope, started = SharingStarted.WhileSubscribed(), - initialValue = - getTransactionHistoryDetailItemProperty( - billTransactionItemEntity = billTransactionItemEntity.value - ), + initialValue = getTransactionHistoryDetailItemProperty(), ) private val _bottomSheetStateHolder = @@ -233,7 +227,7 @@ constructor( var arcNudgeResponse: ArcNudgeResponse? = null - val _formattedCount = MutableStateFlow(null) + private val _formattedCount = MutableStateFlow(null) val formattedCount = _formattedCount.asStateFlow() val isRewardsEntryPointVisible = @@ -284,12 +278,10 @@ constructor( updateMySavedBills() } - private fun getTransactionHistoryDetailItemProperty( - billTransactionItemEntity: BillTransactionItemEntity? - ): TransactionHistoryDetailItemProperty { + private fun getTransactionHistoryDetailItemProperty(): TransactionHistoryDetailItemProperty { return TransactionHistoryDetailItemProperty( bannerTransactionStatusTextId = - when (NaviBbpsCommonUtils.isRechargeCategory(myBillEntity.categoryId)) { + when (isRechargeCategory(myBillEntity.categoryId)) { true -> R.string.bbps_recharge_done_successfully else -> R.string.bbps_bill_paid_successfully }, @@ -604,7 +596,7 @@ constructor( cardBackgroundColorId = R.color.bbps_text_white, textColorId = R.color.bbps_dark_gray, transactionStatusText = - when (NaviBbpsCommonUtils.isRechargeCategory(myBillEntity.categoryId)) { + when (isRechargeCategory(myBillEntity.categoryId)) { true -> resourceProvider.getString(R.string.bbps_recharge_failed) else -> resourceProvider.getString(R.string.bbps_payment_failed) }, @@ -752,8 +744,7 @@ constructor( ArcExactOfferRequest( transactionAmount = billTransactionItemEntity.value.formattedAmount - .getNormalisedAmount() - .toString(), + .getNormalisedAmount(), product = ModuleNameV2.BBPS.name, ), metricInfo = @@ -778,7 +769,6 @@ constructor( arcNudgeResponse .getCoinDaysPairForBBPS() ?.first - ?.toString() ?.getDisplayableAmount() .orEmpty() } @@ -831,7 +821,6 @@ constructor( arcNudgeResponse .getCoinDaysPairForBBPS() ?.first - ?.toString() ?.getDisplayableAmount() .orEmpty(), thresholdInDays = @@ -852,7 +841,7 @@ constructor( naviCacheRepository.get(key = ARC_NUDGE_RESPONSE_CACHE_KEY)?.value, ArcNudgeResponse::class.java, ) - } catch (e: Exception) { + } catch (_: Exception) { null } return arcNudgeResponse diff --git a/android/navi-common/src/main/java/com/navi/common/constants/DBCacheConstants.kt b/android/navi-common/src/main/java/com/navi/common/constants/DBCacheConstants.kt index e0333d5242..5177f23f35 100644 --- a/android/navi-common/src/main/java/com/navi/common/constants/DBCacheConstants.kt +++ b/android/navi-common/src/main/java/com/navi/common/constants/DBCacheConstants.kt @@ -22,8 +22,6 @@ object DBCacheConstants { const val REFEREE_TRACKER_SCREEN_V3_CACHE_KEY = "REFEREE_TRACKER_SCREEN_V3_CACHE_KEY" // BBPS Cache Keys - const val NAVI_BBPS_CATEGORIES_LIST_CACHE_KEY = "NAVI_BBPS_CATEGORIES_LIST_CACHE_KEY" - const val NAVI_BBPS_CATEGORIES_V2_LIST_CACHE_KEY = "NAVI_BBPS_CATEGORIES_V2_LIST_CACHE_KEY" const val PREPAID_RECHARGE_SCREEN_OPERATOR_DATA_CACHE_KEY = "PREPAID_RECHARGE_SCREEN_OPERATOR_DATA_CACHE_KEY" const val PREPAID_RECHARGE_SCREEN_CIRCLE_DATA_CACHE_KEY =