Issue:
Bug: chore: resolve warnings in v2



Resolve warnings in v2 across all crates except router crate.

Pull request description:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
This PR resolves the v2 warnings generated in crates common_utils, api_models, hyperswitch_domain_models, diesel_models, kgraph_utils, storage_impl, hyperswitch_connectors, payment_methods.

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->


## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Testing not required.


## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible


Testing:

Testing not required.

Patch:
diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs
index 50ae919d4f8..f12e6d5bd4a 100644
--- a/crates/api_models/src/admin.rs
+++ b/crates/api_models/src/admin.rs
@@ -17,13 +17,12 @@ use serde::{Deserialize, Serialize};
 use utoipa::ToSchema;
 
 use super::payments::AddressDetails;
-#[cfg(feature = "v1")]
-use crate::routing;
 use crate::{
     consts::{MAX_ORDER_FULFILLMENT_EXPIRY, MIN_ORDER_FULFILLMENT_EXPIRY},
     enums as api_enums, payment_methods,
-    profile_acquirer::ProfileAcquirerResponse,
 };
+#[cfg(feature = "v1")]
+use crate::{profile_acquirer::ProfileAcquirerResponse, routing};
 
 #[derive(Clone, Debug, Deserialize, ToSchema, Serialize)]
 pub struct MerchantAccountListRequest {
diff --git a/crates/api_models/src/refunds.rs b/crates/api_models/src/refunds.rs
index 54fb4fb470f..d6ade7e339d 100644
--- a/crates/api_models/src/refunds.rs
+++ b/crates/api_models/src/refunds.rs
@@ -7,10 +7,9 @@ use time::PrimitiveDateTime;
 use utoipa::ToSchema;
 
 use super::payments::AmountFilter;
-use crate::{
-    admin::{self, MerchantConnectorInfo},
-    enums,
-};
+#[cfg(feature = "v1")]
+use crate::admin;
+use crate::{admin::MerchantConnectorInfo, enums};
 
 #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "refunds_v2")))]
 #[derive(Default, Debug, ToSchema, Clone, Deserialize, Serialize)]
diff --git a/crates/api_models/src/tokenization.rs b/crates/api_models/src/tokenization.rs
index 5ee044ec1fb..131b0804fd6 100644
--- a/crates/api_models/src/tokenization.rs
+++ b/crates/api_models/src/tokenization.rs
@@ -1,6 +1,5 @@
 use common_enums;
 use common_utils::id_type::{GlobalCustomerId, GlobalTokenId};
-use masking::Secret;
 use serde::{Deserialize, Serialize};
 use time::PrimitiveDateTime;
 use utoipa::{schema, ToSchema};
diff --git a/crates/common_utils/src/id_type/global_id/token.rs b/crates/common_utils/src/id_type/global_id/token.rs
index 929c03f0959..2ea927d675f 100644
--- a/crates/common_utils/src/id_type/global_id/token.rs
+++ b/crates/common_utils/src/id_type/global_id/token.rs
@@ -1,7 +1,3 @@
-use error_stack::ResultExt;
-
-use crate::{errors, generate_id_with_default_len, generate_time_ordered_id_without_prefix, types};
-
 crate::global_id_type!(
     GlobalTokenId,
     "A global id that can be used to identify a token.
diff --git a/crates/common_utils/src/tokenization.rs b/crates/common_utils/src/tokenization.rs
index aa0f3dda8c1..8d19d68668a 100644
--- a/crates/common_utils/src/tokenization.rs
+++ b/crates/common_utils/src/tokenization.rs
@@ -3,12 +3,7 @@
 //! This module provides types and functions for handling tokenized payment data,
 //! including response structures and token generation utilities.
 
-use common_enums::ApiVersion;
-use diesel;
-use serde::{Deserialize, Serialize};
-use time::PrimitiveDateTime;
-
-use crate::{consts::TOKEN_LENGTH, id_type::GlobalTokenId};
+use crate::consts::TOKEN_LENGTH;
 
 #[cfg(all(feature = "v2", feature = "tokenization_v2"))]
 /// Generates a new token string
diff --git a/crates/diesel_models/src/query/tokenization.rs b/crates/diesel_models/src/query/tokenization.rs
index 0d818eb6636..8f20b903d7d 100644
--- a/crates/diesel_models/src/query/tokenization.rs
+++ b/crates/diesel_models/src/query/tokenization.rs
@@ -1,24 +1,5 @@
 #[cfg(feature = "v2")]
-use common_enums;
-#[cfg(feature = "v2")]
-use common_utils::{
-    id_type::{GlobalTokenId, MerchantId},
-    tokenization as tokenization_utils,
-};
-#[cfg(feature = "v2")]
-use diesel::{
-    associations::HasTable,
-    deserialize::FromSqlRow,
-    expression::AsExpression,
-    pg::Pg,
-    serialize::{Output, ToSql},
-    sql_types::{Jsonb, Text},
-    AsChangeset, Identifiable, Insertable, Queryable, Selectable,
-};
-#[cfg(feature = "v2")]
-use serde::{Deserialize, Serialize};
-#[cfg(feature = "v2")]
-use time::PrimitiveDateTime;
+use diesel::associations::HasTable;
 
 #[cfg(feature = "v2")]
 use crate::{
diff --git a/crates/diesel_models/src/tokenization.rs b/crates/diesel_models/src/tokenization.rs
index 50a97e62c90..e7ab2a4b136 100644
--- a/crates/diesel_models/src/tokenization.rs
+++ b/crates/diesel_models/src/tokenization.rs
@@ -1,27 +1,12 @@
 #[cfg(feature = "v2")]
 use common_enums;
 #[cfg(feature = "v2")]
-use common_utils::{
-    id_type::{GlobalTokenId, MerchantId},
-    tokenization as tokenization_utils,
-};
-#[cfg(feature = "v2")]
-use diesel::{
-    associations::HasTable,
-    deserialize::FromSqlRow,
-    expression::AsExpression,
-    pg::Pg,
-    serialize::{Output, ToSql},
-    sql_types::{Jsonb, Text},
-    AsChangeset, Identifiable, Insertable, Queryable, Selectable,
-};
-#[cfg(feature = "v2")]
-use serde::{Deserialize, Serialize};
+use diesel::{AsChangeset, Identifiable, Insertable, Queryable};
 #[cfg(feature = "v2")]
 use time::PrimitiveDateTime;
 
 #[cfg(feature = "v2")]
-use crate::{query::generics, schema_v2::tokenization, PgPooledConn, StorageResult};
+use crate::schema_v2::tokenization;
 
 #[cfg(all(feature = "v2", feature = "tokenization_v2"))]
 #[derive(Clone, Debug, Identifiable, Insertable, Queryable)]
diff --git a/crates/hyperswitch_connectors/src/connectors/chargebee.rs b/crates/hyperswitch_connectors/src/connectors/chargebee.rs
index c0e73d43a19..4dcda9ad5d8 100644
--- a/crates/hyperswitch_connectors/src/connectors/chargebee.rs
+++ b/crates/hyperswitch_connectors/src/connectors/chargebee.rs
@@ -1,8 +1,6 @@
 pub mod transformers;
 
 use base64::Engine;
-#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
-use common_utils::types::{StringMinorUnit, StringMinorUnitForConnector};
 use common_utils::{
     consts::BASE64_ENGINE,
     errors::CustomResult,
@@ -10,7 +8,9 @@ use common_utils::{
     request::{Method, Request, RequestBuilder, RequestContent},
     types::{AmountConvertor, MinorUnit, MinorUnitForConnector},
 };
-use error_stack::{report, ResultExt};
+#[cfg(feature = "v1")]
+use error_stack::report;
+use error_stack::ResultExt;
 #[cfg(all(feature = "v2", feature = "revenue_recovery"))]
 use hyperswitch_domain_models::{
     revenue_recovery, router_flow_types::revenue_recovery::RecoveryRecordBack,
@@ -47,8 +47,6 @@ use hyperswitch_interfaces::{
     types::{self, Response},
     webhooks,
 };
-#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
-use masking::ExposeInterface;
 use masking::{Mask, PeekInterface, Secret};
 use transformers as chargebee;
 
diff --git a/crates/hyperswitch_connectors/src/connectors/razorpay.rs b/crates/hyperswitch_connectors/src/connectors/razorpay.rs
index 56080d73fb6..39b83c73e43 100644
--- a/crates/hyperswitch_connectors/src/connectors/razorpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/razorpay.rs
@@ -835,8 +835,8 @@ impl ConnectorSpecifications for Razorpay {
     #[cfg(feature = "v2")]
     fn generate_connector_request_reference_id(
         &self,
-        payment_intent: &hyperswitch_domain_models::payments::PaymentIntent,
-        payment_attempt: &hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt,
+        _payment_intent: &hyperswitch_domain_models::payments::PaymentIntent,
+        _payment_attempt: &hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt,
     ) -> String {
         // The length of receipt for Razorpay order request should not exceed 40 characters.
         uuid::Uuid::now_v7().to_string()
diff --git a/crates/hyperswitch_connectors/src/connectors/recurly.rs b/crates/hyperswitch_connectors/src/connectors/recurly.rs
index bb7ea02a931..2a19a34e2b0 100644
--- a/crates/hyperswitch_connectors/src/connectors/recurly.rs
+++ b/crates/hyperswitch_connectors/src/connectors/recurly.rs
@@ -2,17 +2,11 @@ pub mod transformers;
 
 use base64::Engine;
 #[cfg(all(feature = "v2", feature = "revenue_recovery"))]
-use common_utils::request::{Method, Request, RequestBuilder, RequestContent};
+use common_utils::request::{Method, Request, RequestBuilder};
 use common_utils::{consts, errors::CustomResult, ext_traits::BytesExt};
-use error_stack::{report, ResultExt};
-#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
-use hyperswitch_domain_models::{
-    revenue_recovery, router_data_v2::flow_common_types as recovery_flow_common_types,
-    router_flow_types::revenue_recovery as recovery_router_flows,
-    router_request_types::revenue_recovery as recovery_request_types,
-    router_response_types::revenue_recovery as recovery_response_types,
-    types as recovery_router_data_types,
-};
+#[cfg(feature = "v1")]
+use error_stack::report;
+use error_stack::ResultExt;
 use hyperswitch_domain_models::{
     router_data::{ConnectorAuthType, ErrorResponse},
     router_data_v2::UasFlowData,
@@ -25,6 +19,14 @@ use hyperswitch_domain_models::{
     },
 };
 #[cfg(all(feature = "v2", feature = "revenue_recovery"))]
+use hyperswitch_domain_models::{
+    router_data_v2::flow_common_types as recovery_flow_common_types,
+    router_flow_types::revenue_recovery as recovery_router_flows,
+    router_request_types::revenue_recovery as recovery_request_types,
+    router_response_types::revenue_recovery as recovery_response_types,
+    types as recovery_router_data_types,
+};
+#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
 use hyperswitch_interfaces::types;
 use hyperswitch_interfaces::{
     api::{self, ConnectorCommon, ConnectorSpecifications, ConnectorValidation},
@@ -43,7 +45,6 @@ use crate::{connectors::recurly::transformers::RecurlyWebhookBody, constants::he
 use crate::{
     connectors::recurly::transformers::{RecurlyRecordStatus, RecurlyRecoveryDetailsData},
     types::ResponseRouterDataV2,
-    utils,
 };
 #[cfg(all(feature = "v2", feature = "revenue_recovery"))]
 const STATUS_SUCCESSFUL_ENDPOINT: &str = "mark_successful";
diff --git a/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs b/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs
index 9ffd900dc45..d7f71635cc8 100644
--- a/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs
@@ -26,9 +26,7 @@ use serde::{Deserialize, Serialize};
 use time::PrimitiveDateTime;
 
 #[cfg(all(feature = "v2", feature = "revenue_recovery"))]
-use crate::utils;
-#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
-use crate::{types::ResponseRouterDataV2, utils::PaymentsAuthorizeRequestData};
+use crate::{types::ResponseRouterDataV2, utils};
 
 pub struct RecurlyRouterData<T> {
     pub amount: StringMinorUnit, // The type of amount that a connector accepts, for example, String, i64, f64, etc.
diff --git a/crates/hyperswitch_connectors/src/connectors/stripebilling.rs b/crates/hyperswitch_connectors/src/connectors/stripebilling.rs
index 39a8e5a0dae..a15ce5f1561 100644
--- a/crates/hyperswitch_connectors/src/connectors/stripebilling.rs
+++ b/crates/hyperswitch_connectors/src/connectors/stripebilling.rs
@@ -47,8 +47,6 @@ use hyperswitch_interfaces::{
     types::{self, Response},
     webhooks,
 };
-#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
-use masking::ExposeInterface;
 use masking::{Mask, PeekInterface};
 use stripebilling::auth_headers;
 use transformers as stripebilling;
diff --git a/crates/hyperswitch_connectors/src/types.rs b/crates/hyperswitch_connectors/src/types.rs
index 0160457d2f8..6136d281ae4 100644
--- a/crates/hyperswitch_connectors/src/types.rs
+++ b/crates/hyperswitch_connectors/src/types.rs
@@ -100,6 +100,7 @@ pub(crate) type FrmCheckoutRouterData =
 pub(crate) struct ResponseRouterDataV2<Flow, R, ResourceCommonData, Request, Response> {
     pub response: R,
     pub data: RouterDataV2<Flow, ResourceCommonData, Request, Response>,
+    #[allow(dead_code)] // Used for metadata passing but this is not read
     pub http_code: u16,
 }
 
diff --git a/crates/hyperswitch_domain_models/src/business_profile.rs b/crates/hyperswitch_domain_models/src/business_profile.rs
index 93ed2af4945..af51eae8bf3 100644
--- a/crates/hyperswitch_domain_models/src/business_profile.rs
+++ b/crates/hyperswitch_domain_models/src/business_profile.rs
@@ -1361,7 +1361,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
                     merchant_business_country,
                     revenue_recovery_retry_algorithm_type: None,
                     revenue_recovery_retry_algorithm_data: None,
-                    is_iframe_redirection_enabled: None,
+                    is_iframe_redirection_enabled,
                     is_external_vault_enabled,
                     external_vault_connector_details,
                     merchant_category_code,
diff --git a/crates/hyperswitch_domain_models/src/customer.rs b/crates/hyperswitch_domain_models/src/customer.rs
index 6b364ce5807..fce8a2c31ff 100644
--- a/crates/hyperswitch_domain_models/src/customer.rs
+++ b/crates/hyperswitch_domain_models/src/customer.rs
@@ -629,7 +629,6 @@ where
         state: &KeyManagerState,
         id: &id_type::GlobalCustomerId,
         customer: Customer,
-        merchant_id: &id_type::MerchantId,
         customer_update: CustomerUpdate,
         key_store: &MerchantKeyStore,
         storage_scheme: MerchantStorageScheme,
@@ -640,7 +639,6 @@ where
         &self,
         state: &KeyManagerState,
         id: &id_type::GlobalCustomerId,
-        merchant_id: &id_type::MerchantId,
         key_store: &MerchantKeyStore,
         storage_scheme: MerchantStorageScheme,
     ) -> CustomResult<Customer, Self::Error>;
diff --git a/crates/hyperswitch_domain_models/src/merchant_connector_account.rs b/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
index 5c465937988..dcf5695135d 100644
--- a/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
+++ b/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
@@ -1,8 +1,6 @@
 #[cfg(feature = "v2")]
 use std::collections::HashMap;
 
-#[cfg(feature = "v2")]
-use common_utils::transformers::ForeignTryFrom;
 use common_utils::{
     crypto::Encryptable,
     date_time,
@@ -26,7 +24,7 @@ use serde_json::Value;
 
 use super::behaviour;
 #[cfg(feature = "v2")]
-use crate::errors::{self, api_error_response};
+use crate::errors::api_error_response;
 use crate::{
     mandates::CommonMandateReference,
     router_data,
diff --git a/crates/hyperswitch_domain_models/src/network_tokenization.rs b/crates/hyperswitch_domain_models/src/network_tokenization.rs
index 06773caa683..df567124932 100644
--- a/crates/hyperswitch_domain_models/src/network_tokenization.rs
+++ b/crates/hyperswitch_domain_models/src/network_tokenization.rs
@@ -1,7 +1,7 @@
 #[cfg(feature = "v1")]
 use cards::CardNumber;
 #[cfg(feature = "v2")]
-use cards::{CardNumber, NetworkToken};
+use cards::NetworkToken;
 
 #[cfg(feature = "v1")]
 pub type NetworkTokenNumber = CardNumber;
diff --git a/crates/hyperswitch_domain_models/src/payment_methods.rs b/crates/hyperswitch_domain_models/src/payment_methods.rs
index f73621b49a5..0f6d4d6f924 100644
--- a/crates/hyperswitch_domain_models/src/payment_methods.rs
+++ b/crates/hyperswitch_domain_models/src/payment_methods.rs
@@ -2,10 +2,11 @@
 use api_models::payment_methods::PaymentMethodsData;
 // specific imports because of using the macro
 use common_enums::enums::MerchantStorageScheme;
+#[cfg(feature = "v1")]
+use common_utils::crypto::OptionalEncryptableValue;
 #[cfg(feature = "v2")]
 use common_utils::{crypto::Encryptable, encryption::Encryption, types::keymanager::ToEncryptable};
 use common_utils::{
-    crypto::OptionalEncryptableValue,
     errors::{CustomResult, ParsingError, ValidationError},
     id_type, pii, type_name,
     types::keymanager,
@@ -24,12 +25,14 @@ use serde_json::Value;
 use time::PrimitiveDateTime;
 
 #[cfg(feature = "v2")]
-use crate::{address::Address, type_encryption::OptionalEncryptableJsonType};
+use crate::address::Address;
+#[cfg(feature = "v1")]
+use crate::{mandates, type_encryption::AsyncLift};
 use crate::{
-    mandates::{self, CommonMandateReference},
+    mandates::CommonMandateReference,
     merchant_key_store::MerchantKeyStore,
     payment_method_data as domain_payment_method_data,
-    type_encryption::{crypto_operation, AsyncLift, CryptoOperation},
+    type_encryption::{crypto_operation, CryptoOperation},
 };
 
 #[cfg(feature = "v2")]
@@ -477,7 +480,6 @@ impl super::behaviour::Conversion for PaymentMethod {
         Self: Sized,
     {
         use common_utils::ext_traits::ValueExt;
-        use masking::ExposeInterface;
 
         async {
             let decrypted_data = crypto_operation(
diff --git a/crates/hyperswitch_domain_models/src/payments.rs b/crates/hyperswitch_domain_models/src/payments.rs
index eb5c0a467c5..004098c8a1f 100644
--- a/crates/hyperswitch_domain_models/src/payments.rs
+++ b/crates/hyperswitch_domain_models/src/payments.rs
@@ -3,11 +3,10 @@ use std::marker::PhantomData;
 
 #[cfg(feature = "v2")]
 use api_models::payments::{MerchantConnectorDetails, SessionToken, VaultSessionDetails};
+#[cfg(feature = "v1")]
 use common_types::primitive_wrappers::{
     AlwaysRequestExtendedAuthorization, RequestExtendedAuthorizationBool,
 };
-#[cfg(feature = "v2")]
-use common_utils::ext_traits::OptionExt;
 use common_utils::{
     self,
     crypto::Encryptable,
@@ -21,8 +20,6 @@ use diesel_models::payment_intent::TaxDetails;
 #[cfg(feature = "v2")]
 use error_stack::ResultExt;
 use masking::Secret;
-#[cfg(feature = "v2")]
-use payment_intent::PaymentIntentUpdate;
 use router_derive::ToEncryption;
 use rustc_hash::FxHashMap;
 use serde_json::Value;
@@ -33,18 +30,15 @@ pub mod payment_intent;
 
 use common_enums as storage_enums;
 #[cfg(feature = "v2")]
-use diesel_models::{
-    ephemeral_key,
-    types::{FeatureMetadata, OrderDetailsWithAmount},
-};
+use diesel_models::types::{FeatureMetadata, OrderDetailsWithAmount};
 
 use self::payment_attempt::PaymentAttempt;
 #[cfg(feature = "v2")]
 use crate::{
-    address::Address, business_profile, customer, errors, merchant_account,
-    merchant_connector_account, merchant_connector_account::MerchantConnectorAccountTypeDetails,
-    merchant_context, payment_address, payment_method_data, payment_methods, revenue_recovery,
-    routing, ApiModelToDieselModelConvertor,
+    address::Address, business_profile, customer, errors, merchant_connector_account,
+    merchant_connector_account::MerchantConnectorAccountTypeDetails, merchant_context,
+    payment_address, payment_method_data, payment_methods, revenue_recovery, routing,
+    ApiModelToDieselModelConvertor,
 };
 #[cfg(feature = "v1")]
 use crate::{payment_method_data, RemoteStorageObject};
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
index 56e0942431c..3341ba0ee42 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
@@ -1,6 +1,7 @@
 #[cfg(all(feature = "v1", feature = "olap"))]
 use api_models::enums::Connector;
 use common_enums as storage_enums;
+#[cfg(feature = "v1")]
 use common_types::primitive_wrappers::{
     ExtendedAuthorizationAppliedBool, RequestExtendedAuthorizationBool,
 };
@@ -20,10 +21,12 @@ use common_utils::{
         ConnectorTransactionId, ConnectorTransactionIdTrait, CreatedBy, MinorUnit,
     },
 };
+#[cfg(feature = "v1")]
 use diesel_models::{
-    ConnectorMandateReferenceId, PaymentAttempt as DieselPaymentAttempt,
-    PaymentAttemptNew as DieselPaymentAttemptNew,
-    PaymentAttemptUpdate as DieselPaymentAttemptUpdate,
+    ConnectorMandateReferenceId, PaymentAttemptUpdate as DieselPaymentAttemptUpdate,
+};
+use diesel_models::{
+    PaymentAttempt as DieselPaymentAttempt, PaymentAttemptNew as DieselPaymentAttemptNew,
 };
 #[cfg(feature = "v2")]
 use diesel_models::{
@@ -36,7 +39,9 @@ use masking::PeekInterface;
 use masking::Secret;
 #[cfg(feature = "v2")]
 use rustc_hash::FxHashMap;
-use serde::{Deserialize, Serialize};
+#[cfg(feature = "v1")]
+use serde::Deserialize;
+use serde::Serialize;
 #[cfg(feature = "v2")]
 use serde_json::Value;
 use time::PrimitiveDateTime;
@@ -51,10 +56,11 @@ use crate::{
     router_response_types,
     type_encryption::{crypto_operation, CryptoOperation},
 };
+use crate::{behaviour, errors, ForeignIDRef};
+#[cfg(feature = "v1")]
 use crate::{
-    behaviour, errors,
     mandates::{MandateDataType, MandateDetails},
-    router_request_types, ForeignIDRef,
+    router_request_types,
 };
 
 #[async_trait::async_trait]
@@ -2410,7 +2416,7 @@ impl behaviour::Conversion for PaymentAttempt {
             connector_metadata,
             payment_experience,
             payment_method_data,
-            routing_result,
+            routing_result: _,
             preprocessing_step_id,
             multiple_capture_count,
             connector_response_reference_id,
@@ -2430,8 +2436,8 @@ impl behaviour::Conversion for PaymentAttempt {
             payment_method_type,
             connector_payment_id,
             payment_method_subtype,
-            authentication_applied,
-            external_reference_id,
+            authentication_applied: _,
+            external_reference_id: _,
             id,
             payment_method_id,
             payment_method_billing_address,
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
index 572c7d08442..67a6ef6a795 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
@@ -1,11 +1,11 @@
-#[cfg(feature = "v2")]
-use common_enums::RequestIncrementalAuthorization;
+#[cfg(feature = "v1")]
+use common_utils::consts::PAYMENTS_LIST_MAX_LIMIT_V2;
 #[cfg(feature = "v2")]
 use common_utils::errors::ParsingError;
 #[cfg(feature = "v2")]
 use common_utils::ext_traits::{Encode, ValueExt};
 use common_utils::{
-    consts::{PAYMENTS_LIST_MAX_LIMIT_V1, PAYMENTS_LIST_MAX_LIMIT_V2},
+    consts::PAYMENTS_LIST_MAX_LIMIT_V1,
     crypto::Encryptable,
     encryption::Encryption,
     errors::{CustomResult, ValidationError},
@@ -17,8 +17,6 @@ use common_utils::{
         CreatedBy, MinorUnit,
     },
 };
-#[cfg(feature = "v2")]
-use diesel_models::PaymentLinkConfigRequestForPayments;
 use diesel_models::{
     PaymentIntent as DieselPaymentIntent, PaymentIntentNew as DieselPaymentIntentNew,
 };
@@ -37,13 +35,12 @@ use crate::address::Address;
 #[cfg(feature = "v2")]
 use crate::routing;
 use crate::{
-    behaviour, errors,
+    behaviour,
     merchant_key_store::MerchantKeyStore,
     type_encryption::{crypto_operation, CryptoOperation},
-    RemoteStorageObject,
 };
-#[cfg(feature = "v2")]
-use crate::{FeatureMetadata, OrderDetailsWithAmount};
+#[cfg(feature = "v1")]
+use crate::{errors, RemoteStorageObject};
 
 #[async_trait::async_trait]
 pub trait PaymentIntentInterface {
@@ -721,7 +718,7 @@ impl TryFrom<PaymentIntentUpdate> for diesel_models::PaymentIntentUpdateInternal
 
                     updated_by,
                     force_3ds_challenge,
-                    is_iframe_redirection_enabled: None,
+                    is_iframe_redirection_enabled,
                 })
             }
             PaymentIntentUpdate::RecordUpdate {
diff --git a/crates/hyperswitch_domain_models/src/router_data.rs b/crates/hyperswitch_domain_models/src/router_data.rs
index 2f2ed98f1a2..360359036fa 100644
--- a/crates/hyperswitch_domain_models/src/router_data.rs
+++ b/crates/hyperswitch_domain_models/src/router_data.rs
@@ -505,7 +505,6 @@ impl
         storage_scheme: common_enums::MerchantStorageScheme,
     ) -> PaymentIntentUpdate {
         let amount_captured = self.get_captured_amount(payment_data);
-        let status = payment_data.payment_attempt.status.is_terminal_status();
         let updated_feature_metadata =
             payment_data
                 .payment_intent
@@ -567,12 +566,8 @@ impl
                 router_response_types::PaymentsResponseData::TransactionResponse {
                     resource_id,
                     redirection_data,
-                    mandate_reference,
                     connector_metadata,
-                    network_txn_id,
-                    connector_response_reference_id,
-                    incremental_authorization_allowed,
-                    charges,
+                    ..
                 } => {
                     let attempt_status = self.get_attempt_status_for_db_update(payment_data);
 
@@ -642,7 +637,7 @@ impl
                     message,
                     reason,
                     status_code: _,
-                    attempt_status,
+                    attempt_status: _,
                     connector_transaction_id,
                     network_decline_code,
                     network_advice_code,
@@ -801,16 +796,7 @@ impl
 
         match self.response {
             Ok(ref response_router_data) => match response_router_data {
-                router_response_types::PaymentsResponseData::TransactionResponse {
-                    resource_id,
-                    redirection_data,
-                    mandate_reference,
-                    connector_metadata,
-                    network_txn_id,
-                    connector_response_reference_id,
-                    incremental_authorization_allowed,
-                    charges,
-                } => {
+                router_response_types::PaymentsResponseData::TransactionResponse { .. } => {
                     let attempt_status = self.status;
 
                     PaymentAttemptUpdate::CaptureUpdate {
@@ -1035,16 +1021,7 @@ impl
 
         match self.response {
             Ok(ref response_router_data) => match response_router_data {
-                router_response_types::PaymentsResponseData::TransactionResponse {
-                    resource_id,
-                    redirection_data,
-                    mandate_reference,
-                    connector_metadata,
-                    network_txn_id,
-                    connector_response_reference_id,
-                    incremental_authorization_allowed,
-                    charges,
-                } => {
+                router_response_types::PaymentsResponseData::TransactionResponse { .. } => {
                     let attempt_status = self.get_attempt_status_for_db_update(payment_data);
 
                     PaymentAttemptUpdate::SyncUpdate {
@@ -1092,7 +1069,7 @@ impl
                     message,
                     reason,
                     status_code: _,
-                    attempt_status,
+                    attempt_status: _,
                     connector_transaction_id,
                     network_advice_code,
                     network_decline_code,
@@ -1275,12 +1252,8 @@ impl
                 router_response_types::PaymentsResponseData::TransactionResponse {
                     resource_id,
                     redirection_data,
-                    mandate_reference,
                     connector_metadata,
-                    network_txn_id,
-                    connector_response_reference_id,
-                    incremental_authorization_allowed,
-                    charges,
+                    ..
                 } => {
                     let attempt_status = self.get_attempt_status_for_db_update(payment_data);
 
diff --git a/crates/hyperswitch_domain_models/src/router_request_types.rs b/crates/hyperswitch_domain_models/src/router_request_types.rs
index 8dfda368367..06932fb1265 100644
--- a/crates/hyperswitch_domain_models/src/router_request_types.rs
+++ b/crates/hyperswitch_domain_models/src/router_request_types.rs
@@ -662,7 +662,7 @@ impl
     )> for SurchargeDetails
 {
     fn from(
-        (request_surcharge_details, payment_attempt): (
+        (_request_surcharge_details, _payment_attempt): (
             &RequestSurchargeDetails,
             &payments::payment_attempt::PaymentAttempt,
         ),
diff --git a/crates/hyperswitch_domain_models/src/tokenization.rs b/crates/hyperswitch_domain_models/src/tokenization.rs
index 4bbdaa2fb41..918e647b6c2 100644
--- a/crates/hyperswitch_domain_models/src/tokenization.rs
+++ b/crates/hyperswitch_domain_models/src/tokenization.rs
@@ -2,16 +2,12 @@ use common_enums;
 use common_utils::{
     self,
     errors::{CustomResult, ValidationError},
-    id_type, pii,
-    types::{keymanager, MinorUnit},
+    types::keymanager,
 };
-use diesel_models::tokenization;
-use masking::{ExposeInterface, Secret};
+use masking::Secret;
 use serde::{Deserialize, Serialize};
 use time::PrimitiveDateTime;
 
-use crate::{merchant_key_store::MerchantKeyStore, types};
-
 #[cfg(all(feature = "v2", feature = "tokenization_v2"))]
 #[derive(Clone, Debug, Serialize, Deserialize)]
 pub struct Tokenization {
diff --git a/crates/kgraph_utils/src/mca.rs b/crates/kgraph_utils/src/mca.rs
index 2a2b2e5ae75..bd610feb430 100644
--- a/crates/kgraph_utils/src/mca.rs
+++ b/crates/kgraph_utils/src/mca.rs
@@ -1,9 +1,9 @@
+#[cfg(feature = "v1")]
 use std::str::FromStr;
 
-use api_models::{
-    admin as admin_api, enums as api_enums, payment_methods::RequestPaymentMethodTypes,
-    refunds::MinorUnit,
-};
+#[cfg(feature = "v1")]
+use api_models::payment_methods::RequestPaymentMethodTypes;
+use api_models::{admin as admin_api, enums as api_enums, refunds::MinorUnit};
 use euclid::{
     dirval,
     frontend::{ast, dir},
diff --git a/crates/payment_methods/src/configs/payment_connector_required_fields.rs b/crates/payment_methods/src/configs/payment_connector_required_fields.rs
index 8b2829a6f7a..4788c638c87 100644
--- a/crates/payment_methods/src/configs/payment_connector_required_fields.rs
+++ b/crates/payment_methods/src/configs/payment_connector_required_fields.rs
@@ -6,10 +6,11 @@ use api_models::{
 };
 
 use crate::configs::settings::{
-    ConnectorFields, Mandates, PaymentMethodType, RequiredFieldFinal, RequiredFields,
-    SupportedConnectorsForMandate, SupportedPaymentMethodTypesForMandate,
-    SupportedPaymentMethodsForMandate, ZeroMandates,
+    ConnectorFields, Mandates, RequiredFieldFinal, SupportedConnectorsForMandate,
+    SupportedPaymentMethodTypesForMandate, SupportedPaymentMethodsForMandate, ZeroMandates,
 };
+#[cfg(feature = "v1")]
+use crate::configs::settings::{PaymentMethodType, RequiredFields};
 
 impl Default for ZeroMandates {
     fn default() -> Self {
@@ -125,6 +126,7 @@ impl Default for Mandates {
 }
 
 #[derive(Clone, serde::Serialize)]
+#[cfg_attr(feature = "v2", allow(dead_code))] // multiple variants are never constructed for v2
 enum RequiredField {
     CardNumber,
     CardExpMonth,
@@ -859,6 +861,7 @@ impl RequiredField {
 }
 
 // Define helper functions for common field groups
+#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
 fn card_basic() -> Vec<RequiredField> {
     vec![
         RequiredField::CardNumber,
@@ -868,6 +871,7 @@ fn card_basic() -> Vec<RequiredField> {
     ]
 }
 
+#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
 fn full_name() -> Vec<RequiredField> {
     vec![
         RequiredField::BillingUserFirstName,
@@ -875,6 +879,7 @@ fn full_name() -> Vec<RequiredField> {
     ]
 }
 
+#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
 fn billing_name() -> Vec<RequiredField> {
     vec![
         RequiredField::BillingFirstName("billing_first_name", FieldType::UserBillingName),
@@ -882,18 +887,22 @@ fn billing_name() -> Vec<RequiredField> {
     ]
 }
 
+#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
 fn email() -> Vec<RequiredField> {
     [RequiredField::Email].to_vec()
 }
 
+#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
 fn billing_email() -> Vec<RequiredField> {
     [RequiredField::BillingEmail].to_vec()
 }
 
+#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
 fn card_with_name() -> Vec<RequiredField> {
     [card_basic(), full_name()].concat()
 }
 
+#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
 fn billing_email_name() -> Vec<RequiredField> {
     vec![
         RequiredField::BillingEmail,
@@ -902,6 +911,7 @@ fn billing_email_name() -> Vec<RequiredField> {
     ]
 }
 
+#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
 fn billing_email_name_phone() -> Vec<RequiredField> {
     vec![
         RequiredField::BillingUserFirstName,
@@ -912,6 +922,7 @@ fn billing_email_name_phone() -> Vec<RequiredField> {
     ]
 }
 
+#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
 fn billing_address() -> Vec<RequiredField> {
     vec![
         RequiredField::BillingAddressCity,
@@ -940,6 +951,7 @@ fn fields(
     }
 }
 
+#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
 fn connectors(connectors: Vec<(Connector, RequiredFieldFinal)>) -> ConnectorFields {
     ConnectorFields {
         fields: connectors.into_iter().collect(),
diff --git a/crates/payment_methods/src/controller.rs b/crates/payment_methods/src/controller.rs
index f93d5569324..bd5a9f316ef 100644
--- a/crates/payment_methods/src/controller.rs
+++ b/crates/payment_methods/src/controller.rs
@@ -3,6 +3,7 @@ use std::fmt::Debug;
 #[cfg(feature = "payouts")]
 use api_models::payouts;
 use api_models::{enums as api_enums, payment_methods as api};
+#[cfg(feature = "v1")]
 use common_enums::enums as common_enums;
 #[cfg(feature = "v2")]
 use common_utils::encryption;
@@ -10,6 +11,7 @@ use common_utils::{crypto, ext_traits, id_type, type_name, types::keymanager};
 use error_stack::ResultExt;
 use hyperswitch_domain_models::{merchant_key_store, payment_methods, type_encryption};
 use masking::{PeekInterface, Secret};
+#[cfg(feature = "v1")]
 use scheduler::errors as sch_errors;
 use serde::{Deserialize, Serialize};
 use storage_impl::{errors as storage_errors, payment_method};
@@ -148,10 +150,10 @@ pub trait PaymentMethodsController {
     #[cfg(feature = "v2")]
     async fn get_or_insert_payment_method(
         &self,
-        req: api::PaymentMethodCreate,
-        resp: &mut api::PaymentMethodResponse,
-        customer_id: &id_type::CustomerId,
-        key_store: &merchant_key_store::MerchantKeyStore,
+        _req: api::PaymentMethodCreate,
+        _resp: &mut api::PaymentMethodResponse,
+        _customer_id: &id_type::CustomerId,
+        _key_store: &merchant_key_store::MerchantKeyStore,
     ) -> errors::PmResult<payment_methods::PaymentMethod> {
         todo!()
     }
diff --git a/crates/payment_methods/src/core/migration.rs b/crates/payment_methods/src/core/migration.rs
index 069a2c460c0..8b2694cf6fe 100644
--- a/crates/payment_methods/src/core/migration.rs
+++ b/crates/payment_methods/src/core/migration.rs
@@ -2,15 +2,19 @@ use actix_multipart::form::{self, bytes, text};
 use api_models::payment_methods as pm_api;
 use csv::Reader;
 use error_stack::ResultExt;
+#[cfg(feature = "v1")]
 use hyperswitch_domain_models::{api, merchant_context};
 use masking::PeekInterface;
 use rdkafka::message::ToBytes;
 use router_env::{instrument, tracing};
 
-use crate::{controller as pm, core::errors, state};
+use crate::core::errors;
+#[cfg(feature = "v1")]
+use crate::{controller as pm, state};
 pub mod payment_methods;
 pub use payment_methods::migrate_payment_method;
 
+#[cfg(feature = "v1")]
 type PmMigrationResult<T> =
     errors::CustomResult<api::ApplicationResponse<T>, errors::ApiErrorResponse>;
 
diff --git a/crates/payment_methods/src/core/migration/payment_methods.rs b/crates/payment_methods/src/core/migration/payment_methods.rs
index d8dc1abdd09..10808f08a25 100644
--- a/crates/payment_methods/src/core/migration/payment_methods.rs
+++ b/crates/payment_methods/src/core/migration/payment_methods.rs
@@ -2,30 +2,39 @@ use std::str::FromStr;
 
 #[cfg(feature = "v2")]
 use api_models::enums as api_enums;
-use api_models::{enums, payment_methods as pm_api};
+#[cfg(feature = "v1")]
+use api_models::enums;
+use api_models::payment_methods as pm_api;
+#[cfg(feature = "v1")]
 use common_utils::{
     consts,
     crypto::Encryptable,
-    errors::CustomResult,
     ext_traits::{AsyncExt, ConfigExt},
-    generate_id, id_type,
+    generate_id,
 };
+use common_utils::{errors::CustomResult, id_type};
 use error_stack::ResultExt;
 use hyperswitch_domain_models::{
-    api::ApplicationResponse, errors::api_error_response as errors, ext_traits::OptionExt,
-    merchant_context, payment_methods as domain_pm,
+    api::ApplicationResponse, errors::api_error_response as errors, merchant_context,
 };
-use masking::{PeekInterface, Secret};
+#[cfg(feature = "v1")]
+use hyperswitch_domain_models::{ext_traits::OptionExt, payment_methods as domain_pm};
+use masking::PeekInterface;
+#[cfg(feature = "v1")]
+use masking::Secret;
+#[cfg(feature = "v1")]
 use router_env::{instrument, logger, tracing};
+#[cfg(feature = "v1")]
 use serde_json::json;
 use storage_impl::cards_info;
 
+#[cfg(feature = "v1")]
 use crate::{
-    controller::{create_encrypted_data, PaymentMethodsController},
+    controller::create_encrypted_data,
     core::migration,
-    helpers::{ForeignFrom, ForeignTryFrom, StorageErrorExt},
-    state,
+    helpers::{ForeignFrom, StorageErrorExt},
 };
+use crate::{controller::PaymentMethodsController, helpers::ForeignTryFrom, state};
 
 #[cfg(feature = "v1")]
 pub async fn migrate_payment_method(
@@ -156,8 +165,8 @@ pub async fn migrate_payment_method(
     _state: &state::PaymentMethodsState,
     _req: pm_api::PaymentMethodMigrate,
     _merchant_id: &id_type::MerchantId,
-    merchant_context: &merchant_context::MerchantContext,
-    controller: &dyn PaymentMethodsController,
+    _merchant_context: &merchant_context::MerchantContext,
+    _controller: &dyn PaymentMethodsController,
 ) -> CustomResult<ApplicationResponse<pm_api::PaymentMethodMigrateResponse>, errors::ApiErrorResponse>
 {
     todo!()
diff --git a/crates/payment_methods/src/helpers.rs b/crates/payment_methods/src/helpers.rs
index 9dd93aa3c91..0ed24883e7e 100644
--- a/crates/payment_methods/src/helpers.rs
+++ b/crates/payment_methods/src/helpers.rs
@@ -1,6 +1,8 @@
 use api_models::{enums as api_enums, payment_methods as api};
+#[cfg(feature = "v1")]
 use common_utils::ext_traits::AsyncExt;
 pub use hyperswitch_domain_models::{errors::api_error_response, payment_methods as domain};
+#[cfg(feature = "v1")]
 use router_env::logger;
 
 use crate::state;
@@ -277,7 +279,7 @@ impl ForeignFrom<(Option<api::CardDetailFromLocker>, domain::PaymentMethod)>
     for api::PaymentMethodResponse
 {
     fn foreign_from(
-        (card_details, item): (Option<api::CardDetailFromLocker>, domain::PaymentMethod),
+        (_card_details, _item): (Option<api::CardDetailFromLocker>, domain::PaymentMethod),
     ) -> Self {
         todo!()
     }
diff --git a/crates/payment_methods/src/state.rs b/crates/payment_methods/src/state.rs
index 9782a328180..225b04a09ad 100644
--- a/crates/payment_methods/src/state.rs
+++ b/crates/payment_methods/src/state.rs
@@ -1,8 +1,10 @@
 #[cfg(feature = "v1")]
 use common_utils::errors::CustomResult;
 use common_utils::types::keymanager;
+#[cfg(feature = "v1")]
+use hyperswitch_domain_models::merchant_account;
 use hyperswitch_domain_models::{
-    cards_info, customer, merchant_account, merchant_key_store, payment_methods as pm_domain,
+    cards_info, customer, merchant_key_store, payment_methods as pm_domain,
 };
 use storage_impl::{errors, kv_router_store::KVRouterStore, DatabaseStore, MockDb, RouterStore};
 
diff --git a/crates/router/src/core/customers.rs b/crates/router/src/core/customers.rs
index 4b4c35dac2a..2cad1d91eb8 100644
--- a/crates/router/src/core/customers.rs
+++ b/crates/router/src/core/customers.rs
@@ -547,7 +547,6 @@ pub async fn retrieve_customer(
         .find_customer_by_global_id(
             key_manager_state,
             &id,
-            merchant_context.get_merchant_account().get_id(),
             merchant_context.get_merchant_key_store(),
             merchant_context.get_merchant_account().storage_scheme,
         )
@@ -633,7 +632,6 @@ impl CustomerDeleteBridge for id_type::GlobalCustomerId {
             .find_customer_by_global_id(
                 key_manager_state,
                 self,
-                merchant_context.get_merchant_account().get_id(),
                 merchant_context.get_merchant_key_store(),
                 merchant_context.get_merchant_account().storage_scheme,
             )
@@ -745,7 +743,6 @@ impl CustomerDeleteBridge for id_type::GlobalCustomerId {
             key_manager_state,
             self,
             customer_orig,
-            merchant_context.get_merchant_account().get_id(),
             updated_customer,
             merchant_context.get_merchant_key_store(),
             merchant_context.get_merchant_account().storage_scheme,
@@ -1220,7 +1217,6 @@ impl VerifyIdForUpdateCustomer<'_> {
             .find_customer_by_global_id(
                 self.key_manager_state,
                 self.id,
-                self.merchant_account.get_id(),
                 self.key_store,
                 self.merchant_account.storage_scheme,
             )
@@ -1418,7 +1414,6 @@ impl CustomerUpdateBridge for customers::CustomerUpdateRequest {
                 key_manager_state,
                 &domain_customer.id,
                 domain_customer.to_owned(),
-                merchant_context.get_merchant_account().get_id(),
                 storage::CustomerUpdate::Update(Box::new(storage::CustomerGeneralUpdate {
                     name: encryptable_customer.name,
                     email: Box::new(encryptable_customer.email.map(|email| {
diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rs
index c851b4842e5..59be79c66f6 100644
--- a/crates/router/src/core/payment_methods.rs
+++ b/crates/router/src/core/payment_methods.rs
@@ -913,7 +913,6 @@ pub async fn create_payment_method_core(
     db.find_customer_by_global_id(
         key_manager_state,
         &customer_id,
-        merchant_context.get_merchant_account().get_id(),
         merchant_context.get_merchant_key_store(),
         merchant_context.get_merchant_account().storage_scheme,
     )
@@ -1257,7 +1256,6 @@ pub async fn payment_method_intent_create(
     db.find_customer_by_global_id(
         key_manager_state,
         &customer_id,
-        merchant_context.get_merchant_account().get_id(),
         merchant_context.get_merchant_key_store(),
         merchant_context.get_merchant_account().storage_scheme,
     )
@@ -2473,7 +2471,6 @@ pub async fn delete_payment_method_core(
         .find_customer_by_global_id(
             key_manager_state,
             &payment_method.customer_id,
-            merchant_context.get_merchant_account().get_id(),
             merchant_context.get_merchant_key_store(),
             merchant_context.get_merchant_account().storage_scheme,
         )
@@ -2630,7 +2627,6 @@ pub async fn payment_methods_session_create(
     db.find_customer_by_global_id(
         key_manager_state,
         &request.customer_id,
-        merchant_context.get_merchant_account().get_id(),
         merchant_context.get_merchant_key_store(),
         merchant_context.get_merchant_account().storage_scheme,
     )
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index 9f6e317531a..5b7c8041ce4 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -3170,7 +3170,6 @@ pub async fn make_client_secret(
             db.find_customer_by_global_id(
                 key_manager_state,
                 global_customer_id,
-                merchant_context.get_merchant_account().get_id(),
                 merchant_context.get_merchant_key_store(),
                 merchant_context.get_merchant_account().storage_scheme,
             )
diff --git a/crates/router/src/core/payments/operations/payment_capture_v2.rs b/crates/router/src/core/payments/operations/payment_capture_v2.rs
index d644ea52357..1b46cb85d4a 100644
--- a/crates/router/src/core/payments/operations/payment_capture_v2.rs
+++ b/crates/router/src/core/payments/operations/payment_capture_v2.rs
@@ -226,7 +226,6 @@ impl<F: Clone + Send> Domain<F, PaymentsCaptureRequest, PaymentCaptureData<F>> f
                     .find_customer_by_global_id(
                         &state.into(),
                         &id,
-                        &payment_data.payment_intent.merchant_id,
                         merchant_key_store,
                         storage_scheme,
                     )
diff --git a/crates/router/src/core/payments/operations/payment_confirm_intent.rs b/crates/router/src/core/payments/operations/payment_confirm_intent.rs
index 4f58107fa9c..dce33895fde 100644
--- a/crates/router/src/core/payments/operations/payment_confirm_intent.rs
+++ b/crates/router/src/core/payments/operations/payment_confirm_intent.rs
@@ -299,7 +299,6 @@ impl<F: Clone + Send + Sync> Domain<F, PaymentsConfirmIntentRequest, PaymentConf
                     .find_customer_by_global_id(
                         &state.into(),
                         &id,
-                        &payment_data.payment_intent.merchant_id,
                         merchant_key_store,
                         storage_scheme,
                     )
@@ -653,7 +652,6 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentConfirmData<F>, PaymentsConfirmInt
                     key_manager_state,
                     &customer_id,
                     customer,
-                    &customer_merchant_id,
                     updated_customer,
                     key_store,
                     storage_scheme,
diff --git a/crates/router/src/core/payments/operations/payment_create_intent.rs b/crates/router/src/core/payments/operations/payment_create_intent.rs
index 10076585a98..0f1704938c4 100644
--- a/crates/router/src/core/payments/operations/payment_create_intent.rs
+++ b/crates/router/src/core/payments/operations/payment_create_intent.rs
@@ -253,13 +253,7 @@ impl<F: Clone + Send + Sync> Domain<F, PaymentsCreateIntentRequest, payments::Pa
         if let Some(id) = payment_data.payment_intent.customer_id.clone() {
             state
                 .store
-                .find_customer_by_global_id(
-                    &state.into(),
-                    &id,
-                    &payment_data.payment_intent.merchant_id,
-                    merchant_key_store,
-                    storage_scheme,
-                )
+                .find_customer_by_global_id(&state.into(), &id, merchant_key_store, storage_scheme)
                 .await?;
         }
         Ok((Box::new(self), None))
diff --git a/crates/router/src/core/payments/operations/payment_get.rs b/crates/router/src/core/payments/operations/payment_get.rs
index 63f64fb233a..402c11e2f86 100644
--- a/crates/router/src/core/payments/operations/payment_get.rs
+++ b/crates/router/src/core/payments/operations/payment_get.rs
@@ -271,7 +271,6 @@ impl<F: Clone + Send + Sync> Domain<F, PaymentsRetrieveRequest, PaymentStatusDat
                     .find_customer_by_global_id(
                         &state.into(),
                         &id,
-                        &payment_data.payment_intent.merchant_id,
                         merchant_key_store,
                         storage_scheme,
                     )
diff --git a/crates/router/src/core/payments/operations/payment_session_intent.rs b/crates/router/src/core/payments/operations/payment_session_intent.rs
index 8f167a43112..8ae5d2cd19d 100644
--- a/crates/router/src/core/payments/operations/payment_session_intent.rs
+++ b/crates/router/src/core/payments/operations/payment_session_intent.rs
@@ -244,7 +244,6 @@ impl<F: Clone + Send + Sync> Domain<F, PaymentsSessionRequest, payments::Payment
                     .find_customer_by_global_id(
                         &state.into(),
                         &id,
-                        &payment_data.payment_intent.merchant_id,
                         merchant_key_store,
                         storage_scheme,
                     )
diff --git a/crates/router/src/core/payments/vault_session.rs b/crates/router/src/core/payments/vault_session.rs
index 51a2badfe2a..db77d6a9997 100644
--- a/crates/router/src/core/payments/vault_session.rs
+++ b/crates/router/src/core/payments/vault_session.rs
@@ -105,7 +105,6 @@ where
                     &state.into(),
                     &customer_id,
                     customer,
-                    &customer_merchant_id,
                     updated_customer,
                     merchant_context.get_merchant_key_store(),
                     merchant_context.get_merchant_account().storage_scheme,
diff --git a/crates/router/src/core/payouts.rs b/crates/router/src/core/payouts.rs
index 64c5ced78bc..cbb9957115b 100644
--- a/crates/router/src/core/payouts.rs
+++ b/crates/router/src/core/payouts.rs
@@ -1245,7 +1245,6 @@ pub async fn create_recipient(
                                     &state.into(),
                                     &customer_id,
                                     customer,
-                                    merchant_account.get_id(),
                                     updated_customer,
                                     key_store,
                                     merchant_account.storage_scheme,
diff --git a/crates/router/src/db/kafka_store.rs b/crates/router/src/db/kafka_store.rs
index 1d20c7b27c1..7eef89c34e6 100644
--- a/crates/router/src/db/kafka_store.rs
+++ b/crates/router/src/db/kafka_store.rs
@@ -474,7 +474,6 @@ impl CustomerInterface for KafkaStore {
         state: &KeyManagerState,
         id: &id_type::GlobalCustomerId,
         customer: domain::Customer,
-        merchant_id: &id_type::MerchantId,
         customer_update: storage::CustomerUpdate,
         key_store: &domain::MerchantKeyStore,
         storage_scheme: MerchantStorageScheme,
@@ -484,7 +483,6 @@ impl CustomerInterface for KafkaStore {
                 state,
                 id,
                 customer,
-                merchant_id,
                 customer_update,
                 key_store,
                 storage_scheme,
@@ -549,12 +547,11 @@ impl CustomerInterface for KafkaStore {
         &self,
         state: &KeyManagerState,
         id: &id_type::GlobalCustomerId,
-        merchant_id: &id_type::MerchantId,
         key_store: &domain::MerchantKeyStore,
         storage_scheme: MerchantStorageScheme,
     ) -> CustomResult<domain::Customer, errors::StorageError> {
         self.diesel_store
-            .find_customer_by_global_id(state, id, merchant_id, key_store, storage_scheme)
+            .find_customer_by_global_id(state, id, key_store, storage_scheme)
             .await
     }
 
diff --git a/crates/storage_impl/src/customers.rs b/crates/storage_impl/src/customers.rs
index 8df20a298e2..bedbcadd6a8 100644
--- a/crates/storage_impl/src/customers.rs
+++ b/crates/storage_impl/src/customers.rs
@@ -10,8 +10,9 @@ use hyperswitch_domain_models::{
 use masking::PeekInterface;
 use router_env::{instrument, tracing};
 
+#[cfg(feature = "v1")]
+use crate::diesel_error_to_data_error;
 use crate::{
-    diesel_error_to_data_error,
     errors::StorageError,
     kv_router_store,
     redis::kv_store::{decide_storage_scheme, KvStorePartition, Op, PartitionKey},
@@ -368,7 +369,6 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
         &self,
         state: &KeyManagerState,
         id: &id_type::GlobalCustomerId,
-        _merchant_id: &id_type::MerchantId,
         key_store: &MerchantKeyStore,
         storage_scheme: MerchantStorageScheme,
     ) -> CustomResult<domain::Customer, StorageError> {
@@ -402,7 +402,6 @@ impl<T: DatabaseStore> domain::CustomerInterface for kv_router_store::KVRouterSt
         state: &KeyManagerState,
         id: &id_type::GlobalCustomerId,
         customer: domain::Customer,
-        _merchant_id: &id_type::MerchantId,
         customer_update: domain::CustomerUpdate,
         key_store: &MerchantKeyStore,
         storage_scheme: MerchantStorageScheme,
@@ -670,11 +669,10 @@ impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
         &self,
         state: &KeyManagerState,
         id: &id_type::GlobalCustomerId,
-        customer: domain::Customer,
-        merchant_id: &id_type::MerchantId,
+        _customer: domain::Customer,
         customer_update: domain::CustomerUpdate,
         key_store: &MerchantKeyStore,
-        storage_scheme: MerchantStorageScheme,
+        _storage_scheme: MerchantStorageScheme,
     ) -> CustomResult<domain::Customer, StorageError> {
         let conn = pg_connection_write(self).await?;
         self.call_database(
@@ -691,7 +689,6 @@ impl<T: DatabaseStore> domain::CustomerInterface for RouterStore<T> {
         &self,
         state: &KeyManagerState,
         id: &id_type::GlobalCustomerId,
-        merchant_id: &id_type::MerchantId,
         key_store: &MerchantKeyStore,
         _storage_scheme: MerchantStorageScheme,
     ) -> CustomResult<domain::Customer, StorageError> {
@@ -748,10 +745,10 @@ impl domain::CustomerInterface for MockDb {
     #[cfg(feature = "v2")]
     async fn find_optional_by_merchant_id_merchant_reference_id(
         &self,
-        state: &KeyManagerState,
-        customer_id: &id_type::CustomerId,
-        merchant_id: &id_type::MerchantId,
-        key_store: &MerchantKeyStore,
+        _state: &KeyManagerState,
+        _customer_id: &id_type::CustomerId,
+        _merchant_id: &id_type::MerchantId,
+        _key_store: &MerchantKeyStore,
         _storage_scheme: MerchantStorageScheme,
     ) -> CustomResult<Option<domain::Customer>, StorageError> {
         todo!()
@@ -874,7 +871,6 @@ impl domain::CustomerInterface for MockDb {
         _state: &KeyManagerState,
         _id: &id_type::GlobalCustomerId,
         _customer: domain::Customer,
-        _merchant_id: &id_type::MerchantId,
         _customer_update: domain::CustomerUpdate,
         _key_store: &MerchantKeyStore,
         _storage_scheme: MerchantStorageScheme,
@@ -888,7 +884,6 @@ impl domain::CustomerInterface for MockDb {
         &self,
         _state: &KeyManagerState,
         _id: &id_type::GlobalCustomerId,
-        _merchant_id: &id_type::MerchantId,
         _key_store: &MerchantKeyStore,
         _storage_scheme: MerchantStorageScheme,
     ) -> CustomResult<domain::Customer, StorageError> {
diff --git a/crates/storage_impl/src/lib.rs b/crates/storage_impl/src/lib.rs
index 27b59052051..56df356547e 100644
--- a/crates/storage_impl/src/lib.rs
+++ b/crates/storage_impl/src/lib.rs
@@ -32,8 +32,6 @@ pub mod utils;
 
 use common_utils::{errors::CustomResult, types::keymanager::KeyManagerState};
 use database::store::PgPool;
-#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
-use diesel_models::tokenization::Tokenization;
 pub mod tokenization;
 #[cfg(not(feature = "payouts"))]
 use hyperswitch_domain_models::{PayoutAttemptInterface, PayoutsInterface};
diff --git a/crates/storage_impl/src/mock_db/payment_intent.rs b/crates/storage_impl/src/mock_db/payment_intent.rs
index cbdf2b3b0c6..427f69d8958 100644
--- a/crates/storage_impl/src/mock_db/payment_intent.rs
+++ b/crates/storage_impl/src/mock_db/payment_intent.rs
@@ -1,8 +1,10 @@
 use common_utils::{errors::CustomResult, types::keymanager::KeyManagerState};
 use diesel_models::enums as storage_enums;
+#[cfg(feature = "v1")]
 use error_stack::ResultExt;
+#[cfg(feature = "v1")]
+use hyperswitch_domain_models::behaviour::Conversion;
 use hyperswitch_domain_models::{
-    behaviour::Conversion,
     merchant_key_store::MerchantKeyStore,
     payments::{
         payment_intent::{PaymentIntentInterface, PaymentIntentUpdate},
@@ -32,11 +34,11 @@ impl PaymentIntentInterface for MockDb {
     #[cfg(all(feature = "v2", feature = "olap"))]
     async fn get_filtered_payment_intents_attempt(
         &self,
-        state: &KeyManagerState,
-        merchant_id: &common_utils::id_type::MerchantId,
-        constraints: &hyperswitch_domain_models::payments::payment_intent::PaymentIntentFetchConstraints,
-        merchant_key_store: &MerchantKeyStore,
-        storage_scheme: storage_enums::MerchantStorageScheme,
+        _state: &KeyManagerState,
+        _merchant_id: &common_utils::id_type::MerchantId,
+        _constraints: &hyperswitch_domain_models::payments::payment_intent::PaymentIntentFetchConstraints,
+        _merchant_key_store: &MerchantKeyStore,
+        _storage_scheme: storage_enums::MerchantStorageScheme,
     ) -> error_stack::Result<
         Vec<(
             PaymentIntent,
@@ -166,10 +168,10 @@ impl PaymentIntentInterface for MockDb {
     #[allow(clippy::unwrap_used)]
     async fn update_payment_intent(
         &self,
-        state: &KeyManagerState,
-        this: PaymentIntent,
-        update: PaymentIntentUpdate,
-        key_store: &MerchantKeyStore,
+        _state: &KeyManagerState,
+        _this: PaymentIntent,
+        _update: PaymentIntentUpdate,
+        _key_store: &MerchantKeyStore,
         _storage_scheme: storage_enums::MerchantStorageScheme,
     ) -> CustomResult<PaymentIntent, StorageError> {
         todo!()
diff --git a/crates/storage_impl/src/payment_method.rs b/crates/storage_impl/src/payment_method.rs
index 020adf6a279..74be922c7f5 100644
--- a/crates/storage_impl/src/payment_method.rs
+++ b/crates/storage_impl/src/payment_method.rs
@@ -6,13 +6,14 @@ impl KvStorePartition for PaymentMethod {}
 
 use common_enums::enums::MerchantStorageScheme;
 use common_utils::{errors::CustomResult, id_type, types::keymanager::KeyManagerState};
-use diesel_models::{
-    kv,
-    payment_method::{PaymentMethodUpdate, PaymentMethodUpdateInternal},
-};
+#[cfg(feature = "v1")]
+use diesel_models::kv;
+use diesel_models::payment_method::{PaymentMethodUpdate, PaymentMethodUpdateInternal};
 use error_stack::ResultExt;
+#[cfg(feature = "v1")]
+use hyperswitch_domain_models::behaviour::ReverseConversion;
 use hyperswitch_domain_models::{
-    behaviour::{Conversion, ReverseConversion},
+    behaviour::Conversion,
     merchant_key_store::MerchantKeyStore,
     payment_methods::{PaymentMethod as DomainPaymentMethod, PaymentMethodInterface},
 };
@@ -21,14 +22,15 @@ use router_env::{instrument, tracing};
 use super::MockDb;
 use crate::{
     diesel_error_to_data_error, errors,
-    kv_router_store::{
-        FilterResourceParams, FindResourceBy, InsertResourceParams, KVRouterStore,
-        UpdateResourceParams,
-    },
-    redis::kv_store::{Op, PartitionKey},
+    kv_router_store::{FindResourceBy, KVRouterStore},
     utils::{pg_connection_read, pg_connection_write},
     DatabaseStore, RouterStore,
 };
+#[cfg(feature = "v1")]
+use crate::{
+    kv_router_store::{FilterResourceParams, InsertResourceParams, UpdateResourceParams},
+    redis::kv_store::{Op, PartitionKey},
+};
 
 #[async_trait::async_trait]
 impl<T: DatabaseStore> PaymentMethodInterface for KVRouterStore<T> {
@@ -389,7 +391,6 @@ impl<T: DatabaseStore> PaymentMethodInterface for KVRouterStore<T> {
         key_store: &MerchantKeyStore,
         fingerprint_id: &str,
     ) -> CustomResult<DomainPaymentMethod, errors::StorageError> {
-        let conn = pg_connection_read(self).await?;
         self.router_store
             .find_payment_method_by_fingerprint_id(state, key_store, fingerprint_id)
             .await
@@ -538,7 +539,7 @@ impl<T: DatabaseStore> PaymentMethodInterface for RouterStore<T> {
         key_store: &MerchantKeyStore,
         payment_method: DomainPaymentMethod,
         payment_method_update: PaymentMethodUpdate,
-        storage_scheme: MerchantStorageScheme,
+        _storage_scheme: MerchantStorageScheme,
     ) -> CustomResult<DomainPaymentMethod, errors::StorageError> {
         let payment_method = Conversion::convert(payment_method)
             .await
@@ -837,8 +838,8 @@ impl PaymentMethodInterface for MockDb {
     #[cfg(feature = "v2")]
     async fn find_payment_method_list_by_global_customer_id(
         &self,
-        state: &KeyManagerState,
-        key_store: &MerchantKeyStore,
+        _state: &KeyManagerState,
+        _key_store: &MerchantKeyStore,
         _id: &id_type::GlobalCustomerId,
         _limit: Option<i64>,
     ) -> CustomResult<Vec<DomainPaymentMethod>, errors::StorageError> {
diff --git a/crates/storage_impl/src/payments/payment_attempt.rs b/crates/storage_impl/src/payments/payment_attempt.rs
index db3400c5fa4..69de633aee0 100644
--- a/crates/storage_impl/src/payments/payment_attempt.rs
+++ b/crates/storage_impl/src/payments/payment_attempt.rs
@@ -1,7 +1,8 @@
+use common_utils::errors::CustomResult;
 #[cfg(feature = "v2")]
 use common_utils::types::keymanager::KeyManagerState;
+#[cfg(feature = "v1")]
 use common_utils::{
-    errors::CustomResult,
     fallback_reverse_lookup_not_found,
     types::{ConnectorTransactionId, ConnectorTransactionIdTrait, CreatedBy},
 };
@@ -10,12 +11,11 @@ use diesel_models::{
         MandateAmountData as DieselMandateAmountData, MandateDataType as DieselMandateType,
         MandateDetails as DieselMandateDetails, MerchantStorageScheme,
     },
-    kv,
-    payment_attempt::{
-        PaymentAttempt as DieselPaymentAttempt, PaymentAttemptNew as DieselPaymentAttemptNew,
-    },
+    payment_attempt::PaymentAttempt as DieselPaymentAttempt,
     reverse_lookup::{ReverseLookup, ReverseLookupNew},
 };
+#[cfg(feature = "v1")]
+use diesel_models::{kv, payment_attempt::PaymentAttemptNew as DieselPaymentAttemptNew};
 use error_stack::ResultExt;
 #[cfg(feature = "v1")]
 use hyperswitch_domain_models::payments::payment_attempt::PaymentAttemptNew;
@@ -28,22 +28,27 @@ use hyperswitch_domain_models::{
     mandates::{MandateAmountData, MandateDataType, MandateDetails},
     payments::payment_attempt::{PaymentAttempt, PaymentAttemptInterface, PaymentAttemptUpdate},
 };
-#[cfg(feature = "olap")]
+#[cfg(all(feature = "v1", feature = "olap"))]
 use hyperswitch_domain_models::{
     payments::payment_attempt::PaymentListFilters, payments::PaymentIntent,
 };
+#[cfg(feature = "v1")]
 use redis_interface::HsetnxReply;
 use router_env::{instrument, tracing};
 
 use crate::{
-    diesel_error_to_data_error,
-    errors::{self, RedisErrorExt},
+    diesel_error_to_data_error, errors,
     kv_router_store::KVRouterStore,
     lookup::ReverseLookupInterface,
-    redis::kv_store::{decide_storage_scheme, kv_wrapper, KvOperation, Op, PartitionKey},
-    utils::{pg_connection_read, pg_connection_write, try_redis_get_else_try_database_get},
+    utils::{pg_connection_read, pg_connection_write},
     DataModelExt, DatabaseStore, RouterStore,
 };
+#[cfg(feature = "v1")]
+use crate::{
+    errors::RedisErrorExt,
+    redis::kv_store::{decide_storage_scheme, kv_wrapper, KvOperation, Op, PartitionKey},
+    utils::try_redis_get_else_try_database_get,
+};
 
 #[async_trait::async_trait]
 impl<T: DatabaseStore> PaymentAttemptInterface for RouterStore<T> {
diff --git a/crates/storage_impl/src/payments/payment_intent.rs b/crates/storage_impl/src/payments/payment_intent.rs
index e78d6244d50..17156855e13 100644
--- a/crates/storage_impl/src/payments/payment_intent.rs
+++ b/crates/storage_impl/src/payments/payment_intent.rs
@@ -2,14 +2,11 @@
 use api_models::payments::{AmountFilter, Order, SortBy, SortOn};
 #[cfg(feature = "olap")]
 use async_bb8_diesel::{AsyncConnection, AsyncRunQueryDsl};
-use common_utils::{
-    ext_traits::{AsyncExt, Encode},
-    types::keymanager::KeyManagerState,
-};
+#[cfg(feature = "v1")]
+use common_utils::ext_traits::Encode;
+use common_utils::{ext_traits::AsyncExt, types::keymanager::KeyManagerState};
 #[cfg(feature = "olap")]
 use diesel::{associations::HasTable, ExpressionMethods, JoinOnDsl, QueryDsl};
-#[cfg(feature = "v1")]
-use diesel_models::payment_intent::PaymentIntentUpdate as DieselPaymentIntentUpdate;
 #[cfg(feature = "olap")]
 use diesel_models::query::generics::db_metrics;
 #[cfg(all(feature = "v1", feature = "olap"))]
@@ -23,8 +20,10 @@ use diesel_models::schema_v2::{
     payment_intent::dsl as pi_dsl,
 };
 use diesel_models::{
-    enums::MerchantStorageScheme, kv, payment_intent::PaymentIntent as DieselPaymentIntent,
+    enums::MerchantStorageScheme, payment_intent::PaymentIntent as DieselPaymentIntent,
 };
+#[cfg(feature = "v1")]
+use diesel_models::{kv, payment_intent::PaymentIntentUpdate as DieselPaymentIntentUpdate};
 use error_stack::ResultExt;
 #[cfg(feature = "olap")]
 use hyperswitch_domain_models::payments::{
@@ -38,6 +37,7 @@ use hyperswitch_domain_models::{
         PaymentIntent,
     },
 };
+#[cfg(feature = "v1")]
 use redis_interface::HsetnxReply;
 #[cfg(feature = "olap")]
 use router_env::logger;
@@ -47,12 +47,17 @@ use router_env::{instrument, tracing};
 use crate::connection;
 use crate::{
     diesel_error_to_data_error,
-    errors::{RedisErrorExt, StorageError},
+    errors::StorageError,
     kv_router_store::KVRouterStore,
-    redis::kv_store::{decide_storage_scheme, kv_wrapper, KvOperation, Op, PartitionKey},
-    utils::{self, pg_connection_read, pg_connection_write},
+    utils::{pg_connection_read, pg_connection_write},
     DatabaseStore,
 };
+#[cfg(feature = "v1")]
+use crate::{
+    errors::RedisErrorExt,
+    redis::kv_store::{decide_storage_scheme, kv_wrapper, KvOperation, Op, PartitionKey},
+    utils,
+};
 
 #[async_trait::async_trait]
 impl<T: DatabaseStore> PaymentIntentInterface for KVRouterStore<T> {
@@ -1136,8 +1141,6 @@ impl<T: DatabaseStore> PaymentIntentInterface for crate::RouterStore<T> {
         use diesel::NullableExpressionMethods as _;
         use futures::{future::try_join_all, FutureExt};
 
-        use crate::DataModelExt;
-
         let conn = connection::pg_connection_read(self).await?;
         let conn = async_bb8_diesel::Connection::as_async_conn(&conn);
         let mut query = DieselPaymentIntent::table()
diff --git a/crates/storage_impl/src/payouts/payouts.rs b/crates/storage_impl/src/payouts/payouts.rs
index 482b77e300a..484328aabab 100644
--- a/crates/storage_impl/src/payouts/payouts.rs
+++ b/crates/storage_impl/src/payouts/payouts.rs
@@ -4,18 +4,13 @@ use api_models::enums::PayoutConnectors;
 use async_bb8_diesel::{AsyncConnection, AsyncRunQueryDsl};
 use common_utils::ext_traits::Encode;
 #[cfg(feature = "olap")]
-use diesel::{
-    associations::HasTable, ExpressionMethods, JoinOnDsl, NullableExpressionMethods, QueryDsl,
-};
-#[cfg(all(feature = "olap", feature = "v1"))]
-use diesel_models::schema::{
-    address::dsl as add_dsl, customers::dsl as cust_dsl, payout_attempt::dsl as poa_dsl,
-};
+use diesel::{associations::HasTable, ExpressionMethods, QueryDsl};
+#[cfg(all(feature = "v1", feature = "olap"))]
+use diesel::{JoinOnDsl, NullableExpressionMethods};
 #[cfg(feature = "olap")]
 use diesel_models::{
     address::Address as DieselAddress, customers::Customer as DieselCustomer,
-    enums as storage_enums, payout_attempt::PayoutAttempt as DieselPayoutAttempt,
-    query::generics::db_metrics, schema::payouts::dsl as po_dsl,
+    enums as storage_enums, query::generics::db_metrics, schema::payouts::dsl as po_dsl,
 };
 use diesel_models::{
     enums::MerchantStorageScheme,
@@ -25,6 +20,11 @@ use diesel_models::{
         PayoutsUpdate as DieselPayoutsUpdate,
     },
 };
+#[cfg(all(feature = "olap", feature = "v1"))]
+use diesel_models::{
+    payout_attempt::PayoutAttempt as DieselPayoutAttempt,
+    schema::{address::dsl as add_dsl, customers::dsl as cust_dsl, payout_attempt::dsl as poa_dsl},
+};
 use error_stack::ResultExt;
 #[cfg(feature = "olap")]
 use hyperswitch_domain_models::payouts::PayoutFetchConstraints;
@@ -876,8 +876,8 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
     #[instrument(skip_all)]
     async fn filter_active_payout_ids_by_constraints(
         &self,
-        merchant_id: &common_utils::id_type::MerchantId,
-        constraints: &PayoutFetchConstraints,
+        _merchant_id: &common_utils::id_type::MerchantId,
+        _constraints: &PayoutFetchConstraints,
     ) -> error_stack::Result<Vec<String>, StorageError> {
         todo!()
     }
diff --git a/crates/storage_impl/src/tokenization.rs b/crates/storage_impl/src/tokenization.rs
index 5ecb6b0a813..9a824e9126c 100644
--- a/crates/storage_impl/src/tokenization.rs
+++ b/crates/storage_impl/src/tokenization.rs
@@ -1,41 +1,16 @@
 #[cfg(all(feature = "v2", feature = "tokenization_v2"))]
-use async_bb8_diesel::AsyncRunQueryDsl;
+use common_utils::{errors::CustomResult, types::keymanager::KeyManagerState};
 #[cfg(all(feature = "v2", feature = "tokenization_v2"))]
-use common_utils::{
-    errors::CustomResult,
-    ext_traits::OptionExt,
-    id_type::{CellId, GlobalTokenId, MerchantId},
-    types::keymanager::KeyManagerState,
-};
-#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
-use diesel::{ExpressionMethods, Insertable, RunQueryDsl};
-#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
-use diesel_models::{
-    enums::TokenizationFlag as DbTokenizationFlag,
-    schema_v2::tokenization::dsl as tokenization_dsl, tokenization, PgPooledConn,
-};
-#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
-use error_stack::{report, Report, ResultExt};
-#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
-use hyperswitch_domain_models::tokenization::Tokenization;
+use error_stack::{report, ResultExt};
 #[cfg(all(feature = "v2", feature = "tokenization_v2"))]
 use hyperswitch_domain_models::{
     behaviour::{Conversion, ReverseConversion},
     merchant_key_store::MerchantKeyStore,
 };
-#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
-use tokio::time;
 
 use super::MockDb;
 #[cfg(all(feature = "v2", feature = "tokenization_v2"))]
-use crate::{
-    connection, diesel_error_to_data_error, errors,
-    kv_router_store::{
-        FilterResourceParams, FindResourceBy, InsertResourceParams, UpdateResourceParams,
-    },
-    redis::kv_store::{Op, PartitionKey},
-    utils::{pg_connection_read, pg_connection_write},
-};
+use crate::{connection, errors};
 use crate::{kv_router_store::KVRouterStore, DatabaseStore, RouterStore};
 
 #[cfg(not(all(feature = "v2", feature = "tokenization_v2")))]
@@ -146,18 +121,18 @@ impl<T: DatabaseStore> TokenizationInterface for KVRouterStore<T> {
 impl TokenizationInterface for MockDb {
     async fn insert_tokenization(
         &self,
-        tokenization: hyperswitch_domain_models::tokenization::Tokenization,
-        merchant_key_store: &MerchantKeyStore,
-        key_manager_state: &KeyManagerState,
+        _tokenization: hyperswitch_domain_models::tokenization::Tokenization,
+        _merchant_key_store: &MerchantKeyStore,
+        _key_manager_state: &KeyManagerState,
     ) -> CustomResult<hyperswitch_domain_models::tokenization::Tokenization, errors::StorageError>
     {
         Err(errors::StorageError::MockDbError)?
     }
     async fn get_entity_id_vault_id_by_token_id(
         &self,
-        token: &common_utils::id_type::GlobalTokenId,
-        merchant_key_store: &MerchantKeyStore,
-        key_manager_state: &KeyManagerState,
+        _token: &common_utils::id_type::GlobalTokenId,
+        _merchant_key_store: &MerchantKeyStore,
+        _key_manager_state: &KeyManagerState,
     ) -> CustomResult<hyperswitch_domain_models::tokenization::Tokenization, errors::StorageError>
     {
         Err(errors::StorageError::MockDbError)?