feat(customer_v2): customer v2 refactor customer v2 update endpoint (#5490)

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-08-14 14:56:34 +05:30
committed by GitHub
parent 8bcda2cea4
commit 17703fe2cb
28 changed files with 1813 additions and 768 deletions

View File

@ -1,6 +1,8 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};
use crate::customers::{CustomerDeleteResponse, CustomerId, CustomerRequest, CustomerResponse};
use crate::customers::{
CustomerDeleteResponse, CustomerId, CustomerRequest, CustomerResponse, CustomerUpdateRequest,
};
impl ApiEventMetric for CustomerDeleteResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
@ -33,3 +35,12 @@ impl ApiEventMetric for CustomerId {
})
}
}
impl ApiEventMetric for CustomerUpdateRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
self.get_merchant_reference_id()
.clone()
.map(|cid| ApiEventsType::Customer { customer_id: cid })
}
}
// These needs to be fixed for v2