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.
| Field | Type | Req | Description |
|---|---|---|---|
applies_to_energy_fee | Bool | ✓ | Indicates whether this tax applies to Energy Fees. |
applies_to_minimum_maximum_cost | Bool | ✓ | Indicates whether this tax applies to Minimum/Maximum Cost. |
applies_to_overstay_fee | Bool | ✓ | Indicates whether this tax applies to Overstay Fees. |
applies_to_parking_fee | Bool | ✓ | Indicates whether this tax applies to Parking Fees. |
custom_data | CustomData | — | |
tax_included_in_price | Bool | — | Indicates whether the tax is included in any price or not. |
tax_rate | RationalNumber | ✓ | |
tax_rule_id | Int | ✓ | Id for the tax rule. (≥ 0) |
tax_rule_name | String | — | Human 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
-
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), )
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.