use serde::Deserialize;
use super::JsonObject;
#[derive(Debug, Clone, Default)]
pub struct CreateTraceParams {
pub label: String,
pub metadata: Option<JsonObject>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CreateTraceResponse {
pub trace_id: String,
pub status: String,
pub created_at: String,
pub label: String,
}
#[derive(Debug, Clone, Default)]
pub struct ListTracesParams {
pub page: Option<u32>,
pub limit: Option<u32>,
pub status: Option<String>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct TraceListItem {
pub trace_id: String,
pub label: String,
pub status: String,
pub event_count: Option<i64>,
pub created_at: String,
pub sealed_at: Option<String>,
pub composite_hash: Option<String>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct ListTracesResponse {
pub traces: Vec<TraceListItem>,
pub page: u32,
pub limit: u32,
pub total: u64,
pub has_more: bool,
}
#[derive(Debug, Clone, Deserialize)]
pub struct TraceEventSummary {
pub event_id: String,
pub event_type: String,
pub payload_hash: String,
pub ingested_at: String,
}
#[derive(Debug, Clone, Default)]
pub struct GetTraceParams {
pub event_page: Option<u32>,
pub event_limit: Option<u32>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct TraceDetail {
pub trace_id: String,
pub label: String,
pub status: String,
pub event_count: Option<i64>,
pub created_at: String,
pub sealed_at: Option<String>,
pub composite_hash: Option<String>,
pub seal_event_id: Option<String>,
#[serde(default)]
pub metadata: Option<JsonObject>,
pub events: Vec<TraceEventSummary>,
pub event_page: u32,
pub event_limit: u32,
pub event_total: u64,
pub event_has_more: bool,
}
#[derive(Debug, Clone, Deserialize)]
pub struct DeleteTraceResponse {
pub trace_id: String,
pub deleted: bool,
}
#[derive(Debug, Clone, Deserialize)]
pub struct SealTraceResponse {
pub trace_id: String,
pub status: String,
pub message: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct TraceProofEvent {
pub event_id: String,
pub event_type: String,
pub payload: JsonObject,
pub content_hash: String,
pub timestamp: String,
pub signature: String,
pub public_key: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct TraceProofSealEvent {
pub event_id: String,
pub event_type: String,
pub content_hash: String,
pub timestamp: String,
pub signature: String,
pub public_key: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct TraceProofVerification {
pub composite_hash_valid: bool,
pub all_signatures_valid: bool,
}
#[derive(Debug, Clone, Deserialize)]
pub struct TraceProofBundle {
pub version: String,
pub trace_id: String,
pub label: String,
pub tenant_domain: String,
pub status: String,
pub created_at: String,
pub sealed_at: String,
pub composite_hash: String,
pub event_count: u64,
pub events: Vec<TraceProofEvent>,
pub seal_event: TraceProofSealEvent,
pub verification: TraceProofVerification,
}