mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(router): add support to use signature_network and is_issuer_regulated as filters (#9033)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -45,6 +45,12 @@ pub struct PaymentFilters {
|
||||
pub first_attempt: Vec<bool>,
|
||||
#[serde(default)]
|
||||
pub routing_approach: Vec<RoutingApproach>,
|
||||
#[serde(default)]
|
||||
pub signature_network: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub is_issuer_regulated: Vec<bool>,
|
||||
#[serde(default)]
|
||||
pub is_debit_routed: Vec<bool>,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
@ -87,6 +93,9 @@ pub enum PaymentDimensions {
|
||||
CardIssuer,
|
||||
ErrorReason,
|
||||
RoutingApproach,
|
||||
SignatureNetwork,
|
||||
IsIssuerRegulated,
|
||||
IsDebitRouted,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
@ -208,6 +217,9 @@ pub struct PaymentMetricsBucketIdentifier {
|
||||
pub card_issuer: Option<String>,
|
||||
pub error_reason: Option<String>,
|
||||
pub routing_approach: Option<RoutingApproach>,
|
||||
pub signature_network: Option<String>,
|
||||
pub is_issuer_regulated: Option<bool>,
|
||||
pub is_debit_routed: Option<bool>,
|
||||
#[serde(rename = "time_range")]
|
||||
pub time_bucket: TimeRange,
|
||||
// Coz FE sucks
|
||||
@ -234,6 +246,9 @@ impl PaymentMetricsBucketIdentifier {
|
||||
card_issuer: Option<String>,
|
||||
error_reason: Option<String>,
|
||||
routing_approach: Option<RoutingApproach>,
|
||||
signature_network: Option<String>,
|
||||
is_issuer_regulated: Option<bool>,
|
||||
is_debit_routed: Option<bool>,
|
||||
normalized_time_range: TimeRange,
|
||||
) -> Self {
|
||||
Self {
|
||||
@ -252,6 +267,9 @@ impl PaymentMetricsBucketIdentifier {
|
||||
card_issuer,
|
||||
error_reason,
|
||||
routing_approach,
|
||||
signature_network,
|
||||
is_issuer_regulated,
|
||||
is_debit_routed,
|
||||
time_bucket: normalized_time_range,
|
||||
start_time: normalized_time_range.start_time,
|
||||
}
|
||||
@ -278,6 +296,9 @@ impl Hash for PaymentMetricsBucketIdentifier {
|
||||
.clone()
|
||||
.map(|i| i.to_string())
|
||||
.hash(state);
|
||||
self.signature_network.hash(state);
|
||||
self.is_issuer_regulated.hash(state);
|
||||
self.is_debit_routed.hash(state);
|
||||
self.time_bucket.hash(state);
|
||||
}
|
||||
}
|
||||
@ -319,8 +340,6 @@ pub struct PaymentMetricsBucketValue {
|
||||
pub debit_routed_transaction_count: Option<u64>,
|
||||
pub debit_routing_savings: Option<u64>,
|
||||
pub debit_routing_savings_in_usd: Option<u64>,
|
||||
pub signature_network: Option<String>,
|
||||
pub is_issuer_regulated: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
|
||||
Reference in New Issue
Block a user