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

//! Pool administration event entity.

/// Persisted normalized pool administration event row.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, sqlx::FromRow)]
pub struct PoolAdminEventEntity {
    /// Numeric primary key.
    pub id: i64,
    /// Related transaction id.
    pub transaction_id: i64,
    /// Related decoded DEX event id, when available.
    pub decoded_event_id: std::option::Option<i64>,
    /// Related DEX id, when the DEX row is known.
    pub dex_id: std::option::Option<i64>,
    /// Related pool id, when the pool row is known.
    pub pool_id: std::option::Option<i64>,
    /// Related pair id, when the pair row is known.
    pub pair_id: std::option::Option<i64>,
    /// Transaction signature.
    pub signature: std::string::String,
    /// Optional slot number.
    pub slot: std::option::Option<i64>,
    /// Protocol name that emitted the decoded event.
    pub protocol_name: std::string::String,
    /// Program id that emitted the decoded event.
    pub program_id: std::string::String,
    /// Stable decoded event kind.
    pub event_kind: std::string::String,
    /// Pool account address, when decoded.
    pub pool_account: std::option::Option<std::string::String>,
    /// Wallet or authority associated with the admin event, when decoded.
    pub actor_wallet: std::option::Option<std::string::String>,
    /// Normalized admin action label, when available.
    pub admin_action: std::option::Option<std::string::String>,
    /// Source decoded payload JSON.
    pub payload_json: 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::string::String,
}
