use serde::{Deserialize, Serialize};
use super::{billing_period_enum::BillingPeriodEnum, billing_type::BillingType};
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct ExtraRecurringPlanFee {
pub billing_type: BillingType,
pub cadence: BillingPeriodEnum,
pub quantity: i32,
pub r#type: String,
pub unit_price: rust_decimal::Decimal,
#[serde(flatten)]
pub extra: serde_json::Map<String, serde_json::Value>,
}
impl ExtraRecurringPlanFee {
#[must_use]
pub fn new(
billing_type: BillingType,
cadence: BillingPeriodEnum,
quantity: i32,
unit_price: rust_decimal::Decimal,
) -> Self {
Self {
billing_type,
cadence,
quantity,
r#type: "EXTRA_RECURRING".into(),
unit_price,
extra: serde_json::Map::new(),
}
}
}