mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
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:
@ -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")]
|
||||
|
||||
@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user