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

//! Database entity for one resolved Solana transaction.

/// Persisted Solana transaction row.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, sqlx::FromRow)]
pub struct ChainTransactionEntity {
    /// Internal row id.
    pub id: i64,
    /// Transaction signature.
    pub signature: std::string::String,
    /// Optional slot number.
    pub slot: std::option::Option<i64>,
    /// Optional block time in unix seconds.
    pub block_time_unix: std::option::Option<i64>,
    /// Optional logical endpoint name that resolved the transaction.
    pub source_endpoint_name: std::option::Option<std::string::String>,
    /// Optional version text.
    pub version_text: std::option::Option<std::string::String>,
    /// Optional transaction error JSON.
    pub err_json: std::option::Option<std::string::String>,
    /// Optional transaction meta JSON.
    pub meta_json: std::option::Option<std::string::String>,
    /// Full transaction JSON.
    pub transaction_json: std::string::String,
    /// Creation timestamp.
    pub created_at: std::string::String,
    /// Update timestamp.
    pub updated_at: std::string::String,
}
