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

@ -4,7 +4,7 @@ use router_env::{instrument, tracing};
use crate::{
core::errors::{self, RouterResponse, StorageErrorExt},
routes::AppState,
routes::SessionState,
services::ApplicationResponse,
types::{api, domain, storage, transformers::ForeignTryFrom},
utils::{OptionExt, StringExt},
@ -20,7 +20,7 @@ enum MerchantAccountOrBusinessProfile {
#[instrument(skip(state))]
pub async fn list_initial_delivery_attempts(
state: AppState,
state: SessionState,
merchant_id_or_profile_id: String,
constraints: api::webhook_events::EventListConstraints,
) -> RouterResponse<Vec<api::webhook_events::EventListItemResponse>> {
@ -108,7 +108,7 @@ pub async fn list_initial_delivery_attempts(
#[instrument(skip(state))]
pub async fn list_delivery_attempts(
state: AppState,
state: SessionState,
merchant_id_or_profile_id: String,
initial_attempt_id: String,
) -> RouterResponse<Vec<api::webhook_events::EventRetrieveResponse>> {
@ -157,7 +157,7 @@ pub async fn list_delivery_attempts(
#[instrument(skip(state))]
pub async fn retry_delivery_attempt(
state: AppState,
state: SessionState,
merchant_id_or_profile_id: String,
event_id: String,
) -> RouterResponse<api::webhook_events::EventRetrieveResponse> {
@ -254,7 +254,7 @@ pub async fn retry_delivery_attempt(
}
async fn determine_identifier_and_get_key_store(
state: AppState,
state: SessionState,
merchant_id_or_profile_id: String,
) -> errors::RouterResult<(MerchantAccountOrBusinessProfile, domain::MerchantKeyStore)> {
let store = state.store.as_ref();