mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 17:47:54 +08:00
feat(analytics): Add RoutingApproach filter in payment analytics (#8408)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -29,7 +29,7 @@ pub mod diesel_exports {
|
||||
DbPaymentType as PaymentType, DbProcessTrackerStatus as ProcessTrackerStatus,
|
||||
DbRefundStatus as RefundStatus,
|
||||
DbRequestIncrementalAuthorization as RequestIncrementalAuthorization,
|
||||
DbScaExemptionType as ScaExemptionType,
|
||||
DbRoutingApproach as RoutingApproach, DbScaExemptionType as ScaExemptionType,
|
||||
DbSuccessBasedRoutingConclusiveState as SuccessBasedRoutingConclusiveState,
|
||||
DbTokenizationFlag as TokenizationFlag, DbWebhookDeliveryAttempt as WebhookDeliveryAttempt,
|
||||
};
|
||||
@ -8494,3 +8494,44 @@ pub enum TokenDataType {
|
||||
/// Fetch network token for the given payment method
|
||||
NetworkToken,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Clone,
|
||||
Copy,
|
||||
Debug,
|
||||
Default,
|
||||
Eq,
|
||||
Hash,
|
||||
PartialEq,
|
||||
serde::Deserialize,
|
||||
serde::Serialize,
|
||||
strum::Display,
|
||||
strum::VariantNames,
|
||||
strum::EnumIter,
|
||||
strum::EnumString,
|
||||
ToSchema,
|
||||
)]
|
||||
#[router_derive::diesel_enum(storage_type = "db_enum")]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum RoutingApproach {
|
||||
SuccessRateExploitation,
|
||||
SuccessRateExploration,
|
||||
ContractBasedRouting,
|
||||
DebitRouting,
|
||||
RuleBasedRouting,
|
||||
VolumeBasedRouting,
|
||||
#[default]
|
||||
DefaultFallback,
|
||||
}
|
||||
|
||||
impl RoutingApproach {
|
||||
pub fn from_decision_engine_approach(approach: &str) -> Self {
|
||||
match approach {
|
||||
"SR_SELECTION_V3_ROUTING" => Self::SuccessRateExploitation,
|
||||
"SR_V3_HEDGING" => Self::SuccessRateExploration,
|
||||
"NTW_BASED_ROUTING" => Self::DebitRouting,
|
||||
_ => Self::DefaultFallback,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user