feat(customer): customer v2 refactor for customer create end point (#5350)

Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in>
Co-authored-by: hrithikesh026 <hrithikesh.vm@juspay.in>
Co-authored-by: Prajjwal Kumar <prajjwal.kumar@juspay.in>
Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sahkal Poddar
2024-07-23 13:10:07 +05:30
committed by GitHub
parent bc92e0cccb
commit aaf1f2b1e5
36 changed files with 967 additions and 385 deletions

View File

@ -12,7 +12,7 @@ impl ApiEventMetric for CustomerDeleteResponse {
impl ApiEventMetric for CustomerRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
self.customer_id
self.get_merchant_reference_id()
.clone()
.map(|customer_id| ApiEventsType::Customer { customer_id })
}
@ -20,16 +20,16 @@ impl ApiEventMetric for CustomerRequest {
impl ApiEventMetric for CustomerResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Customer {
customer_id: self.customer_id.clone(),
})
self.get_merchant_reference_id()
.clone()
.map(|cid| ApiEventsType::Customer { customer_id: cid })
}
}
impl ApiEventMetric for CustomerId {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Customer {
customer_id: self.customer_id.clone(),
customer_id: self.get_merchant_reference_id().clone(),
})
}
}