use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum BlockingReason {
PendingPayment,
InsufficientDocuments,
InsufficientCredits,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[non_exhaustive]
pub struct CostBreakdownItem {
pub code: String,
pub name: String,
pub cost: f64,
pub quantity: f64,
pub unit_cost: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[non_exhaustive]
pub struct CostEstimate {
#[serde(default)]
pub documents: f64,
#[serde(default)]
pub credits: f64,
#[serde(default)]
pub needs_extra_document: bool,
#[serde(default)]
pub extra_document_cost: f64,
#[serde(default)]
pub total_credits: f64,
#[serde(default)]
pub breakdown: Vec<CostBreakdownItem>,
#[serde(default)]
pub document_balance: f64,
#[serde(default)]
pub credit_balance: f64,
#[serde(default)]
pub has_sufficient_resources: bool,
#[serde(default)]
pub blocking_reason: Option<BlockingReason>,
#[serde(default)]
pub message: Option<String>,
}