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

//! Wallet-holding entity.

/// Persisted wallet-holding row.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, sqlx::FromRow)]
pub struct WalletHoldingEntity {
    /// Numeric primary key.
    pub id: i64,
    /// Related wallet id.
    pub wallet_id: i64,
    /// Related token id.
    pub token_id: i64,
    /// First transaction id that observed this wallet/token relationship.
    pub first_transaction_id: i64,
    /// Last transaction id that observed this wallet/token relationship.
    pub last_transaction_id: i64,
    /// Optional last decoded-event id.
    pub last_decoded_event_id: std::option::Option<i64>,
    /// Optional last related pool id.
    pub last_pool_id: std::option::Option<i64>,
    /// Optional last related pair id.
    pub last_pair_id: std::option::Option<i64>,
    /// Optional last observed role.
    pub last_role: std::option::Option<std::string::String>,
    /// Optional last observed raw balance-like value.
    pub balance_raw: std::option::Option<std::string::String>,
    /// Optional last observed slot.
    pub last_slot_observed: std::option::Option<i64>,
    /// Observation source kind.
    pub source_kind: i16,
    /// Optional logical source endpoint name.
    pub source_endpoint_name: std::option::Option<std::string::String>,
    /// Creation timestamp encoded as RFC3339 UTC text.
    pub created_at: std::string::String,
    /// Update timestamp encoded as RFC3339 UTC text.
    pub updated_at: std::string::String,
}
