use rust_decimal::Decimal;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SpendAnalysis {
pub category_id: String,
pub category_name: String,
pub company_code: String,
#[serde(with = "crate::serde_decimal")]
pub total_spend: Decimal,
pub vendor_count: u32,
pub transaction_count: u32,
pub hhi_index: f64,
pub vendor_shares: Vec<VendorSpendShare>,
pub contract_coverage: f64,
pub preferred_vendor_coverage: f64,
pub price_trend_pct: f64,
pub fiscal_year: u16,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VendorSpendShare {
pub vendor_id: String,
pub vendor_name: String,
#[serde(with = "crate::serde_decimal")]
pub spend_amount: Decimal,
pub share: f64,
pub is_preferred: bool,
}