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

//! Database entity for DEX decode replay ledger rows.

/// Persisted replay ledger row for one transaction and decoder version.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, sqlx::FromRow)]
pub struct DexDecodeReplayLedgerEntity {
    /// Internal row id.
    pub id: i64,
    /// Related chain transaction id.
    pub transaction_id: i64,
    /// Transaction signature.
    pub signature: std::string::String,
    /// Logical decoder scope.
    pub decoder_scope: std::string::String,
    /// Logical decoder version.
    pub decoder_version: std::string::String,
    /// Decode status.
    pub decode_status: std::string::String,
    /// Certainty level used by replay skip logic.
    pub certainty: std::string::String,
    /// Number of decoded events produced by this decoder pass.
    pub event_count: i64,
    /// Number of distinct token mints observed in decoded event mint fields.
    pub distinct_token_mint_count: i64,
    /// Whether replay must force decode for safety.
    pub force_replay_required: i64,
    /// Optional status reason.
    pub status_reason: std::option::Option<std::string::String>,
    /// Creation timestamp.
    pub created_at: std::string::String,
    /// Update timestamp.
    pub updated_at: std::string::String,
}
