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:
Sai Harsha Vardhan
2024-09-04 13:58:05 +05:30
committed by GitHub
parent c84af20ec1
commit b853226120
71 changed files with 458 additions and 1351 deletions

View File

@ -370,10 +370,7 @@ pub async fn find_mca_from_authentication_id_type(
.to_not_found_response(errors::ApiErrorResponse::InternalServerError)?
}
};
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "merchant_connector_account_v2")
))]
#[cfg(feature = "v1")]
{
db.find_by_merchant_connector_account_merchant_id_merchant_connector_id(
&state.into(),
@ -391,7 +388,7 @@ pub async fn find_mca_from_authentication_id_type(
},
)
}
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
#[cfg(feature = "v2")]
//get mca using id
{
let _ = key_store;
@ -419,10 +416,7 @@ pub async fn get_mca_from_payment_intent(
let key_manager_state: &KeyManagerState = &state.into();
match payment_attempt.merchant_connector_id {
Some(merchant_connector_id) => {
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "merchant_connector_account_v2")
))]
#[cfg(feature = "v1")]
{
db.find_by_merchant_connector_account_merchant_id_merchant_connector_id(
key_manager_state,
@ -437,7 +431,7 @@ pub async fn get_mca_from_payment_intent(
},
)
}
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
#[cfg(feature = "v2")]
{
//get mca using id
let _id = merchant_connector_id;
@ -456,10 +450,7 @@ pub async fn get_mca_from_payment_intent(
.attach_printable("profile_id is not set in payment_intent")?
.clone();
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "merchant_connector_account_v2")
))]
#[cfg(feature = "v1")]
{
db.find_merchant_connector_account_by_profile_id_connector_name(
key_manager_state,
@ -477,7 +468,7 @@ pub async fn get_mca_from_payment_intent(
},
)
}
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
#[cfg(feature = "v2")]
{
//get mca using id
let _ = profile_id;
@ -517,10 +508,7 @@ pub async fn get_mca_from_payout_attempt(
let key_manager_state: &KeyManagerState = &state.into();
match payout.merchant_connector_id {
Some(merchant_connector_id) => {
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "merchant_connector_account_v2")
))]
#[cfg(feature = "v1")]
{
db.find_by_merchant_connector_account_merchant_id_merchant_connector_id(
key_manager_state,
@ -535,7 +523,7 @@ pub async fn get_mca_from_payout_attempt(
},
)
}
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
#[cfg(feature = "v2")]
{
//get mca using id
let _id = merchant_connector_id;
@ -546,10 +534,7 @@ pub async fn get_mca_from_payout_attempt(
}
}
None => {
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "merchant_connector_account_v2")
))]
#[cfg(feature = "v1")]
{
db.find_merchant_connector_account_by_profile_id_connector_name(
key_manager_state,
@ -568,7 +553,7 @@ pub async fn get_mca_from_payout_attempt(
},
)
}
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
#[cfg(feature = "v2")]
{
todo!()
}
@ -585,21 +570,15 @@ pub async fn get_mca_from_object_reference_id(
) -> CustomResult<domain::MerchantConnectorAccount, errors::ApiErrorResponse> {
let db = &*state.store;
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "merchant_account_v2")
))]
#[cfg(feature = "v1")]
let default_profile_id = merchant_account.default_profile.as_ref();
#[cfg(all(feature = "v2", feature = "merchant_account_v2"))]
#[cfg(feature = "v2")]
let default_profile_id = Option::<&String>::None;
match default_profile_id {
Some(profile_id) => {
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "merchant_connector_account_v2")
))]
#[cfg(feature = "v1")]
{
db.find_merchant_connector_account_by_profile_id_connector_name(
&state.into(),
@ -617,7 +596,7 @@ pub async fn get_mca_from_object_reference_id(
},
)
}
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
#[cfg(feature = "v2")]
{
let _db = db;
let _profile_id = profile_id;