refactor(router): Remove payment_methods_v2 and customer_v2 feature flag (#8236)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Prasunna Soppa
2025-06-12 00:07:24 +05:30
committed by GitHub
parent 6ea2e2a6f4
commit 000aa23c10
106 changed files with 896 additions and 1856 deletions

View File

@ -27,7 +27,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
type Error = StorageError;
#[instrument(skip_all)]
// check customer not found in kv and fallback to db
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
async fn find_customer_optional_by_customer_id_merchant_id(
&self,
state: &KeyManagerState,
@ -65,7 +65,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
#[instrument(skip_all)]
// check customer not found in kv and fallback to db
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
async fn find_customer_optional_with_redacted_customer_details_by_customer_id_merchant_id(
&self,
state: &KeyManagerState,
@ -95,7 +95,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
.await
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
async fn find_optional_by_merchant_id_merchant_reference_id(
&self,
state: &KeyManagerState,
@ -131,7 +131,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
})
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
#[instrument(skip_all)]
async fn update_customer_by_customer_id_merchant_id(
&self,
@ -176,7 +176,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
.await
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
#[instrument(skip_all)]
async fn find_customer_by_merchant_reference_id_merchant_id(
&self,
@ -213,7 +213,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
}
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
#[instrument(skip_all)]
async fn find_customer_by_customer_id_merchant_id(
&self,
@ -263,7 +263,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
.await
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
#[instrument(skip_all)]
async fn insert_customer(
&self,
@ -306,7 +306,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
.await
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
#[instrument(skip_all)]
async fn insert_customer(
&self,
@ -350,7 +350,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
.await
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
#[instrument(skip_all)]
async fn delete_customer_by_customer_id_merchant_id(
&self,
@ -362,7 +362,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
.await
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
#[instrument(skip_all)]
async fn find_customer_by_global_id(
&self,
@ -395,7 +395,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
}
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
#[instrument(skip_all)]
async fn update_customer_by_global_id(
&self,
@ -440,7 +440,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
type Error = StorageError;
#[instrument(skip_all)]
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
async fn find_customer_optional_by_customer_id_merchant_id(
&self,
state: &KeyManagerState,
@ -474,7 +474,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
}
#[instrument(skip_all)]
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
async fn find_customer_optional_with_redacted_customer_details_by_customer_id_merchant_id(
&self,
state: &KeyManagerState,
@ -497,7 +497,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
}
#[instrument(skip_all)]
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
async fn find_optional_by_merchant_id_merchant_reference_id(
&self,
state: &KeyManagerState,
@ -530,7 +530,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
})
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
#[instrument(skip_all)]
async fn update_customer_by_customer_id_merchant_id(
&self,
@ -556,7 +556,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
.await
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
#[instrument(skip_all)]
async fn find_customer_by_customer_id_merchant_id(
&self,
@ -584,7 +584,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
}
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
#[instrument(skip_all)]
async fn find_customer_by_merchant_reference_id_merchant_id(
&self,
@ -648,7 +648,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
.await
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
#[instrument(skip_all)]
async fn delete_customer_by_customer_id_merchant_id(
&self,
@ -664,7 +664,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
})
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
#[allow(clippy::too_many_arguments)]
async fn update_customer_by_global_id(
&self,
@ -685,7 +685,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
.await
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
#[instrument(skip_all)]
async fn find_customer_by_global_id(
&self,
@ -713,8 +713,7 @@ impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
#[async_trait::async_trait]
impl domain::CustomerInterface for MockDb {
type Error = StorageError;
#[allow(clippy::panic)]
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
async fn find_customer_optional_by_customer_id_merchant_id(
&self,
state: &KeyManagerState,
@ -730,8 +729,7 @@ impl domain::CustomerInterface for MockDb {
.await
}
#[allow(clippy::panic)]
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
async fn find_customer_optional_with_redacted_customer_details_by_customer_id_merchant_id(
&self,
state: &KeyManagerState,
@ -747,8 +745,7 @@ impl domain::CustomerInterface for MockDb {
.await
}
#[allow(clippy::panic)]
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
async fn find_optional_by_merchant_id_merchant_reference_id(
&self,
state: &KeyManagerState,
@ -792,7 +789,7 @@ impl domain::CustomerInterface for MockDb {
Ok(customers)
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
#[instrument(skip_all)]
async fn update_customer_by_customer_id_merchant_id(
&self,
@ -808,7 +805,7 @@ impl domain::CustomerInterface for MockDb {
Err(StorageError::MockDbError)?
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
async fn find_customer_by_customer_id_merchant_id(
&self,
_state: &KeyManagerState,
@ -821,7 +818,7 @@ impl domain::CustomerInterface for MockDb {
Err(StorageError::MockDbError)?
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
async fn find_customer_by_merchant_reference_id_merchant_id(
&self,
_state: &KeyManagerState,
@ -860,7 +857,7 @@ impl domain::CustomerInterface for MockDb {
.change_context(StorageError::DecryptionError)
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
async fn delete_customer_by_customer_id_merchant_id(
&self,
_customer_id: &id_type::CustomerId,
@ -870,7 +867,7 @@ impl domain::CustomerInterface for MockDb {
Err(StorageError::MockDbError)?
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
#[allow(clippy::too_many_arguments)]
async fn update_customer_by_global_id(
&self,
@ -886,7 +883,7 @@ impl domain::CustomerInterface for MockDb {
Err(StorageError::MockDbError)?
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
async fn find_customer_by_global_id(
&self,
_state: &KeyManagerState,