mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
feat(router): add total count for payments list (#1912)
This commit is contained in:
@ -4,7 +4,6 @@ use serde::{Deserialize, Serialize};
|
||||
use time::PrimitiveDateTime;
|
||||
|
||||
use crate::{errors, MerchantStorageScheme};
|
||||
const QUERY_LIMIT: u32 = 20;
|
||||
const MAX_LIMIT: u32 = 100;
|
||||
#[async_trait::async_trait]
|
||||
pub trait PaymentIntentInterface {
|
||||
@ -54,6 +53,14 @@ pub trait PaymentIntentInterface {
|
||||
Vec<(PaymentIntent, super::payment_attempt::PaymentAttempt)>,
|
||||
errors::StorageError,
|
||||
>;
|
||||
|
||||
#[cfg(feature = "olap")]
|
||||
async fn get_filtered_active_attempt_ids_for_total_count(
|
||||
&self,
|
||||
merchant_id: &str,
|
||||
constraints: &PaymentIntentFetchConstraints,
|
||||
storage_scheme: MerchantStorageScheme,
|
||||
) -> error_stack::Result<Vec<String>, errors::StorageError>;
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||||
@ -420,7 +427,7 @@ impl From<api_models::payments::PaymentListFilterConstraints> for PaymentIntentF
|
||||
customer_id: None,
|
||||
starting_after_id: None,
|
||||
ending_before_id: None,
|
||||
limit: Some(QUERY_LIMIT),
|
||||
limit: value.limit,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user