Crate ocpi_tariffs

Crate ocpi_tariffs 

Source
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.

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.
ParseError
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 Kind and the associated json::Element.

Enums§

ObjectType
The type of OCPI objects that can be parsed.
ParseErrorKind
The kind of Error that occurred.
Version
The OCPI versions supported by this crate

Traits§

Unversioned
An object with an uncertain Version.
VerdictExt
Verdict specific extinsion methods for the Result type.
Versioned
An object for a specific OCPI Version.

Type Aliases§

TariffId
The Id for a tariff used in the pricing of a CDR.
UnexpectedFields
Set of unexpected fields encountered while parsing a CDR or tariff.
Verdict
A Verdict is a standard Result with Warnings potentially issued for both the Ok and Err variants.