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

@ -34,6 +34,11 @@ pub enum PartitionKey<'a> {
merchant_id: &'a common_utils::id_type::MerchantId,
customer_id: &'a str,
},
#[cfg(all(feature = "v2", feature = "customer_v2"))]
MerchantIdMerchantReferenceId {
merchant_id: &'a common_utils::id_type::MerchantId,
merchant_reference_id: &'a str,
},
MerchantIdPayoutId {
merchant_id: &'a common_utils::id_type::MerchantId,
payout_id: &'a str,
@ -46,6 +51,10 @@ pub enum PartitionKey<'a> {
merchant_id: &'a common_utils::id_type::MerchantId,
mandate_id: &'a str,
},
#[cfg(all(feature = "v2", feature = "customer_v2"))]
GlobalId {
id: &'a str,
},
}
// PartitionKey::MerchantIdPaymentId {merchant_id, payment_id}
impl<'a> std::fmt::Display for PartitionKey<'a> {
@ -66,6 +75,14 @@ impl<'a> std::fmt::Display for PartitionKey<'a> {
"mid_{}_cust_{customer_id}",
merchant_id.get_string_repr()
)),
#[cfg(all(feature = "v2", feature = "customer_v2"))]
PartitionKey::MerchantIdMerchantReferenceId {
merchant_id,
merchant_reference_id,
} => f.write_str(&format!(
"mid_{}_cust_{merchant_reference_id}",
merchant_id.get_string_repr()
)),
PartitionKey::MerchantIdPayoutId {
merchant_id,
payout_id,
@ -87,6 +104,9 @@ impl<'a> std::fmt::Display for PartitionKey<'a> {
"mid_{}_mandate_{mandate_id}",
merchant_id.get_string_repr()
)),
#[cfg(all(feature = "v2", feature = "customer_v2"))]
PartitionKey::GlobalId { id } => f.write_str(&format!("cust_{id}",)),
}
}
}