mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
refactor(dynamic_routing): add col payment_method_type in dynamic_routing_stats (#6853)
This commit is contained in:
@ -19,6 +19,7 @@ pub struct DynamicRoutingStatsNew {
|
||||
pub payment_status: common_enums::AttemptStatus,
|
||||
pub conclusive_classification: common_enums::SuccessBasedRoutingConclusiveState,
|
||||
pub created_at: time::PrimitiveDateTime,
|
||||
pub payment_method_type: Option<common_enums::PaymentMethodType>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Queryable, Selectable, Insertable)]
|
||||
@ -38,4 +39,5 @@ pub struct DynamicRoutingStats {
|
||||
pub payment_status: common_enums::AttemptStatus,
|
||||
pub conclusive_classification: common_enums::SuccessBasedRoutingConclusiveState,
|
||||
pub created_at: time::PrimitiveDateTime,
|
||||
pub payment_method_type: Option<common_enums::PaymentMethodType>,
|
||||
}
|
||||
|
||||
@ -417,6 +417,8 @@ diesel::table! {
|
||||
payment_status -> AttemptStatus,
|
||||
conclusive_classification -> SuccessBasedRoutingConclusiveState,
|
||||
created_at -> Timestamp,
|
||||
#[max_length = 64]
|
||||
payment_method_type -> Nullable<Varchar>,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -429,6 +429,8 @@ diesel::table! {
|
||||
payment_status -> AttemptStatus,
|
||||
conclusive_classification -> SuccessBasedRoutingConclusiveState,
|
||||
created_at -> Timestamp,
|
||||
#[max_length = 64]
|
||||
payment_method_type -> Nullable<Varchar>,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -761,6 +761,7 @@ pub async fn push_metrics_with_update_window_for_success_based_routing(
|
||||
amount: payment_attempt.get_total_amount(),
|
||||
success_based_routing_connector: first_success_based_connector.to_string(),
|
||||
payment_connector: payment_connector.to_string(),
|
||||
payment_method_type: payment_attempt.payment_method_type,
|
||||
currency: payment_attempt.currency,
|
||||
payment_method: payment_attempt.payment_method,
|
||||
capture_method: payment_attempt.capture_method,
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
ALTER TABLE dynamic_routing_stats
|
||||
DROP COLUMN IF EXISTS payment_method_type;
|
||||
@ -0,0 +1,3 @@
|
||||
-- Your SQL goes here
|
||||
ALTER TABLE dynamic_routing_stats
|
||||
ADD COLUMN IF NOT EXISTS payment_method_type VARCHAR(64);
|
||||
Reference in New Issue
Block a user