refactor(merchant_id): create domain type for merchant_id (#5408)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
Narayan Bhat
2024-07-24 19:18:25 +05:30
committed by GitHub
parent e18ea7a7ba
commit 7068fbfbe2
406 changed files with 3168 additions and 2633 deletions

View File

@ -77,7 +77,7 @@ pub fn validate_role_groups(groups: &[PermissionGroup]) -> UserResult<()> {
pub async fn validate_role_name(
state: &SessionState,
role_name: &domain::RoleName,
merchant_id: &str,
merchant_id: &id_type::MerchantId,
org_id: &id_type::OrganizationId,
) -> UserResult<()> {
let role_name_str = role_name.clone().get_role_name();
@ -109,7 +109,7 @@ pub async fn set_role_permissions_in_cache_by_user_role(
set_role_permissions_in_cache_if_required(
state,
user_role.role_id.as_str(),
user_role.merchant_id.as_str(),
&user_role.merchant_id,
&user_role.org_id,
)
.await
@ -120,7 +120,7 @@ pub async fn set_role_permissions_in_cache_by_user_role(
pub async fn set_role_permissions_in_cache_if_required(
state: &SessionState,
role_id: &str,
merchant_id: &str,
merchant_id: &id_type::MerchantId,
org_id: &id_type::OrganizationId,
) -> UserResult<()> {
if roles::predefined_roles::PREDEFINED_ROLES.contains_key(role_id) {