feat(multitenancy): add support for multitenancy and handle the same in router, producer, consumer, drainer and analytics (#4630)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
Jagan
2024-06-03 17:57:30 +05:30
committed by GitHub
parent a1788b8da9
commit 15d6c3e846
188 changed files with 2260 additions and 1414 deletions

View File

@ -27,7 +27,7 @@ use crate::{
errors::{RouterResponse, StorageErrorExt},
metrics, utils as core_utils,
},
routes::AppState,
routes::SessionState,
types::domain,
utils::{self, OptionExt, ValueExt},
};
@ -46,7 +46,7 @@ where
}
pub async fn retrieve_merchant_routing_dictionary(
state: AppState,
state: SessionState,
merchant_account: domain::MerchantAccount,
#[cfg(feature = "business_profile_routing")] query_params: RoutingRetrieveQuery,
#[cfg(feature = "business_profile_routing")] transaction_type: &enums::TransactionType,
@ -93,7 +93,7 @@ pub async fn retrieve_merchant_routing_dictionary(
}
pub async fn create_routing_config(
state: AppState,
state: SessionState,
merchant_account: domain::MerchantAccount,
key_store: domain::MerchantKeyStore,
request: routing_types::RoutingConfigRequest,
@ -248,7 +248,7 @@ pub async fn create_routing_config(
}
pub async fn link_routing_config(
state: AppState,
state: SessionState,
merchant_account: domain::MerchantAccount,
#[cfg(not(feature = "business_profile_routing"))] key_store: domain::MerchantKeyStore,
algorithm_id: String,
@ -371,7 +371,7 @@ pub async fn link_routing_config(
}
pub async fn retrieve_routing_config(
state: AppState,
state: SessionState,
merchant_account: domain::MerchantAccount,
algorithm_id: RoutingAlgorithmId,
) -> RouterResponse<routing_types::MerchantRoutingAlgorithm> {
@ -445,7 +445,7 @@ pub async fn retrieve_routing_config(
}
}
pub async fn unlink_routing_config(
state: AppState,
state: SessionState,
merchant_account: domain::MerchantAccount,
#[cfg(not(feature = "business_profile_routing"))] key_store: domain::MerchantKeyStore,
#[cfg(feature = "business_profile_routing")] request: routing_types::RoutingConfigRequest,
@ -630,7 +630,7 @@ pub async fn unlink_routing_config(
}
pub async fn update_default_routing_config(
state: AppState,
state: SessionState,
merchant_account: domain::MerchantAccount,
updated_config: Vec<routing_types::RoutableConnectorChoice>,
transaction_type: &enums::TransactionType,
@ -679,7 +679,7 @@ pub async fn update_default_routing_config(
}
pub async fn retrieve_default_routing_config(
state: AppState,
state: SessionState,
merchant_account: domain::MerchantAccount,
transaction_type: &enums::TransactionType,
) -> RouterResponse<Vec<routing_types::RoutableConnectorChoice>> {
@ -699,7 +699,7 @@ pub async fn retrieve_default_routing_config(
}
pub async fn retrieve_linked_routing_config(
state: AppState,
state: SessionState,
merchant_account: domain::MerchantAccount,
#[cfg(feature = "business_profile_routing")] query_params: RoutingRetrieveLinkQuery,
#[cfg(feature = "business_profile_routing")] transaction_type: &enums::TransactionType,
@ -808,7 +808,7 @@ pub async fn retrieve_linked_routing_config(
}
pub async fn retrieve_default_routing_config_for_profiles(
state: AppState,
state: SessionState,
merchant_account: domain::MerchantAccount,
transaction_type: &enums::TransactionType,
) -> RouterResponse<Vec<routing_types::ProfileDefaultRoutingConfig>> {
@ -847,7 +847,7 @@ pub async fn retrieve_default_routing_config_for_profiles(
}
pub async fn update_default_routing_config_for_profile(
state: AppState,
state: SessionState,
merchant_account: domain::MerchantAccount,
updated_config: Vec<routing_types::RoutableConnectorChoice>,
profile_id: String,