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

@ -47,8 +47,8 @@ pub struct EventListItemResponse {
pub event_id: String,
/// The identifier for the Merchant Account.
#[schema(max_length = 64, example = "y3oqhf46pyzuxjbcn2giaqnb44")]
pub merchant_id: String,
#[schema(max_length = 64, example = "y3oqhf46pyzuxjbcn2giaqnb44", value_type = String)]
pub merchant_id: common_utils::id_type::MerchantId,
/// The identifier for the Business Profile.
#[schema(max_length = 64, example = "SqB0zwDGR5wHppWf0bx7GKr1f2")]
@ -97,7 +97,11 @@ pub struct EventRetrieveResponse {
impl common_utils::events::ApiEventMetric for EventRetrieveResponse {
fn get_api_event_type(&self) -> Option<common_utils::events::ApiEventsType> {
Some(common_utils::events::ApiEventsType::Events {
merchant_id_or_profile_id: self.event_information.merchant_id.clone(),
merchant_id_or_profile_id: self
.event_information
.merchant_id
.get_string_repr()
.to_owned(),
})
}
}