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
| Field | Type | Req | Description |
|---|---|---|---|
custom_data | CustomData | — | |
stack | Int | — | Stack 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) |
tax | Float | ✓ | Tax percentage |
type_ | String | ✓ | Type 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
-
TaxRate( custom_data: option.Option(custom_data.CustomData), stack: option.Option(Int), tax: Float, type_: String, )
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.