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

//! Fee event amount entity.

/// Persisted normalized fee event amount leg row.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, sqlx::FromRow)]
pub struct FeeEventAmountEntity {
    /// Numeric primary key.
    pub id: i64,
    /// Related parent fee event id.
    pub fee_event_id: i64,
    /// Related transaction id.
    pub transaction_id: i64,
    /// Related decoded DEX event id, when available.
    pub decoded_event_id: std::option::Option<i64>,
    /// Stable leg index within one parent fee event.
    pub leg_index: i64,
    /// Fee component kind or semantic role.
    pub fee_component_kind: std::string::String,
    /// Token mint used by this fee amount leg.
    pub token_mint: std::string::String,
    /// Raw amount for this leg as decimal text.
    pub amount_raw: std::string::String,
    /// Source token account or lamport account, when decoded.
    pub source_account: std::option::Option<std::string::String>,
    /// Destination token account or lamport account, when decoded.
    pub destination_account: std::option::Option<std::string::String>,
    /// Extraction source used to prove this amount.
    pub amount_source: std::string::String,
    /// Source/proof payload JSON.
    pub payload_json: std::string::String,
    /// Creation timestamp encoded as RFC3339 UTC text.
    pub created_at: std::string::String,
}
