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

@ -10,7 +10,7 @@ use crate::schema::api_keys;
#[diesel(table_name = api_keys, primary_key(key_id), check_for_backend(diesel::pg::Pg))]
pub struct ApiKey {
pub key_id: String,
pub merchant_id: String,
pub merchant_id: common_utils::id_type::MerchantId,
pub name: String,
pub description: Option<String>,
pub hashed_api_key: HashedApiKey,
@ -24,7 +24,7 @@ pub struct ApiKey {
#[diesel(table_name = api_keys)]
pub struct ApiKeyNew {
pub key_id: String,
pub merchant_id: String,
pub merchant_id: common_utils::id_type::MerchantId,
pub name: String,
pub description: Option<String>,
pub hashed_api_key: HashedApiKey,
@ -142,7 +142,7 @@ mod diesel_impl {
#[derive(Default, Debug, Deserialize, Serialize, Clone)]
pub struct ApiKeyExpiryTrackingData {
pub key_id: String,
pub merchant_id: String,
pub merchant_id: common_utils::id_type::MerchantId,
pub api_key_name: String,
pub prefix: String,
pub api_key_expiry: Option<PrimitiveDateTime>,