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

//! Protocol candidate entity.

/// Persisted protocol candidate row.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, sqlx::FromRow)]
pub struct ProtocolCandidateEntity {
    /// Numeric primary key.
    pub id: i64,
    /// Related chain transaction id.
    pub transaction_id: i64,
    /// Optional related chain instruction id.
    pub instruction_id: std::option::Option<i64>,
    /// Transaction signature.
    pub signature: std::string::String,
    /// Optional Solana slot.
    pub slot: std::option::Option<i64>,
    /// Program id observed in the transaction instruction.
    pub program_id: std::string::String,
    /// Optional program name hint from parsed transaction data.
    pub program_name_hint: std::option::Option<std::string::String>,
    /// Optional candidate protocol code.
    pub candidate_protocol: std::option::Option<std::string::String>,
    /// Optional candidate surface code.
    pub candidate_surface: std::option::Option<std::string::String>,
    /// Human-readable reason.
    pub reason: std::string::String,
    /// Serialized JSON evidence.
    pub evidence_json: std::string::String,
    /// Creation timestamp encoded as RFC3339 UTC text.
    pub created_at: std::string::String,
}
