use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use crate::{Dollars, Height, Sats, Timestamp};

/// A single block fees data point.
#[derive(Debug, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct BlockFeesEntry {
    /// Average block height in this window
    #[schemars(example = 890621)]
    pub avg_height: Height,
    /// Unix timestamp at the window midpoint
    #[schemars(example = 1743631892)]
    pub timestamp: Timestamp,
    /// Average fees per block in this window (sats)
    #[schemars(example = 3215861)]
    pub avg_fees: Sats,
    /// BTC/USD price at this height
    #[serde(rename = "USD")]
    #[schemars(example = 84342.12)]
    pub usd: Dollars,
}
