db: Added Reverse lookup table (#147)

This commit is contained in:
Kartikeya Hegde
2022-12-19 18:50:05 +05:30
committed by GitHub
parent d6a3e508e2
commit 87fed68519
51 changed files with 937 additions and 201 deletions

View File

@ -5,6 +5,7 @@ use crate::{
errors,
payment_attempt::{PaymentAttempt, PaymentAttemptNew, PaymentAttemptUpdate},
payment_intent::{PaymentIntent, PaymentIntentNew, PaymentIntentUpdate},
refund::{Refund, RefundNew, RefundUpdate},
};
#[derive(Debug, Serialize, Deserialize)]
@ -37,6 +38,7 @@ impl TypedSql {
pub enum Insertable {
PaymentIntent(PaymentIntentNew),
PaymentAttempt(PaymentAttemptNew),
Refund(RefundNew),
}
#[derive(Debug, Serialize, Deserialize)]
@ -44,6 +46,7 @@ pub enum Insertable {
pub enum Updateable {
PaymentIntentUpdate(PaymentIntentUpdateMems),
PaymentAttemptUpdate(PaymentAttemptUpdateMems),
RefundUpdate(RefundUpdateMems),
}
#[derive(Debug, Serialize, Deserialize)]
@ -57,3 +60,9 @@ pub struct PaymentAttemptUpdateMems {
pub orig: PaymentAttempt,
pub update_data: PaymentAttemptUpdate,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct RefundUpdateMems {
pub orig: Refund,
pub update_data: RefundUpdate,
}