Expand description
§OCPI Tariffs library
Calculate the (sub)totals of a charge session
using the cdr::price function and use the generated price::Report to review and compare the calculated
totals versus the sources from the CDR.
See the price::Report for a detailed list of all the fields that help analyze and valitate the pricing of a CDR.
- Use the
cdr::parseandtariff::parsefunction to parse and guess which OCPI version of a CDR or tariff you have. - Use the
cdr::parse_with_versionandtariff::parse_with_versionfunctions to parse a CDR of tariff as the given version. - Use the
tariff::lintto lint a tariff: flag common errors, bugs, dangerous constructs and stylistic flaws in the tariff.
Modules§
- cdr
- Module containing the functionality to price charge sessions with provided tariffs.
- country
- An ISO 3166-1 country code.
- currency
- guess
- json
- lint
- Both tariffs and CDRs can be linted - a term borrowed from software development where linting is the act of flagging common errors, bugs, dangerous constructs and stylistic flaws in a some code or data.
- price
- tariff
- timezone
- warning
- These types are the basis for writing functions that can emit a set of
Warnings based on the value they are trying to create.
Structs§
- Caveat
- A value that may have associated
Warnings. - Money
- A monetary amount, the currency is dependant on the specified tariff.
- OutOf
Range - Out of range error type used in various converting APIs
- Parse
Error - Errors that can happen if a JSON str is parsed.
- Price
- A price consisting of a value including VAT, and a value excluding VAT.
- Vat
- A VAT percentage.
- Warning
- Groups together a module’s
Kindand the associatedjson::Element.
Enums§
- Object
Type - The type of OCPI objects that can be parsed.
- Parse
Error Kind - The kind of Error that occurred.
- Version
- The OCPI versions supported by this crate
Traits§
- Unversioned
- An object with an uncertain
Version. - Verdict
Ext Verdictspecific extinsion methods for theResulttype.- Versioned
- An object for a specific OCPI
Version.
Type Aliases§
- Tariff
Id - The Id for a tariff used in the pricing of a CDR.
- Unexpected
Fields - Set of unexpected fields encountered while parsing a CDR or tariff.
- Verdict
- A
Verdictis a standardResultwithWarnings potentially issued for both theOkandErrvariants.