use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PricingConfig {
    pub id: i32,
    pub metric_type: String,
    pub unit: String,
    pub price_per_unit: f64,
    pub currency: String,
    pub is_active: bool,
}

#[derive(Debug, Deserialize)]
pub struct PricingConfigCreate {
    pub metric_type: String,
    pub unit: String,
    pub price_per_unit: f64,
    pub currency: String,
    pub is_active: bool,
}

#[derive(Debug, Serialize)]
pub struct Invoice {
    pub id: i32,
    pub customer_id: i32,
    pub subscription_id: i32,
    pub period_start: String,
    pub period_end: String,
    pub line_items: Vec<LineItem>,
    pub subtotal: f64,
    pub tax: f64,
    pub total: f64,
    pub currency: String,
    pub status: String,
}

#[derive(Debug, Serialize)]
pub struct LineItem {
    pub description: String,
    pub quantity: f64,
    pub unit: String,
    pub rate: f64,
    pub amount: f64,
}

#[derive(Debug, Serialize)]
pub struct InvoicePreview {
    pub customer_name: String,
    pub period_start: String,
    pub period_end: String,
    pub line_items: Vec<LineItem>,
    pub subtotal: f64,
    pub tax: f64,
    pub total: f64,
    pub currency: String,
}
