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

//! Liquidity event entity.

/// Persisted normalized liquidity event row.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, sqlx::FromRow)]
pub struct LiquidityEventEntity {
    /// Numeric primary key.
    pub id: i64,
    /// Optional related transaction id.
    pub transaction_id: std::option::Option<i64>,
    /// Optional related decoded DEX event id.
    pub decoded_event_id: std::option::Option<i64>,
    /// Related DEX id.
    pub dex_id: i64,
    /// Related pool id.
    pub pool_id: i64,
    /// Optional related pair id.
    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>,
    /// Optional program id that emitted the decoded event.
    pub program_id: std::option::Option<std::string::String>,
    /// Event kind stored as stable integer.
    pub event_kind: i16,
    /// Optional original decoded event kind.
    pub event_kind_text: std::option::Option<std::string::String>,
    /// Optional actor wallet.
    pub actor_wallet: std::option::Option<std::string::String>,
    /// Base token id.
    pub base_token_id: i64,
    /// Quote token id.
    pub quote_token_id: i64,
    /// Optional LP token id.
    pub lp_token_id: std::option::Option<i64>,
    /// Base amount as decimal text.
    pub base_amount: std::string::String,
    /// Quote amount as decimal text.
    pub quote_amount: std::string::String,
    /// Optional LP amount as decimal text.
    pub lp_amount: std::option::Option<std::string::String>,
    /// Whether the persisted amount fields are complete.
    pub amounts_are_complete: std::option::Option<i64>,
    /// Optional source decoded payload JSON.
    pub payload_json: std::option::Option<std::string::String>,
    /// Execution timestamp encoded as RFC3339 UTC text.
    pub executed_at: std::string::String,
    /// Optional creation timestamp encoded as RFC3339 UTC text.
    pub created_at: std::option::Option<std::string::String>,
}
