diff --git a/crates/router/src/db/refund.rs b/crates/router/src/db/refund.rs index ccbd6a5b39..35322805f3 100644 --- a/crates/router/src/db/refund.rs +++ b/crates/router/src/db/refund.rs @@ -638,21 +638,21 @@ mod storage { &self, merchant_id: &str, refund_details: &api_models::refunds::RefundListRequest, - storage_scheme: enums::MerchantStorageScheme, + _storage_scheme: enums::MerchantStorageScheme, limit: i64, offset: i64, ) -> CustomResult, errors::StorageError> { - match storage_scheme { - enums::MerchantStorageScheme::PostgresOnly => { - let conn = connection::pg_connection_read(self).await?; - ::filter_by_constraints(&conn, merchant_id, refund_details, limit, offset) - .await - .map_err(Into::into) - .into_report() - } - - enums::MerchantStorageScheme::RedisKv => Err(errors::StorageError::KVError.into()), - } + let conn = connection::pg_connection_read(self).await?; + ::filter_by_constraints( + &conn, + merchant_id, + refund_details, + limit, + offset, + ) + .await + .map_err(Into::into) + .into_report() } #[cfg(feature = "olap")] @@ -660,19 +660,13 @@ mod storage { &self, merchant_id: &str, refund_details: &api_models::refunds::TimeRange, - storage_scheme: enums::MerchantStorageScheme, + _storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult { - match storage_scheme { - enums::MerchantStorageScheme::PostgresOnly => { - let conn = connection::pg_connection_read(self).await?; - ::filter_by_meta_constraints(&conn, merchant_id, refund_details) + let conn = connection::pg_connection_read(self).await?; + ::filter_by_meta_constraints(&conn, merchant_id, refund_details) .await .map_err(Into::into) .into_report() - } - - enums::MerchantStorageScheme::RedisKv => Err(errors::StorageError::KVError.into()), - } } #[cfg(feature = "olap")] @@ -680,19 +674,17 @@ mod storage { &self, merchant_id: &str, refund_details: &api_models::refunds::RefundListRequest, - storage_scheme: enums::MerchantStorageScheme, + _storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult { - match storage_scheme { - enums::MerchantStorageScheme::PostgresOnly => { - let conn = connection::pg_connection_read(self).await?; - ::get_refunds_count(&conn, merchant_id, refund_details) - .await - .map_err(Into::into) - .into_report() - } - - enums::MerchantStorageScheme::RedisKv => Err(errors::StorageError::KVError.into()), - } + let conn = connection::pg_connection_read(self).await?; + ::get_refunds_count( + &conn, + merchant_id, + refund_details, + ) + .await + .map_err(Into::into) + .into_report() } } } diff --git a/crates/storage_impl/src/payments/payment_intent.rs b/crates/storage_impl/src/payments/payment_intent.rs index 8352158be0..3b3359b4be 100644 --- a/crates/storage_impl/src/payments/payment_intent.rs +++ b/crates/storage_impl/src/payments/payment_intent.rs @@ -224,15 +224,11 @@ impl PaymentIntentInterface for KVRouterStore { filters: &PaymentIntentFetchConstraints, storage_scheme: MerchantStorageScheme, ) -> error_stack::Result, StorageError> { - match storage_scheme { - MerchantStorageScheme::PostgresOnly => { - self.router_store - .filter_payment_intent_by_constraints(merchant_id, filters, storage_scheme) - .await - } - MerchantStorageScheme::RedisKv => Err(StorageError::KVError.into()), - } + self.router_store + .filter_payment_intent_by_constraints(merchant_id, filters, storage_scheme) + .await } + #[cfg(feature = "olap")] async fn filter_payment_intents_by_time_range_constraints( &self, @@ -240,18 +236,13 @@ impl PaymentIntentInterface for KVRouterStore { time_range: &api_models::payments::TimeRange, storage_scheme: MerchantStorageScheme, ) -> error_stack::Result, StorageError> { - match storage_scheme { - MerchantStorageScheme::PostgresOnly => { - self.router_store - .filter_payment_intents_by_time_range_constraints( - merchant_id, - time_range, - storage_scheme, - ) - .await - } - MerchantStorageScheme::RedisKv => Err(StorageError::KVError.into()), - } + self.router_store + .filter_payment_intents_by_time_range_constraints( + merchant_id, + time_range, + storage_scheme, + ) + .await } #[cfg(feature = "olap")] @@ -261,14 +252,9 @@ impl PaymentIntentInterface for KVRouterStore { filters: &PaymentIntentFetchConstraints, storage_scheme: MerchantStorageScheme, ) -> error_stack::Result, StorageError> { - match storage_scheme { - MerchantStorageScheme::PostgresOnly => { - self.router_store - .get_filtered_payment_intents_attempt(merchant_id, filters, storage_scheme) - .await - } - MerchantStorageScheme::RedisKv => Err(StorageError::KVError.into()), - } + self.router_store + .get_filtered_payment_intents_attempt(merchant_id, filters, storage_scheme) + .await } #[cfg(feature = "olap")] @@ -278,19 +264,13 @@ impl PaymentIntentInterface for KVRouterStore { constraints: &PaymentIntentFetchConstraints, storage_scheme: MerchantStorageScheme, ) -> error_stack::Result, StorageError> { - match storage_scheme { - MerchantStorageScheme::PostgresOnly => { - self.router_store - .get_filtered_active_attempt_ids_for_total_count( - merchant_id, - constraints, - storage_scheme, - ) - .await - } - - MerchantStorageScheme::RedisKv => Err(StorageError::KVError.into()), - } + self.router_store + .get_filtered_active_attempt_ids_for_total_count( + merchant_id, + constraints, + storage_scheme, + ) + .await } }