chore: resolve warnings in v2 (#8373)

Co-authored-by: Aishwariyaa Anand <aishwariyaa.anand@Aishwariyaa-Anand-C3PGW02T6Y.local>
This commit is contained in:
Aishwariyaa Anand
2025-06-22 16:58:23 +05:30
committed by GitHub
parent 0851c6ece5
commit d2d4f3d1d8
50 changed files with 218 additions and 320 deletions

View File

@ -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)?