ocpp/v2_1/datatype/tax_rule

OCPP 2.1 TaxRule data type (schema TaxRuleType).

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

Types

Part of ISO 15118-20 price schedule.

FieldTypeReqDescription
applies_to_energy_feeBoolIndicates whether this tax applies to Energy Fees.
applies_to_minimum_maximum_costBoolIndicates whether this tax applies to Minimum/Maximum Cost.
applies_to_overstay_feeBoolIndicates whether this tax applies to Overstay Fees.
applies_to_parking_feeBoolIndicates whether this tax applies to Parking Fees.
custom_dataCustomData
tax_included_in_priceBoolIndicates whether the tax is included in any price or not.
tax_rateRationalNumber
tax_rule_idIntId for the tax rule. (≥ 0)
tax_rule_nameStringHuman readable string to identify the tax rule. (max 100 chars)

Schema: TaxRuleType

pub type TaxRule {
  TaxRule(
    applies_to_energy_fee: Bool,
    applies_to_minimum_maximum_cost: Bool,
    applies_to_overstay_fee: Bool,
    applies_to_parking_fee: Bool,
    custom_data: option.Option(custom_data.CustomData),
    tax_included_in_price: option.Option(Bool),
    tax_rate: rational_number.RationalNumber,
    tax_rule_id: Int,
    tax_rule_name: option.Option(String),
  )
}

Constructors

Values

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

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

pub fn new(
  applies_to_energy_fee applies_to_energy_fee: Bool,
  applies_to_minimum_maximum_cost applies_to_minimum_maximum_cost: Bool,
  applies_to_overstay_fee applies_to_overstay_fee: Bool,
  applies_to_parking_fee applies_to_parking_fee: Bool,
  tax_rate tax_rate: rational_number.RationalNumber,
  tax_rule_id tax_rule_id: Int,
) -> TaxRule

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

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

Encode a TaxRule to its OCPP-J JSON object.

Search Document