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

@ -12,6 +12,7 @@ pub mod customers;
pub mod database;
pub mod errors;
mod lookup;
pub mod mandate;
pub mod metrics;
pub mod mock_db;
pub mod payment_method;
@ -372,6 +373,15 @@ impl UniqueConstraints for diesel_models::PaymentMethod {
}
}
impl UniqueConstraints for diesel_models::Mandate {
fn unique_constraints(&self) -> Vec<String> {
vec![format!("mand_{}_{}", self.merchant_id, self.mandate_id)]
}
fn table_name(&self) -> &str {
"Mandate"
}
}
impl UniqueConstraints for diesel_models::Customer {
fn unique_constraints(&self) -> Vec<String> {
vec![format!(