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

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, FromRow)]
pub struct AgentTokenUsageModel {
    pub id: Uuid,
    pub invocation: Uuid,
    pub session: Uuid,
    pub model_version: Uuid,
    pub input_tokens: i64,
    pub output_tokens: i64,
    pub cached_input_tokens: i64,
    pub cache_read_tokens: Option<i64>,
    pub cache_write_tokens: Option<i64>,
    pub reasoning_tokens: Option<i64>,
    pub total_tokens: i64,
    pub cost: Option<Decimal>,
    pub currency: Option<String>,
    pub created_at: DateTime<Utc>,
}
