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

//! Token account event entity.

/// Persisted normalized token-account event row.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, sqlx::FromRow)]
pub struct TokenAccountEventEntity {
    /// Numeric primary key.
    pub id: i64,
    /// Related transaction id.
    pub transaction_id: std::option::Option<i64>,
    /// Related decoded event id.
    pub decoded_event_id: std::option::Option<i64>,
    /// Related DEX id.
    pub dex_id: std::option::Option<i64>,
    /// Related pool id, when known.
    pub pool_id: std::option::Option<i64>,
    /// Related pair id, when known.
    pub pair_id: std::option::Option<i64>,
    /// Transaction signature.
    pub signature: std::string::String,
    /// Instruction index inside the transaction.
    pub instruction_index: i64,
    /// Optional slot number.
    pub slot: std::option::Option<i64>,
    /// Protocol name.
    pub protocol_name: std::string::String,
    /// Program id.
    pub program_id: std::option::Option<std::string::String>,
    /// Event kind.
    pub event_kind: std::string::String,
    /// Token account, when known.
    pub token_account: std::option::Option<std::string::String>,
    /// Token mint, when known.
    pub token_mint: std::option::Option<std::string::String>,
    /// Owner wallet, when known.
    pub owner_wallet: std::option::Option<std::string::String>,
    /// Token-account action.
    pub account_action: std::option::Option<std::string::String>,
    /// Raw decoded payload.
    pub payload_json: std::option::Option<std::string::String>,
    /// Execution timestamp encoded as RFC3339 UTC text.
    pub executed_at: std::string::String,
    /// Creation timestamp encoded as RFC3339 UTC text.
    pub created_at: std::option::Option<std::string::String>,
}
