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

//! On-chain observation entity.

/// Persisted on-chain observation row.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, sqlx::FromRow)]
pub struct OnchainObservationEntity {
    /// Numeric primary key.
    pub id: i64,
    /// Observation kind.
    pub observation_kind: std::string::String,
    /// Observation source family stored as stable integer.
    pub source_kind: i16,
    /// Optional source endpoint logical name.
    pub endpoint_name: std::option::Option<std::string::String>,
    /// Logical object key, for example a mint, signature or pool address.
    pub object_key: std::string::String,
    /// Optional slot number.
    pub slot: std::option::Option<i64>,
    /// JSON-encoded raw payload.
    pub payload_json: std::string::String,
    /// Observation timestamp encoded as RFC3339 UTC text.
    pub observed_at: std::string::String,
}
