pub struct PriceComponent {
pub component_type: TariffDimensionType,
pub price: Number,
pub vat: Option<Number>,
pub step_size: u32,
pub extensions: Extensions,
}v2_3_0 only.Expand description
How consumption of one dimension translates into money owed.
Spec: 2.3.0 §mod_tariffs_pricecomponent_class
Fields§
§component_type: TariffDimensionTypeThe dimension that is being priced.
price: NumberPrice per unit for this dimension, including or excluding taxes according to the
containing Tariff’s tax_included field.
vat: Option<Number>Applicable VAT percentage for this dimension. If omitted, no VAT is applicable.
step_size: u32Minimum amount to be billed: the dimension is billed in blocks of this size.
NOTE: The
step_sizefield is no longer present in OCPI 3.0. … Users of OCPI 2.2.1 looking to be ready for a transition to OCPI 3.0 … are advised to effectively avoid usingstep_sizeby settingstep_sizeto 1 always.
The unit is the dimension’s step_size multiplier: 1 Wh for ENERGY, 1 second for the
time dimensions, and nothing for FLAT. See TariffDimensionType::step_size_unit.
extensions: ExtensionsUndocumented JSON fields, preserved verbatim.
Implementations§
Source§impl PriceComponent
impl PriceComponent
Sourcepub fn builder() -> PriceComponentBuilder
pub fn builder() -> PriceComponentBuilder
Create an instance of PriceComponent using the builder syntax
Source§impl PriceComponent
impl PriceComponent
Sourcepub fn new(component_type: TariffDimensionType, price: Number) -> Self
pub fn new(component_type: TariffDimensionType, price: Number) -> Self
A price component with no VAT and a step_size of 1.
Trait Implementations§
Source§impl Clone for PriceComponent
impl Clone for PriceComponent
Source§fn clone(&self) -> PriceComponent
fn clone(&self) -> PriceComponent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PriceComponent
impl Debug for PriceComponent
Source§impl<'de> Deserialize<'de> for PriceComponent
impl<'de> Deserialize<'de> for PriceComponent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for PriceComponent
impl JsonSchema for PriceComponent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more