feat(router): add total count for payments list (#1912)

This commit is contained in:
Apoorv Dixit
2023-08-29 16:48:35 +05:30
committed by GitHub
parent 784702d9c5
commit 7a5c8413cf
10 changed files with 292 additions and 16 deletions

View File

@ -1976,13 +1976,24 @@ pub struct PaymentListResponse {
// The list of payments response objects
pub data: Vec<PaymentsResponse>,
}
#[derive(Clone, Debug, serde::Serialize)]
pub struct PaymentListResponseV2 {
/// The number of payments included in the list for given constraints
pub count: usize,
/// The total number of available payments for given constraints
pub total_count: i64,
/// The list of payments response objects
pub data: Vec<PaymentsResponse>,
}
#[derive(Clone, Debug, serde::Deserialize)]
#[serde(deny_unknown_fields)]
pub struct PaymentListFilterConstraints {
/// The identifier for payment
pub payment_id: Option<String>,
/// The starting point within a list of objects, limit on number of object will be some constant for join query
/// The limit on the number of objects. The max limit is 20
pub limit: Option<u32>,
/// The starting point within a list of objects
pub offset: Option<u32>,
/// The time range for which objects are needed. TimeRange has two fields start_time and end_time from which objects can be filtered as per required scenarios (created_at, time less than, greater than etc).
#[serde(flatten)]