From da1f23d2353c19f43f23f0938c1c73e109edc0c5 Mon Sep 17 00:00:00 2001 From: Apoorv Dixit <64925866+apoorvdixit88@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:06:29 +0530 Subject: [PATCH] fix(payments_list): remove time range to filter payments attempts (#6159) --- crates/diesel_models/src/query/payment_attempt.rs | 9 --------- .../src/payments/payment_attempt.rs | 1 - crates/router/src/core/payments.rs | 1 - crates/router/src/db/kafka_store.rs | 2 -- crates/storage_impl/src/mock_db/payment_attempt.rs | 1 - crates/storage_impl/src/payments/payment_attempt.rs | 4 ---- 6 files changed, 18 deletions(-) diff --git a/crates/diesel_models/src/query/payment_attempt.rs b/crates/diesel_models/src/query/payment_attempt.rs index e07d716fb6..ad056aef6d 100644 --- a/crates/diesel_models/src/query/payment_attempt.rs +++ b/crates/diesel_models/src/query/payment_attempt.rs @@ -369,7 +369,6 @@ impl PaymentAttempt { payment_method: Option>, payment_method_type: Option>, authentication_type: Option>, - time_range: Option, profile_id_list: Option>, merchant_connector_id: Option>, ) -> StorageResult { @@ -379,14 +378,6 @@ impl PaymentAttempt { .filter(dsl::attempt_id.eq_any(active_attempt_ids.to_owned())) .into_boxed(); - if let Some(time_range) = time_range { - filter = filter.filter(dsl::created_at.ge(time_range.start_time)); - - if let Some(end_time) = time_range.end_time { - filter = filter.filter(dsl::created_at.le(end_time)); - } - } - if let Some(connector) = connector { filter = filter.filter(dsl::connector.eq_any(connector)); } diff --git a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs index 5f0894566a..c71e08c79e 100644 --- a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs +++ b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs @@ -157,7 +157,6 @@ pub trait PaymentAttemptInterface { payment_method_type: Option>, authentication_type: Option>, merchant_connector_id: Option>, - time_range: Option, profile_id_list: Option>, storage_scheme: storage_enums::MerchantStorageScheme, ) -> error_stack::Result; diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index d00d4b7b25..6e785b55a3 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -3243,7 +3243,6 @@ pub async fn apply_filters_on_payments( constraints.payment_method_type, constraints.authentication_type, constraints.merchant_connector_id, - constraints.time_range, pi_fetch_constraints.get_profile_id_list(), merchant.storage_scheme, ) diff --git a/crates/router/src/db/kafka_store.rs b/crates/router/src/db/kafka_store.rs index 73d0552863..de10b70f50 100644 --- a/crates/router/src/db/kafka_store.rs +++ b/crates/router/src/db/kafka_store.rs @@ -1604,7 +1604,6 @@ impl PaymentAttemptInterface for KafkaStore { payment_method_type: Option>, authentication_type: Option>, merchant_connector_id: Option>, - time_range: Option, profile_id_list: Option>, storage_scheme: MerchantStorageScheme, ) -> CustomResult { @@ -1617,7 +1616,6 @@ impl PaymentAttemptInterface for KafkaStore { payment_method_type, authentication_type, merchant_connector_id, - time_range, profile_id_list, storage_scheme, ) diff --git a/crates/storage_impl/src/mock_db/payment_attempt.rs b/crates/storage_impl/src/mock_db/payment_attempt.rs index 44c089932d..c37f9f6d3d 100644 --- a/crates/storage_impl/src/mock_db/payment_attempt.rs +++ b/crates/storage_impl/src/mock_db/payment_attempt.rs @@ -52,7 +52,6 @@ impl PaymentAttemptInterface for MockDb { _payment_method_type: Option>, _authentication_type: Option>, _merchanat_connector_id: Option>, - _time_range: Option, _profile_id_list: Option>, _storage_scheme: storage_enums::MerchantStorageScheme, ) -> CustomResult { diff --git a/crates/storage_impl/src/payments/payment_attempt.rs b/crates/storage_impl/src/payments/payment_attempt.rs index 6d669437ef..63f5a0ff9f 100644 --- a/crates/storage_impl/src/payments/payment_attempt.rs +++ b/crates/storage_impl/src/payments/payment_attempt.rs @@ -403,7 +403,6 @@ impl PaymentAttemptInterface for RouterStore { payment_method_type: Option>, authentication_type: Option>, merchant_connector_id: Option>, - time_range: Option, profile_id_list: Option>, _storage_scheme: MerchantStorageScheme, ) -> CustomResult { @@ -427,7 +426,6 @@ impl PaymentAttemptInterface for RouterStore { payment_method, payment_method_type, authentication_type, - time_range, profile_id_list, merchant_connector_id, ) @@ -1289,7 +1287,6 @@ impl PaymentAttemptInterface for KVRouterStore { payment_method_type: Option>, authentication_type: Option>, merchant_connector_id: Option>, - time_range: Option, profile_id_list: Option>, storage_scheme: MerchantStorageScheme, ) -> CustomResult { @@ -1302,7 +1299,6 @@ impl PaymentAttemptInterface for KVRouterStore { payment_method_type, authentication_type, merchant_connector_id, - time_range, profile_id_list, storage_scheme, )