use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use sqlx::FromRow;
use uuid::Uuid;

/// A row from `paper_run_condition_audit`, one per (bar, rule).
#[derive(Debug, Clone, FromRow, Serialize, Deserialize)]
pub struct ConditionAuditRow {
    pub id: i64,
    pub run_id: Uuid,
    pub bar_index: i32,
    pub bar_time: DateTime<Utc>,
    pub rule_index: i16,
    pub rule_fired: bool,
    /// JSONB array of `ConditionAudit` objects from `paper_executor::strategy::audit`.
    pub conditions: serde_json::Value,
}
