mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
feat(analytics): authentication analytics (#4429)
Co-authored-by: Sampras Lopes <lsampras@pm.me> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -4,6 +4,7 @@ use api_models::{
|
||||
analytics::{
|
||||
self as analytics_api,
|
||||
api_event::ApiEventDimensions,
|
||||
auth_events::AuthEventFlows,
|
||||
disputes::DisputeDimensions,
|
||||
payments::{PaymentDimensions, PaymentDistributions},
|
||||
refunds::{RefundDimensions, RefundType},
|
||||
@ -247,6 +248,11 @@ pub enum Aggregate<R> {
|
||||
field: R,
|
||||
alias: Option<&'static str>,
|
||||
},
|
||||
Percentile {
|
||||
field: R,
|
||||
alias: Option<&'static str>,
|
||||
percentile: Option<&'static u8>,
|
||||
},
|
||||
}
|
||||
|
||||
// Window functions in query
|
||||
@ -379,11 +385,17 @@ impl_to_sql_for_to_string!(
|
||||
Order
|
||||
);
|
||||
|
||||
impl_to_sql_for_to_string!(&SdkEventDimensions, SdkEventDimensions, SdkEventNames);
|
||||
|
||||
impl_to_sql_for_to_string!(&ApiEventDimensions, ApiEventDimensions);
|
||||
|
||||
impl_to_sql_for_to_string!(&DisputeDimensions, DisputeDimensions, DisputeStage);
|
||||
impl_to_sql_for_to_string!(
|
||||
&SdkEventDimensions,
|
||||
SdkEventDimensions,
|
||||
SdkEventNames,
|
||||
AuthEventFlows,
|
||||
&ApiEventDimensions,
|
||||
ApiEventDimensions,
|
||||
&DisputeDimensions,
|
||||
DisputeDimensions,
|
||||
DisputeStage
|
||||
);
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum FilterTypes {
|
||||
@ -507,6 +519,14 @@ where
|
||||
self.add_custom_filter_clause(key, value, FilterTypes::EqualBool)
|
||||
}
|
||||
|
||||
pub fn add_negative_filter_clause(
|
||||
&mut self,
|
||||
key: impl ToSql<T>,
|
||||
value: impl ToSql<T>,
|
||||
) -> QueryResult<()> {
|
||||
self.add_custom_filter_clause(key, value, FilterTypes::NotEqual)
|
||||
}
|
||||
|
||||
pub fn add_custom_filter_clause(
|
||||
&mut self,
|
||||
lhs: impl ToSql<T>,
|
||||
|
||||
Reference in New Issue
Block a user