mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 17:47:54 +08:00
feat(analytics): added dispute as uri param to analytics info api (#3693)
This commit is contained in:
committed by
GitHub
parent
e0d8bb207e
commit
76ac1a753a
@ -13,6 +13,7 @@ pub use crate::payments::TimeRange;
|
||||
|
||||
pub mod api_event;
|
||||
pub mod connector_events;
|
||||
pub mod disputes;
|
||||
pub mod outgoing_webhook_event;
|
||||
pub mod payments;
|
||||
pub mod refunds;
|
||||
|
||||
65
crates/api_models/src/analytics/disputes.rs
Normal file
65
crates/api_models/src/analytics/disputes.rs
Normal file
@ -0,0 +1,65 @@
|
||||
use super::NameDescription;
|
||||
|
||||
#[derive(
|
||||
Clone,
|
||||
Debug,
|
||||
Hash,
|
||||
PartialEq,
|
||||
Eq,
|
||||
serde::Serialize,
|
||||
serde::Deserialize,
|
||||
strum::Display,
|
||||
strum::EnumIter,
|
||||
strum::AsRefStr,
|
||||
)]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum DisputeMetrics {
|
||||
DisputesChallenged,
|
||||
DisputesWon,
|
||||
DisputesLost,
|
||||
TotalAmountDisputed,
|
||||
TotalDisputeLostAmount,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Debug,
|
||||
serde::Serialize,
|
||||
serde::Deserialize,
|
||||
strum::AsRefStr,
|
||||
PartialEq,
|
||||
PartialOrd,
|
||||
Eq,
|
||||
Ord,
|
||||
strum::Display,
|
||||
strum::EnumIter,
|
||||
Clone,
|
||||
Copy,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum DisputeDimensions {
|
||||
// Do not change the order of these enums
|
||||
// Consult the Dashboard FE folks since these also affects the order of metrics on FE
|
||||
Connector,
|
||||
DisputeStatus,
|
||||
ConnectorStatus,
|
||||
}
|
||||
|
||||
impl From<DisputeDimensions> for NameDescription {
|
||||
fn from(value: DisputeDimensions) -> Self {
|
||||
Self {
|
||||
name: value.to_string(),
|
||||
desc: String::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<DisputeMetrics> for NameDescription {
|
||||
fn from(value: DisputeMetrics) -> Self {
|
||||
Self {
|
||||
name: value.to_string(),
|
||||
desc: String::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user