// file: kb_lib/src/db/entities/dex_decoded_event.rs

//! Database entity for one decoded DEX event.

/// Persisted decoded DEX event row.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, sqlx::FromRow)]
pub struct DexDecodedEventEntity {
    /// Internal row id.
    pub id: i64,
    /// Parent transaction id.
    pub transaction_id: i64,
    /// Optional parent instruction id.
    pub instruction_id: std::option::Option<i64>,
    /// Decoded protocol name.
    pub protocol_name: std::string::String,
    /// Program id that produced the decoded event.
    pub program_id: std::string::String,
    /// Event kind.
    pub event_kind: std::string::String,
    /// Optional decoded pool account.
    pub pool_account: std::option::Option<std::string::String>,
    /// Optional decoded lp mint.
    pub lp_mint: std::option::Option<std::string::String>,
    /// Optional decoded token A mint.
    pub token_a_mint: std::option::Option<std::string::String>,
    /// Optional decoded token B mint.
    pub token_b_mint: std::option::Option<std::string::String>,
    /// Optional decoded market account.
    pub market_account: std::option::Option<std::string::String>,
    /// Serialized decoded payload.
    pub payload_json: std::string::String,
    /// Creation timestamp.
    pub created_at: std::string::String,
}
