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

This commit is contained in:
Shivansh Mathur
2025-08-06 17:36:32 +05:30
committed by GitHub
parent 640d0552f9
commit c6fcf29f69
5 changed files with 15 additions and 15 deletions

View File

@ -29,9 +29,9 @@ pub struct KafkaDisputeEvent<'a> {
pub connector_created_at: Option<OffsetDateTime>,
#[serde(default, with = "time::serde::timestamp::nanoseconds::option")]
pub connector_updated_at: Option<OffsetDateTime>,
#[serde(default, with = "time::serde::timestamp::nanoseconds")]
#[serde(with = "time::serde::timestamp::nanoseconds")]
pub created_at: OffsetDateTime,
#[serde(default, with = "time::serde::timestamp::nanoseconds")]
#[serde(with = "time::serde::timestamp::nanoseconds")]
pub modified_at: OffsetDateTime,
pub connector: &'a String,
pub evidence: &'a Secret<serde_json::Value>,

View File

@ -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(with = "time::serde::timestamp::nanoseconds")]
pub created_at: OffsetDateTime,
pub frm_name: &'a String,
pub frm_transaction_id: Option<&'a String>,
@ -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(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.

View File

@ -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>,

View File

@ -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(default, with = "time::serde::timestamp::nanoseconds::option")]
pub last_synced: Option<OffsetDateTime>,
pub setup_future_usage: storage_enums::FutureUsage,
pub off_session: bool,
@ -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(with = "time::serde::timestamp::nanoseconds")]
pub session_expiry: OffsetDateTime,
pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest,
pub frm_metadata: Option<Secret<&'a Value>>,

View File

@ -31,9 +31,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::nanoseconds")]
#[serde(with = "time::serde::timestamp::nanoseconds")]
pub created_at: OffsetDateTime,
#[serde(default, with = "time::serde::timestamp::nanoseconds")]
#[serde(with = "time::serde::timestamp::nanoseconds")]
pub modified_at: OffsetDateTime,
pub description: Option<&'a String>,
pub attempt_id: &'a String,
@ -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(with = "time::serde::timestamp::nanoseconds")]
pub created_at: OffsetDateTime,
#[serde(default, with = "time::serde::timestamp")]
#[serde(with = "time::serde::timestamp::nanoseconds")]
pub modified_at: OffsetDateTime,
pub description: Option<&'a String>,
pub attempt_id: &'a id_type::GlobalAttemptId,