From b3d5062dc07676ec12e903b1999fdd9138c0891d Mon Sep 17 00:00:00 2001 From: Sampras Lopes Date: Fri, 10 Nov 2023 17:13:29 +0530 Subject: [PATCH] refactor(events): update api events to follow snake case naming (#2828) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- crates/common_utils/src/events.rs | 2 +- crates/router/src/events/api_logs.rs | 1 + crates/router/src/services/authentication.rs | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/common_utils/src/events.rs b/crates/common_utils/src/events.rs index 8c52f6c36d63..753f1deeb676 100644 --- a/crates/common_utils/src/events.rs +++ b/crates/common_utils/src/events.rs @@ -8,7 +8,7 @@ pub trait ApiEventMetric { } #[derive(Clone, Debug, Eq, PartialEq, Serialize)] -#[serde(tag = "flow_type")] +#[serde(tag = "flow_type", rename_all = "snake_case")] pub enum ApiEventsType { Payout, Payment { diff --git a/crates/router/src/events/api_logs.rs b/crates/router/src/events/api_logs.rs index 1a47568e7ad8..873102e81ec2 100644 --- a/crates/router/src/events/api_logs.rs +++ b/crates/router/src/events/api_logs.rs @@ -22,6 +22,7 @@ use crate::{ }; #[derive(Clone, Debug, Eq, PartialEq, Serialize)] +#[serde(rename_all = "snake_case")] pub struct ApiEvent { api_flow: String, created_at_timestamp: i128, diff --git a/crates/router/src/services/authentication.rs b/crates/router/src/services/authentication.rs index faa7864aff5b..0a7f5189b904 100644 --- a/crates/router/src/services/authentication.rs +++ b/crates/router/src/services/authentication.rs @@ -29,7 +29,11 @@ pub struct AuthenticationData { } #[derive(Clone, Debug, Eq, PartialEq, Serialize)] -#[serde(tag = "api_auth_type")] +#[serde( + tag = "api_auth_type", + content = "authentication_data", + rename_all = "snake_case" +)] pub enum AuthenticationType { ApiKey { merchant_id: String,