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

@ -110,8 +110,9 @@ pub async fn customer_update(
};
let customer_id = path.into_inner();
let mut cust_update_req: customer_types::CustomerRequest = payload.into();
let mut cust_update_req: customer_types::CustomerUpdateRequest = payload.into();
cust_update_req.customer_id = Some(customer_id);
let customer_update_id = customer_types::UpdateCustomerId::new("temp_global_id".to_string());
let flow = Flow::CustomersUpdate;
@ -130,7 +131,13 @@ pub async fn customer_update(
&req,
cust_update_req,
|state, auth, req, _| {
customers::update_customer(state, auth.merchant_account, req, auth.key_store)
customers::update_customer(
state,
auth.merchant_account,
req,
auth.key_store,
customer_update_id.clone(),
)
},
&auth::HeaderAuth(auth::ApiKeyAuth),
api_locking::LockAction::NotApplicable,

View File

@ -135,7 +135,7 @@ impl From<CreateCustomerRequest> for api::CustomerRequest {
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
impl From<CustomerUpdateRequest> for api::CustomerRequest {
impl From<CustomerUpdateRequest> for api::CustomerUpdateRequest {
fn from(req: CustomerUpdateRequest) -> Self {
Self {
name: req.name,