mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
refactor(router): remove admin v2 intermediate features (#5780)
Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in> Co-authored-by: Aprabhat19 <amishaprabhat@gmail.com> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
c84af20ec1
commit
b853226120
@ -12,9 +12,9 @@ use rustc_hash::FxHashSet;
|
||||
use super::payments;
|
||||
#[cfg(feature = "payouts")]
|
||||
use super::payouts;
|
||||
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "routing_v2")))]
|
||||
#[cfg(feature = "v1")]
|
||||
use crate::utils::ValueExt;
|
||||
#[cfg(all(feature = "v2", feature = "routing_v2"))]
|
||||
#[cfg(feature = "v2")]
|
||||
use crate::{
|
||||
core::{admin, errors::RouterResult},
|
||||
db::StorageInterface,
|
||||
@ -41,10 +41,10 @@ where
|
||||
Payout(&'a payouts::PayoutData),
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "v2", feature = "routing_v2"))]
|
||||
#[cfg(feature = "v2")]
|
||||
struct RoutingAlgorithmUpdate(RoutingAlgorithm);
|
||||
|
||||
#[cfg(all(feature = "v2", feature = "routing_v2"))]
|
||||
#[cfg(feature = "v2")]
|
||||
impl RoutingAlgorithmUpdate {
|
||||
pub fn create_new_routing_algorithm(
|
||||
request: &routing_types::RoutingConfigRequest,
|
||||
@ -114,7 +114,7 @@ pub async fn retrieve_merchant_routing_dictionary(
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "v2", feature = "routing_v2"))]
|
||||
#[cfg(feature = "v2")]
|
||||
pub async fn create_routing_algorithm_under_profile(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -184,7 +184,7 @@ pub async fn create_routing_algorithm_under_profile(
|
||||
Ok(service_api::ApplicationResponse::Json(new_record))
|
||||
}
|
||||
|
||||
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "routing_v2")))]
|
||||
#[cfg(feature = "v1")]
|
||||
pub async fn create_routing_algorithm_under_profile(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -274,11 +274,7 @@ pub async fn create_routing_algorithm_under_profile(
|
||||
Ok(service_api::ApplicationResponse::Json(new_record))
|
||||
}
|
||||
|
||||
#[cfg(all(
|
||||
feature = "v2",
|
||||
feature = "routing_v2",
|
||||
feature = "business_profile_v2"
|
||||
))]
|
||||
#[cfg(feature = "v2")]
|
||||
pub async fn link_routing_config_under_profile(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -348,10 +344,7 @@ pub async fn link_routing_config_under_profile(
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(all(
|
||||
any(feature = "v1", feature = "v2"),
|
||||
not(any(feature = "routing_v2", feature = "business_profile_v2"))
|
||||
))]
|
||||
#[cfg(feature = "v1")]
|
||||
pub async fn link_routing_config(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -430,7 +423,7 @@ pub async fn link_routing_config(
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "v2", feature = "routing_v2",))]
|
||||
#[cfg(feature = "v2")]
|
||||
pub async fn retrieve_routing_algorithm_from_algorithm_id(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -466,7 +459,7 @@ pub async fn retrieve_routing_algorithm_from_algorithm_id(
|
||||
Ok(service_api::ApplicationResponse::Json(response))
|
||||
}
|
||||
|
||||
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "routing_v2")))]
|
||||
#[cfg(feature = "v1")]
|
||||
pub async fn retrieve_routing_algorithm_from_algorithm_id(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -507,11 +500,7 @@ pub async fn retrieve_routing_algorithm_from_algorithm_id(
|
||||
Ok(service_api::ApplicationResponse::Json(response))
|
||||
}
|
||||
|
||||
#[cfg(all(
|
||||
feature = "v2",
|
||||
feature = "routing_v2",
|
||||
feature = "business_profile_v2"
|
||||
))]
|
||||
#[cfg(feature = "v2")]
|
||||
pub async fn unlink_routing_config_under_profile(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -565,10 +554,7 @@ pub async fn unlink_routing_config_under_profile(
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(
|
||||
any(feature = "v1", feature = "v2"),
|
||||
not(any(feature = "routing_v2", feature = "business_profile_v2"))
|
||||
))]
|
||||
#[cfg(feature = "v1")]
|
||||
pub async fn unlink_routing_config(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -661,11 +647,7 @@ pub async fn unlink_routing_config(
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(
|
||||
feature = "v2",
|
||||
feature = "routing_v2",
|
||||
feature = "business_profile_v2"
|
||||
))]
|
||||
#[cfg(feature = "v2")]
|
||||
pub async fn update_default_fallback_routing(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -741,10 +723,7 @@ pub async fn update_default_fallback_routing(
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(all(
|
||||
any(feature = "v1", feature = "v2"),
|
||||
not(any(feature = "routing_v2", feature = "business_profile_v2"))
|
||||
))]
|
||||
#[cfg(feature = "v1")]
|
||||
pub async fn update_default_routing_config(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -797,11 +776,7 @@ pub async fn update_default_routing_config(
|
||||
Ok(service_api::ApplicationResponse::Json(updated_config))
|
||||
}
|
||||
|
||||
#[cfg(all(
|
||||
feature = "v2",
|
||||
feature = "routing_v2",
|
||||
feature = "business_profile_v2"
|
||||
))]
|
||||
#[cfg(feature = "v2")]
|
||||
pub async fn retrieve_default_fallback_algorithm_for_profile(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -828,10 +803,7 @@ pub async fn retrieve_default_fallback_algorithm_for_profile(
|
||||
Ok(service_api::ApplicationResponse::Json(connectors_choice))
|
||||
}
|
||||
|
||||
#[cfg(all(
|
||||
any(feature = "v1", feature = "v2"),
|
||||
not(any(feature = "routing_v2", feature = "business_profile_v2"))
|
||||
))]
|
||||
#[cfg(feature = "v1")]
|
||||
|
||||
pub async fn retrieve_default_routing_config(
|
||||
state: SessionState,
|
||||
@ -852,11 +824,7 @@ pub async fn retrieve_default_routing_config(
|
||||
service_api::ApplicationResponse::Json(conn_choice)
|
||||
})
|
||||
}
|
||||
#[cfg(all(
|
||||
feature = "v2",
|
||||
feature = "routing_v2",
|
||||
feature = "business_profile_v2"
|
||||
))]
|
||||
#[cfg(feature = "v2")]
|
||||
pub async fn retrieve_routing_config_under_profile(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
@ -900,10 +868,7 @@ pub async fn retrieve_routing_config_under_profile(
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(all(
|
||||
any(feature = "v1", feature = "v2"),
|
||||
not(any(feature = "routing_v2", feature = "business_profile_v2"))
|
||||
))]
|
||||
#[cfg(feature = "v1")]
|
||||
pub async fn retrieve_linked_routing_config(
|
||||
state: SessionState,
|
||||
merchant_account: domain::MerchantAccount,
|
||||
|
||||
Reference in New Issue
Block a user