feat(analytics): Analytics Request Validator and config driven forex feature (#6733)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Sandeep Kumar <83278309+tsdk02@users.noreply.github.com>
This commit is contained in:
Uzair Khan
2024-12-17 15:53:00 +05:30
committed by GitHub
parent 94ad90f9ed
commit c883aa59aa
16 changed files with 428 additions and 160 deletions

View File

@ -5,7 +5,7 @@ use std::{
use common_utils::id_type;
use super::{NameDescription, TimeRange};
use super::{ForexMetric, NameDescription, TimeRange};
use crate::enums::{
AttemptStatus, AuthenticationType, CardNetwork, Connector, Currency, PaymentMethod,
PaymentMethodType,
@ -119,6 +119,17 @@ pub enum PaymentMetrics {
FailureReasons,
}
impl ForexMetric for PaymentMetrics {
fn is_forex_metric(&self) -> bool {
matches!(
self,
Self::PaymentProcessedAmount
| Self::AvgTicketSize
| Self::SessionizedPaymentProcessedAmount
| Self::SessionizedAvgTicketSize
)
}
}
#[derive(Debug, Default, serde::Serialize)]
pub struct ErrorResult {
pub reason: String,