-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
f33e1bb
commit 771f48c
Showing
69 changed files
with
388 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
crates/common_utils/src/id_type/merchant_connector_account.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use crate::errors::{CustomResult, ValidationError}; | ||
|
||
crate::id_type!( | ||
MerchantConnectorAccountId, | ||
"A type for merchant_connector_id that can be used for merchant_connector_account ids" | ||
); | ||
crate::impl_id_type_methods!(MerchantConnectorAccountId, "merchant_connector_id"); | ||
|
||
// This is to display the `MerchantConnectorAccountId` as MerchantConnectorAccountId(abcd) | ||
crate::impl_debug_id_type!(MerchantConnectorAccountId); | ||
crate::impl_generate_id_id_type!(MerchantConnectorAccountId, "mca"); | ||
crate::impl_try_from_cow_str_id_type!(MerchantConnectorAccountId, "merchant_connector_id"); | ||
|
||
crate::impl_serializable_secret_id_type!(MerchantConnectorAccountId); | ||
crate::impl_queryable_id_type!(MerchantConnectorAccountId); | ||
crate::impl_to_sql_from_sql_id_type!(MerchantConnectorAccountId); | ||
|
||
impl MerchantConnectorAccountId { | ||
/// Get a merchant connector account id from String | ||
pub fn wrap(merchant_connector_account_id: String) -> CustomResult<Self, ValidationError> { | ||
Self::try_from(std::borrow::Cow::from(merchant_connector_account_id)) | ||
} | ||
} |
Oops, something went wrong.