mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(router): apply filters on payments (#1744)
This commit is contained in:
@ -1723,25 +1723,38 @@ pub struct PaymentListResponse {
|
||||
pub data: Vec<PaymentsResponse>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, ToSchema)]
|
||||
#[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
|
||||
pub offset: Option<i64>,
|
||||
/// 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)]
|
||||
pub time_range: Option<TimeRange>,
|
||||
/// The list of connectors to filter payments list
|
||||
pub connector: Option<Vec<String>>,
|
||||
/// The list of currencies to filter payments list
|
||||
pub currency: Option<Vec<enums::Currency>>,
|
||||
/// The list of payment statuses to filter payments list
|
||||
pub status: Option<Vec<enums::IntentStatus>>,
|
||||
/// The list of payment methods to filter payments list
|
||||
pub payment_methods: Option<Vec<enums::PaymentMethod>>,
|
||||
}
|
||||
#[derive(Clone, Debug, serde::Serialize)]
|
||||
pub struct PaymentListFilters {
|
||||
/// The list of available connector filters
|
||||
#[schema(value_type = Vec<api_enums::Connector>)]
|
||||
pub connector: Vec<String>,
|
||||
/// The list of available currency filters
|
||||
#[schema(value_type = Vec<Currency>)]
|
||||
pub currency: Vec<enums::Currency>,
|
||||
/// The list of available payment status filters
|
||||
#[schema(value_type = Vec<IntentStatus>)]
|
||||
pub status: Vec<enums::IntentStatus>,
|
||||
/// The list of available payment method filters
|
||||
#[schema(value_type = Vec<PaymentMethod>)]
|
||||
pub payment_method: Vec<enums::PaymentMethod>,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Debug, Clone, Copy, serde::Serialize, serde::Deserialize, PartialEq, Eq, Hash, ToSchema,
|
||||
)]
|
||||
#[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize, PartialEq, Eq, Hash)]
|
||||
pub struct TimeRange {
|
||||
/// The start time to filter payments list or to get list of filters. To get list of filters start time is needed to be passed
|
||||
#[serde(with = "common_utils::custom_serde::iso8601")]
|
||||
|
||||
@ -135,6 +135,7 @@ pub struct RefundListRequest {
|
||||
/// The starting point within a list of objects
|
||||
pub offset: Option<i64>,
|
||||
/// 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)]
|
||||
pub time_range: Option<TimeRange>,
|
||||
/// The list of connectors to filter refunds list
|
||||
pub connector: Option<Vec<String>>,
|
||||
|
||||
Reference in New Issue
Block a user