feat(payment_methods_v2): Implemented Diesel and Domain models for v2 (#5700)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sarthak Soni
2024-09-04 18:00:42 +05:30
committed by GitHub
parent 1c39cc1262
commit c3cc887ea3
39 changed files with 2712 additions and 668 deletions

View File

@ -406,6 +406,10 @@ impl UniqueConstraints for diesel_models::PayoutAttempt {
}
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
impl UniqueConstraints for diesel_models::PaymentMethod {
fn unique_constraints(&self) -> Vec<String> {
vec![format!("paymentmethod_{}", self.payment_method_id)]
@ -415,6 +419,16 @@ impl UniqueConstraints for diesel_models::PaymentMethod {
}
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
impl UniqueConstraints for diesel_models::PaymentMethod {
fn unique_constraints(&self) -> Vec<String> {
vec![format!("paymentmethod_{}", self.id)]
}
fn table_name(&self) -> &str {
"PaymentMethod"
}
}
impl UniqueConstraints for diesel_models::Mandate {
fn unique_constraints(&self) -> Vec<String> {
vec![format!(