Skip to content

chore(events): making events nanosecond level precision #8759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 6, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/router/src/services/kafka/fraud_check_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct KafkaFraudCheckEvent<'a> {
pub payment_id: &'a common_utils::id_type::PaymentId,
pub merchant_id: &'a common_utils::id_type::MerchantId,
pub attempt_id: &'a String,
#[serde(default, with = "time::serde::timestamp::milliseconds")]
#[serde(default, with = "time::serde::timestamp::nanoseconds")]
pub created_at: OffsetDateTime,
pub frm_name: &'a String,
pub frm_transaction_id: Option<&'a String>,
Expand All @@ -22,7 +22,7 @@ pub struct KafkaFraudCheckEvent<'a> {
pub frm_error: Option<&'a String>,
pub payment_details: Option<serde_json::Value>,
pub metadata: Option<serde_json::Value>,
#[serde(default, with = "time::serde::timestamp::milliseconds")]
#[serde(default, with = "time::serde::timestamp::nanoseconds")]
pub modified_at: OffsetDateTime,
pub last_step: FraudCheckLastStep,
pub payment_capture_method: Option<storage_enums::CaptureMethod>, // In postFrm, we are updating capture method from automatic to manual. To store the merchant actual capture method, we are storing the actual capture method in payment_capture_method. It will be useful while approving the FRM decision.
Expand Down
6 changes: 3 additions & 3 deletions crates/router/src/services/kafka/payment_attempt_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ pub struct KafkaPaymentAttemptEvent<'a> {
pub payment_method: storage_enums::PaymentMethod,
pub connector_transaction_id: Option<&'a String>,
pub authentication_type: storage_enums::AuthenticationType,
#[serde(with = "time::serde::timestamp")]
#[serde(with = "time::serde::timestamp::nanoseconds")]
pub created_at: OffsetDateTime,
#[serde(with = "time::serde::timestamp")]
#[serde(with = "time::serde::timestamp::nanoseconds")]
pub modified_at: OffsetDateTime,
#[serde(default, with = "time::serde::timestamp::option")]
#[serde(default, with = "time::serde::timestamp::nanoseconds::option")]
pub last_synced: Option<OffsetDateTime>,
pub cancellation_reason: Option<&'a String>,
pub amount_to_capture: Option<MinorUnit>,
Expand Down
8 changes: 4 additions & 4 deletions crates/router/src/services/kafka/payment_intent_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ pub struct KafkaPaymentIntentEvent<'a> {
pub return_url: Option<&'a common_types::Url>,
pub metadata: Option<&'a Secret<Value>>,
pub statement_descriptor: Option<&'a common_types::StatementDescriptor>,
#[serde(with = "time::serde::timestamp")]
#[serde(with = "time::serde::timestamp::nanoseconds")]
pub created_at: OffsetDateTime,
#[serde(with = "time::serde::timestamp")]
#[serde(with = "time::serde::timestamp::nanoseconds")]
pub modified_at: OffsetDateTime,
#[serde(default, with = "time::serde::timestamp::option")]
#[serde(with = "time::serde::timestamp::nanoseconds::option")]
pub last_synced: Option<OffsetDateTime>,
pub setup_future_usage: storage_enums::FutureUsage,
pub off_session: bool,
Expand All @@ -97,7 +97,7 @@ pub struct KafkaPaymentIntentEvent<'a> {
pub surcharge_applicable: Option<bool>,
pub request_incremental_authorization: RequestIncrementalAuthorization,
pub authorization_count: Option<i32>,
#[serde(with = "time::serde::timestamp")]
#[serde(default, with = "time::serde::timestamp::nanoseconds::option")]
pub session_expiry: OffsetDateTime,
pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest,
pub frm_metadata: Option<Secret<&'a Value>>,
Expand Down
4 changes: 2 additions & 2 deletions crates/router/src/services/kafka/refund_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ pub struct KafkaRefundEvent<'a> {
pub sent_to_gateway: &'a bool,
pub refund_error_message: Option<&'a String>,
pub refund_arn: Option<&'a String>,
#[serde(default, with = "time::serde::timestamp")]
#[serde(default, with = "time::serde::timestamp::nanoseconds")]
pub created_at: OffsetDateTime,
#[serde(default, with = "time::serde::timestamp")]
#[serde(default, with = "time::serde::timestamp::nanoseconds")]
pub modified_at: OffsetDateTime,
pub description: Option<&'a String>,
pub attempt_id: &'a id_type::GlobalAttemptId,
Expand Down
Loading