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:
Shankar Singh C
2025-08-22 19:16:19 +05:30
committed by GitHub
parent cc44831c51
commit ad05dc4176
27 changed files with 158 additions and 45 deletions

View File

@ -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)]