NTP-18531: Autoretry changes for DG and AMC critical flows (#14064)
This commit is contained in:
@@ -11,8 +11,10 @@ import android.content.Context
|
||||
import com.chuckerteam.chucker.api.ChuckerCollector
|
||||
import com.chuckerteam.chucker.api.ChuckerInterceptor
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.NAVI_GOLD_RETRY_POLICY_ENABLED
|
||||
import com.navi.common.model.NetworkInfo
|
||||
import com.navi.common.network.BaseHttpClient
|
||||
import com.navi.common.network.retry.interceptor.RetryInterceptor
|
||||
import com.navi.gold.BuildConfig
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.OkHttpClient
|
||||
@@ -38,6 +40,10 @@ class NaviHttpClient(networkInfo: NetworkInfo, private val context: Context) :
|
||||
}
|
||||
}
|
||||
|
||||
if (FirebaseRemoteConfigHelper.getBoolean(NAVI_GOLD_RETRY_POLICY_ENABLED)) {
|
||||
okHttpClientBuilder.addInterceptor(RetryInterceptor())
|
||||
}
|
||||
|
||||
okHttpClientBuilder.addInterceptor {
|
||||
val oldRequest = it.request()
|
||||
val newRequest = oldRequest.newBuilder()
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.navi.common.model.common.InvoiceDownloadData
|
||||
import com.navi.common.model.common.WidgetResponse
|
||||
import com.navi.common.network.models.GenericResponse
|
||||
import com.navi.common.network.models.SuccessResponse
|
||||
import com.navi.common.network.retry.annotations.RetryPolicy
|
||||
import com.navi.gold.model.AmountDataRequest
|
||||
import com.navi.gold.model.BankBranch
|
||||
import com.navi.gold.model.BankDataResponse
|
||||
@@ -61,11 +62,13 @@ interface RetrofitService {
|
||||
): Response<GenericResponse<WidgetResponse>>
|
||||
|
||||
@GET("/kuber/sip/setup-sip-page-content")
|
||||
@RetryPolicy(retryCount = 3)
|
||||
suspend fun getDigitalGoldSetupSipPage(
|
||||
@QueryMap params: Map<String, String>
|
||||
): Response<GenericResponse<WidgetResponse>>
|
||||
|
||||
@GET("/kuber/transactions/transaction-history-page-content")
|
||||
@RetryPolicy(retryCount = 3)
|
||||
suspend fun fetchDigitalGoldTransactionHistory(
|
||||
@QueryMap params: Map<String, String>
|
||||
): Response<GenericResponse<WidgetResponse>>
|
||||
@@ -111,11 +114,13 @@ interface RetrofitService {
|
||||
): Response<GenericResponse<WidgetResponse>>
|
||||
|
||||
@GET("/kuber/home/get-home-content")
|
||||
@RetryPolicy(retryCount = 3)
|
||||
suspend fun getDigitalGoldHome(
|
||||
@QueryMap params: Map<String, String>
|
||||
): Response<GenericResponse<WidgetResponse>>
|
||||
|
||||
@POST("/kuber/order/sell")
|
||||
@RetryPolicy(retryCount = 3)
|
||||
suspend fun getDigitalGoldSellOrder(
|
||||
@Body goldSellOrderRequest: GoldSellOrderRequest
|
||||
): Response<GenericResponse<GoldSellOrderResponse>>
|
||||
@@ -146,6 +151,7 @@ interface RetrofitService {
|
||||
): Response<GenericResponse<DigitalGoldActionCheckResponse>>
|
||||
|
||||
@GET("/kuber/order/payment-details/get-upi-page-content")
|
||||
@RetryPolicy(retryCount = 3)
|
||||
suspend fun fetchDigitalGoldSellUpiScreenData(
|
||||
@Query("exchangeRateId") exchangeRateId: String,
|
||||
@Query("amount") amount: Double
|
||||
|
||||
Reference in New Issue
Block a user