feat(routing): add profile config to switch between HS routing and DE routing result (#8350)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: prajjwalkumar17 <prajjwal.kumar@juspay.in>
Co-authored-by: Prajjwal kumar <write2prajjwal@gmail.com>
This commit is contained in:
Jagan
2025-06-20 18:19:23 +05:30
committed by GitHub
parent 5b8ba55f4e
commit a721d90c6b
7 changed files with 708 additions and 388 deletions

View File

@ -186,6 +186,19 @@ pub struct DecisionEngineConfigSetupRequest {
pub config: DecisionEngineConfigVariant,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct GetDecisionEngineConfigRequest {
pub merchant_id: String,
pub config: DecisionEngineDynamicAlgorithmType,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub enum DecisionEngineDynamicAlgorithmType {
SuccessRate,
Elimination,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(tag = "type", content = "data")]
#[serde(rename_all = "camelCase")]

View File

@ -1409,6 +1409,7 @@ pub struct RuleMigrationResponse {
pub profile_id: common_utils::id_type::ProfileId,
pub euclid_algorithm_id: common_utils::id_type::RoutingId,
pub decision_engine_algorithm_id: String,
pub is_active_rule: bool,
}
#[derive(Debug, serde::Serialize)]
@ -1423,11 +1424,23 @@ impl RuleMigrationResponse {
profile_id: common_utils::id_type::ProfileId,
euclid_algorithm_id: common_utils::id_type::RoutingId,
decision_engine_algorithm_id: String,
is_active_rule: bool,
) -> Self {
Self {
profile_id,
euclid_algorithm_id,
decision_engine_algorithm_id,
is_active_rule,
}
}
}
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, strum::Display, strum::EnumString)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum RoutingResultSource {
/// External Decision Engine
DecisionEngine,
/// Inbuilt Hyperswitch Routing Engine
HyperswitchRouting,
}