refactor(router): add domain type for merchant_connector_account id (#5685)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
This commit is contained in:
Sai Harsha Vardhan
2024-08-28 13:22:19 +05:30
committed by GitHub
parent f33e1bb65c
commit 771f48cfe0
69 changed files with 388 additions and 271 deletions

View File

@ -251,7 +251,12 @@ pub struct RoutingAlgorithmHelpers<'h> {
}
#[derive(Clone, Debug)]
pub struct ConnectNameAndMCAIdForProfile<'a>(pub FxHashSet<(&'a String, String)>);
pub struct ConnectNameAndMCAIdForProfile<'a>(
pub FxHashSet<(
&'a String,
common_utils::id_type::MerchantConnectorAccountId,
)>,
);
#[derive(Clone, Debug)]
pub struct ConnectNameForProfile<'a>(pub FxHashSet<&'a String>);
@ -322,7 +327,7 @@ impl<'h> RoutingAlgorithmHelpers<'h> {
self.name_mca_id_set.0.contains(&(&choice.connector.to_string(), mca_id.clone())),
errors::ApiErrorResponse::InvalidRequestData {
message: format!(
"connector with name '{}' and merchant connector account id '{}' not found for the given profile",
"connector with name '{}' and merchant connector account id '{:?}' not found for the given profile",
choice.connector,
mca_id,
)
@ -430,7 +435,7 @@ pub async fn validate_connectors_in_routing_config(
name_mca_id_set.contains(&(&choice.connector.to_string(), mca_id.clone())),
errors::ApiErrorResponse::InvalidRequestData {
message: format!(
"connector with name '{}' and merchant connector account id '{}' not found for the given profile",
"connector with name '{}' and merchant connector account id '{:?}' not found for the given profile",
choice.connector,
mca_id,
)