use serde::{Deserialize, Serialize};
use std::collections::HashMap;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AuditEnvelope {
    pub id: String,
    pub request_id: String,
    pub action: String,

    pub identity_subject: String,
    pub identity_roles: Vec<String>,

    pub payload: HashMap<String, serde_json::Value>,
    pub result: HashMap<String, serde_json::Value>,
    pub giu_cost: i64,

    pub state_hash_before: Option<String>,
    pub state_hash_after: Option<String>,

    pub created_at: String,

    pub transcript_hash: String,
    pub signature: String,
    pub signer: HashMap<String, String>,

    pub prev_envelope_hash: Option<String>,
    pub record_hash: String,
}
