feat(analytics): modified authentication queries and added generate report for authentications (#7483)

Co-authored-by: Sandeep Kumar <sandeep.kumar@Sandeep-Kumar-LVF93XQXPC.local>
This commit is contained in:
Sandeep Kumar
2025-03-12 16:14:09 +05:30
committed by GitHub
parent c0c08d05ef
commit 9683b2a895
19 changed files with 267 additions and 18 deletions

View File

@ -3,7 +3,9 @@ use std::{
hash::{Hash, Hasher},
};
use common_enums::{AuthenticationConnectors, AuthenticationStatus, TransactionStatus};
use common_enums::{
AuthenticationConnectors, AuthenticationStatus, DecoupledAuthenticationType, TransactionStatus,
};
use super::{NameDescription, TimeRange};
@ -14,6 +16,8 @@ pub struct AuthEventFilters {
#[serde(default)]
pub trans_status: Vec<TransactionStatus>,
#[serde(default)]
pub authentication_type: Vec<DecoupledAuthenticationType>,
#[serde(default)]
pub error_message: Vec<String>,
#[serde(default)]
pub authentication_connector: Vec<AuthenticationConnectors>,
@ -42,6 +46,7 @@ pub enum AuthEventDimensions {
#[strum(serialize = "trans_status")]
#[serde(rename = "trans_status")]
TransactionStatus,
AuthenticationType,
ErrorMessage,
AuthenticationConnector,
MessageVersion,
@ -101,6 +106,7 @@ pub mod metric_behaviour {
pub struct ChallengeAttemptCount;
pub struct ChallengeSuccessCount;
pub struct AuthenticationErrorMessage;
pub struct AuthenticationFunnel;
}
impl From<AuthEventMetrics> for NameDescription {
@ -125,6 +131,7 @@ impl From<AuthEventDimensions> for NameDescription {
pub struct AuthEventMetricsBucketIdentifier {
pub authentication_status: Option<AuthenticationStatus>,
pub trans_status: Option<TransactionStatus>,
pub authentication_type: Option<DecoupledAuthenticationType>,
pub error_message: Option<String>,
pub authentication_connector: Option<AuthenticationConnectors>,
pub message_version: Option<String>,
@ -140,6 +147,7 @@ impl AuthEventMetricsBucketIdentifier {
pub fn new(
authentication_status: Option<AuthenticationStatus>,
trans_status: Option<TransactionStatus>,
authentication_type: Option<DecoupledAuthenticationType>,
error_message: Option<String>,
authentication_connector: Option<AuthenticationConnectors>,
message_version: Option<String>,
@ -148,6 +156,7 @@ impl AuthEventMetricsBucketIdentifier {
Self {
authentication_status,
trans_status,
authentication_type,
error_message,
authentication_connector,
message_version,
@ -161,6 +170,7 @@ impl Hash for AuthEventMetricsBucketIdentifier {
fn hash<H: Hasher>(&self, state: &mut H) {
self.authentication_status.hash(state);
self.trans_status.hash(state);
self.authentication_type.hash(state);
self.authentication_connector.hash(state);
self.message_version.hash(state);
self.error_message.hash(state);

View File

@ -114,6 +114,10 @@ pub enum SdkEventNames {
ThreeDsMethod,
LoaderChanged,
DisplayThreeDsSdk,
ThreeDsSdkInit,
AreqParamsGeneration,
ChallengePresented,
ChallengeComplete,
}
pub mod metric_behaviour {