use serde::{Deserialize, Serialize};
use super::{price_component_id::PriceComponentId, price_entry::PriceEntry};
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct ComponentOverride {
pub component_id: PriceComponentId,
pub name: String,
pub price_entry: PriceEntry,
#[serde(flatten)]
pub extra: serde_json::Map<String, serde_json::Value>,
}
impl ComponentOverride {
#[must_use]
pub fn new(
component_id: impl Into<PriceComponentId>,
name: impl Into<String>,
price_entry: PriceEntry,
) -> Self {
Self {
component_id: component_id.into(),
name: name.into(),
price_entry,
extra: serde_json::Map::new(),
}
}
}