feat(refunds): Add refunds diesel model support in V2 API (#7503)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com>
This commit is contained in:
Amey Wale
2025-03-24 16:13:18 +05:30
committed by GitHub
parent 451d193137
commit bc8b940918
24 changed files with 915 additions and 41 deletions

View File

@ -345,6 +345,7 @@ impl UniqueConstraints for diesel_models::PaymentAttempt {
}
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "refunds_v2")))]
impl UniqueConstraints for diesel_models::Refund {
fn unique_constraints(&self) -> Vec<String> {
vec![format!(
@ -358,6 +359,16 @@ impl UniqueConstraints for diesel_models::Refund {
}
}
#[cfg(all(feature = "v2", feature = "refunds_v2"))]
impl UniqueConstraints for diesel_models::Refund {
fn unique_constraints(&self) -> Vec<String> {
vec![self.id.get_string_repr().to_owned()]
}
fn table_name(&self) -> &str {
"Refund"
}
}
impl UniqueConstraints for diesel_models::ReverseLookup {
fn unique_constraints(&self) -> Vec<String> {
vec![format!("reverselookup_{}", self.lookup_id)]