feat(mandate_kv): add kv support for mandate (#4275)

Co-authored-by: Akshay S <akshay.s@Akshay-Subramanian-D66TQ6D97K.local>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
akshay-97
2024-04-16 15:35:15 +05:30
committed by GitHub
parent c3361ef5eb
commit 00340a3369
17 changed files with 628 additions and 124 deletions

View File

@ -40,6 +40,10 @@ pub enum PartitionKey<'a> {
merchant_id: &'a str,
payout_attempt_id: &'a str,
},
MerchantIdMandateId {
merchant_id: &'a str,
mandate_id: &'a str,
},
}
// PartitionKey::MerchantIdPaymentId {merchant_id, payment_id}
impl<'a> std::fmt::Display for PartitionKey<'a> {
@ -62,6 +66,10 @@ impl<'a> std::fmt::Display for PartitionKey<'a> {
merchant_id,
payout_attempt_id,
} => f.write_str(&format!("mid_{merchant_id}_poa_{payout_attempt_id}")),
PartitionKey::MerchantIdMandateId {
merchant_id,
mandate_id,
} => f.write_str(&format!("mid_{merchant_id}_mandate_{mandate_id}")),
}
}
}