juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.64k stars 1.36k forks source link

refactor(tenant): use tenant id type #6643

Open apoorvdixit88 opened 3 days ago

apoorvdixit88 commented 3 days ago

Type of Change

Description

Use tenant_id type for better type safety

Additional Changes

Motivation and Context

Closes #6642

How did you test it?

It refactoring PR, its compiling and checks are passing Tested flows like signup/signin with tenancy featue flag enabled and disabled in local

Checklist

semanticdiff-com[bot] commented 3 days ago

Review changes with  SemanticDiff

Changed Files
| File | Status | | :--- | :--- | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/core/routing/helpers.rs)  [crates/router/src/core/routing/helpers\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/core/routing/helpers.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/core/routing/helpers.rs)  91% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/connectors/aci.rs)  [crates/router/tests/connectors/aci\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/connectors/aci.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/connectors/aci.rs)  86% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/payments.rs)  [crates/router/tests/payments\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/payments.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/payments.rs)  86% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/payments2.rs)  [crates/router/tests/payments2\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/payments2.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/payments2.rs)  86% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/db/events.rs)  [crates/router/src/db/events\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/db/events.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/db/events.rs)  86% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/db/merchant_connector_account.rs)  [crates/router/src/db/merchant\_connector\_account\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/db/merchant_connector_account.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/db/merchant_connector_account.rs)  86% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/db/merchant_key_store.rs)  [crates/router/src/db/merchant\_key\_store\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/db/merchant_key_store.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/db/merchant_key_store.rs)  86% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/connectors/utils.rs)  [crates/router/tests/connectors/utils\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/connectors/utils.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/connectors/utils.rs)  86% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/cache.rs)  [crates/router/tests/cache\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/cache.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/cache.rs)  85% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/services.rs)  [crates/router/tests/services\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/services.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/tests/services.rs)  85% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/core/payment_methods/transformers.rs)  [crates/router/src/core/payment\_methods/transformers\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/core/payment_methods/transformers.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/core/payment_methods/transformers.rs)  77% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/services/authorization.rs)  [crates/router/src/services/authorization\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/services/authorization.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/services/authorization.rs)  77% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/handler.rs)  [crates/drainer/src/handler\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/handler.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/handler.rs)  72% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/routes/app.rs)  [crates/router/src/routes/app\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/routes/app.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/routes/app.rs)  65% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/services/api.rs)  [crates/router/src/services/api\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/services/api.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/services/api.rs)  63% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/configs/settings.rs)  [crates/router/src/configs/settings\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/configs/settings.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/configs/settings.rs)  50% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/core/user.rs)  [crates/router/src/core/user\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/core/user.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/core/user.rs)  37% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/scheduler/src/consumer.rs)  [crates/scheduler/src/consumer\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/scheduler/src/consumer.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/scheduler/src/consumer.rs)  25% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/scheduler/src/producer.rs)  [crates/scheduler/src/producer\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/scheduler/src/producer.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/scheduler/src/producer.rs)  20% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/lib.rs)  [crates/drainer/src/lib\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/lib.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/lib.rs)  2% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/settings.rs)  [crates/drainer/src/settings\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/settings.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/settings.rs)  1% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/health_check.rs)  [crates/drainer/src/health\_check\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/health_check.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/drainer/src/health_check.rs)  1% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/id_type.rs)  [crates/common\_utils/src/id\_type\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/id_type.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/id_type.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/id_type/organization.rs)  [crates/common\_utils/src/id\_type/organization\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/id_type/organization.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/id_type/organization.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/id_type/tenant.rs)  [crates/common\_utils/src/id\_type/tenant\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/id_type/tenant.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/id_type/tenant.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/types/theme.rs)  [crates/common\_utils/src/types/theme\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/types/theme.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/common_utils/src/types/theme.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/diesel_models/src/user/theme.rs)  [crates/diesel\_models/src/user/theme\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/diesel_models/src/user/theme.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/diesel_models/src/user/theme.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/diesel_models/src/user_role.rs)  [crates/diesel\_models/src/user\_role\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/diesel_models/src/user_role.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/diesel_models/src/user_role.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/services/authentication.rs)  [crates/router/src/services/authentication\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/services/authentication.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/services/authentication.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/types/domain/user.rs)  [crates/router/src/types/domain/user\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/types/domain/user.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/types/domain/user.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/utils/user.rs)  [crates/router/src/utils/user\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/utils/user.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/router/src/utils/user.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/scheduler/src/scheduler.rs)  [crates/scheduler/src/scheduler\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/scheduler/src/scheduler.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6643/changes#crates/scheduler/src/scheduler.rs)  0% smaller |