mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
fix(payments): add time range in list payment attempts query (#5959)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -52,6 +52,7 @@ impl PaymentAttemptInterface for MockDb {
|
||||
_payment_method_type: Option<Vec<PaymentMethodType>>,
|
||||
_authentication_type: Option<Vec<AuthenticationType>>,
|
||||
_merchanat_connector_id: Option<Vec<common_utils::id_type::MerchantConnectorAccountId>>,
|
||||
_time_range: Option<common_utils::types::TimeRange>,
|
||||
_profile_id_list: Option<Vec<common_utils::id_type::ProfileId>>,
|
||||
_storage_scheme: storage_enums::MerchantStorageScheme,
|
||||
) -> CustomResult<i64, StorageError> {
|
||||
|
||||
@ -41,7 +41,7 @@ impl PaymentIntentInterface for MockDb {
|
||||
&self,
|
||||
_state: &KeyManagerState,
|
||||
_merchant_id: &common_utils::id_type::MerchantId,
|
||||
_time_range: &api_models::payments::TimeRange,
|
||||
_time_range: &common_utils::types::TimeRange,
|
||||
_key_store: &MerchantKeyStore,
|
||||
_storage_scheme: storage_enums::MerchantStorageScheme,
|
||||
) -> CustomResult<Vec<PaymentIntent>, StorageError> {
|
||||
@ -57,7 +57,7 @@ impl PaymentIntentInterface for MockDb {
|
||||
&self,
|
||||
_merchant_id: &common_utils::id_type::MerchantId,
|
||||
_profile_id_list: Option<Vec<common_utils::id_type::ProfileId>>,
|
||||
_time_range: &api_models::payments::TimeRange,
|
||||
_time_range: &common_utils::types::TimeRange,
|
||||
) -> CustomResult<Vec<(common_enums::IntentStatus, i64)>, StorageError> {
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(StorageError::MockDbError)?
|
||||
|
||||
@ -86,7 +86,7 @@ impl PayoutsInterface for MockDb {
|
||||
async fn filter_payouts_by_time_range_constraints(
|
||||
&self,
|
||||
_merchant_id: &common_utils::id_type::MerchantId,
|
||||
_time_range: &api_models::payments::TimeRange,
|
||||
_time_range: &common_utils::types::TimeRange,
|
||||
_storage_scheme: storage_enums::MerchantStorageScheme,
|
||||
) -> CustomResult<Vec<Payouts>, StorageError> {
|
||||
// TODO: Implement function for `MockDb`
|
||||
|
||||
@ -403,6 +403,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for RouterStore<T> {
|
||||
payment_method_type: Option<Vec<PaymentMethodType>>,
|
||||
authentication_type: Option<Vec<AuthenticationType>>,
|
||||
merchant_connector_id: Option<Vec<common_utils::id_type::MerchantConnectorAccountId>>,
|
||||
time_range: Option<common_utils::types::TimeRange>,
|
||||
profile_id_list: Option<Vec<common_utils::id_type::ProfileId>>,
|
||||
_storage_scheme: MerchantStorageScheme,
|
||||
) -> CustomResult<i64, errors::StorageError> {
|
||||
@ -426,6 +427,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for RouterStore<T> {
|
||||
payment_method,
|
||||
payment_method_type,
|
||||
authentication_type,
|
||||
time_range,
|
||||
profile_id_list,
|
||||
merchant_connector_id,
|
||||
)
|
||||
@ -1289,6 +1291,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for KVRouterStore<T> {
|
||||
payment_method_type: Option<Vec<PaymentMethodType>>,
|
||||
authentication_type: Option<Vec<AuthenticationType>>,
|
||||
merchant_connector_id: Option<Vec<common_utils::id_type::MerchantConnectorAccountId>>,
|
||||
time_range: Option<common_utils::types::TimeRange>,
|
||||
profile_id_list: Option<Vec<common_utils::id_type::ProfileId>>,
|
||||
storage_scheme: MerchantStorageScheme,
|
||||
) -> CustomResult<i64, errors::StorageError> {
|
||||
@ -1301,6 +1304,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for KVRouterStore<T> {
|
||||
payment_method_type,
|
||||
authentication_type,
|
||||
merchant_connector_id,
|
||||
time_range,
|
||||
profile_id_list,
|
||||
storage_scheme,
|
||||
)
|
||||
|
||||
@ -378,7 +378,7 @@ impl<T: DatabaseStore> PaymentIntentInterface for KVRouterStore<T> {
|
||||
&self,
|
||||
state: &KeyManagerState,
|
||||
merchant_id: &common_utils::id_type::MerchantId,
|
||||
time_range: &api_models::payments::TimeRange,
|
||||
time_range: &common_utils::types::TimeRange,
|
||||
merchant_key_store: &MerchantKeyStore,
|
||||
storage_scheme: MerchantStorageScheme,
|
||||
) -> error_stack::Result<Vec<PaymentIntent>, StorageError> {
|
||||
@ -402,7 +402,7 @@ impl<T: DatabaseStore> PaymentIntentInterface for KVRouterStore<T> {
|
||||
&self,
|
||||
merchant_id: &common_utils::id_type::MerchantId,
|
||||
profile_id_list: Option<Vec<common_utils::id_type::ProfileId>>,
|
||||
time_range: &api_models::payments::TimeRange,
|
||||
time_range: &common_utils::types::TimeRange,
|
||||
) -> error_stack::Result<Vec<(common_enums::IntentStatus, i64)>, StorageError> {
|
||||
self.router_store
|
||||
.get_intent_status_with_count(merchant_id, profile_id_list, time_range)
|
||||
@ -747,7 +747,7 @@ impl<T: DatabaseStore> PaymentIntentInterface for crate::RouterStore<T> {
|
||||
&self,
|
||||
state: &KeyManagerState,
|
||||
merchant_id: &common_utils::id_type::MerchantId,
|
||||
time_range: &api_models::payments::TimeRange,
|
||||
time_range: &common_utils::types::TimeRange,
|
||||
merchant_key_store: &MerchantKeyStore,
|
||||
storage_scheme: MerchantStorageScheme,
|
||||
) -> error_stack::Result<Vec<PaymentIntent>, StorageError> {
|
||||
@ -773,7 +773,7 @@ impl<T: DatabaseStore> PaymentIntentInterface for crate::RouterStore<T> {
|
||||
&self,
|
||||
merchant_id: &common_utils::id_type::MerchantId,
|
||||
profile_id_list: Option<Vec<common_utils::id_type::ProfileId>>,
|
||||
time_range: &api_models::payments::TimeRange,
|
||||
time_range: &common_utils::types::TimeRange,
|
||||
) -> error_stack::Result<Vec<(common_enums::IntentStatus, i64)>, StorageError> {
|
||||
let conn = connection::pg_connection_read(self).await.switch()?;
|
||||
let conn = async_bb8_diesel::Connection::as_async_conn(&conn);
|
||||
|
||||
@ -368,7 +368,7 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
|
||||
async fn filter_payouts_by_time_range_constraints(
|
||||
&self,
|
||||
merchant_id: &common_utils::id_type::MerchantId,
|
||||
time_range: &api_models::payments::TimeRange,
|
||||
time_range: &common_utils::types::TimeRange,
|
||||
storage_scheme: MerchantStorageScheme,
|
||||
) -> error_stack::Result<Vec<Payouts>, StorageError> {
|
||||
self.router_store
|
||||
@ -772,7 +772,7 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
|
||||
async fn filter_payouts_by_time_range_constraints(
|
||||
&self,
|
||||
merchant_id: &common_utils::id_type::MerchantId,
|
||||
time_range: &api_models::payments::TimeRange,
|
||||
time_range: &common_utils::types::TimeRange,
|
||||
storage_scheme: MerchantStorageScheme,
|
||||
) -> error_stack::Result<Vec<Payouts>, StorageError> {
|
||||
let payout_filters = (*time_range).into();
|
||||
|
||||
Reference in New Issue
Block a user