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