feat(openapi): Add open api routes for routing v2 (#5686)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Amisha Prabhat
2024-08-27 13:23:46 +05:30
committed by GitHub
parent c3c9b2740b
commit 6bb97671e7
16 changed files with 665 additions and 23 deletions

View File

@ -424,7 +424,7 @@ pub async fn link_routing_config(
}
#[cfg(all(feature = "v2", feature = "routing_v2",))]
pub async fn retrieve_active_routing_config(
pub async fn retrieve_routing_algorithm_from_algorithm_id(
state: SessionState,
merchant_account: domain::MerchantAccount,
key_store: domain::MerchantKeyStore,
@ -434,9 +434,12 @@ pub async fn retrieve_active_routing_config(
let db = state.store.as_ref();
let key_manager_state = &(&state).into();
let routing_algorithm =
RoutingAlgorithmUpdate::fetch_routing_algo(merchant_account.get_id(), &algorithm_id.0, db)
.await?;
let routing_algorithm = RoutingAlgorithmUpdate::fetch_routing_algo(
merchant_account.get_id(),
&algorithm_id.routing_algorithm_id,
db,
)
.await?;
core_utils::validate_and_get_business_profile(
db,
key_manager_state,
@ -457,7 +460,7 @@ pub async fn retrieve_active_routing_config(
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "routing_v2")))]
pub async fn retrieve_active_routing_config(
pub async fn retrieve_routing_algorithm_from_algorithm_id(
state: SessionState,
merchant_account: domain::MerchantAccount,
key_store: domain::MerchantKeyStore,
@ -469,7 +472,7 @@ pub async fn retrieve_active_routing_config(
let routing_algorithm = db
.find_routing_algorithm_by_algorithm_id_merchant_id(
&algorithm_id.0,
&algorithm_id.routing_algorithm_id,
merchant_account.get_id(),
)
.await

View File

@ -69,12 +69,12 @@ pub async fn routing_link_config(
state,
&req,
path.into_inner(),
|state, auth: auth::AuthenticationData, algorithm_id, _| {
|state, auth: auth::AuthenticationData, algorithm, _| {
routing::link_routing_config(
state,
auth.merchant_account,
auth.key_store,
algorithm_id.0,
algorithm.routing_algorithm_id,
transaction_type,
)
},
@ -117,7 +117,7 @@ pub async fn routing_link_config(
auth.merchant_account,
auth.key_store,
wrapper.profile_id,
wrapper.algorithm_id.0,
wrapper.algorithm_id.routing_algorithm_id,
transaction_type,
)
},
@ -149,7 +149,7 @@ pub async fn routing_retrieve_config(
&req,
algorithm_id,
|state, auth: auth::AuthenticationData, algorithm_id, _| {
routing::retrieve_active_routing_config(
routing::retrieve_routing_algorithm_from_algorithm_id(
state,
auth.merchant_account,
auth.key_store,