ocpp/v2_1/datatype/tax_rate

OCPP 2.1 TaxRate data type (schema TaxRateType).

to_json/decoder map to/from its OCPP-J JSON object; new (when present) builds a value from the required fields only.

Types

Tax percentage

FieldTypeReqDescription
custom_dataCustomData
stackIntStack level for this type of tax. Default value, when absent, is 0. + stack = 0: tax on net price; + stack = 1: tax added on top of stack 0; + stack = 2: tax added on top of stack 1, etc. (≥ 0)
taxFloatTax percentage
type_StringType of this tax, e.g. “Federal “, “State”, for information on receipt. (max 20 chars)

Schema: TaxRateType

pub type TaxRate {
  TaxRate(
    custom_data: option.Option(custom_data.CustomData),
    stack: option.Option(Int),
    tax: Float,
    type_: String,
  )
}

Constructors

Values

pub fn decoder() -> decode.Decoder(TaxRate)

Decode a TaxRate from its OCPP-J JSON object, enforcing schema constraints.

pub fn new(tax tax: Float, type_ type_: String) -> TaxRate

Construct a TaxRate from its required fields, with every optional field set to None.

pub fn to_json(value: TaxRate) -> json.Json

Encode a TaxRate to its OCPP-J JSON object.

Search Document