This crate provides a binary for doing calculations with OCPI
tariffs. Specifically for the OCPI 2.2.1
version.
text
cargo install ocpi-tariffs-cli
The binary can be directly executed using ocpi-tariffs
. Execute ocpi-tariffs --help
for a list of subcommands.
To price a tariff and CDR (Charge detail record) and see a breakdown of the separate periods use analyze
:
```text Analyze a given charge detail record (CDR) against either a provided tariff structure or a tariff that is contained in the CDR itself.
This command will show you a breakdown of all the calculated costs.
Usage: ocpi-tariffs analyze [OPTIONS]
Options:
-c, --cdr
If no path is provided the CDR is read from standard in.
-t, --tariff
If no path is provided, then the tariff is inferred to be contained inside the provided CDR. If the CDR contains multiple tariff structures, the first valid tariff will be used.
-z, --timezone
[default: Europe/Amsterdam]
-h, --help Print help (see a summary with '-h') ```
To price a tariff and CDR and check if the calculation differs from the original CDR use validate
:
```text Validate a given charge detail record (CDR) against either a provided tariff structure or a tariff that is contained in the CDR itself.
This command will show the differences between the calculated totals and the totals contained in the provided CDR.
Usage: ocpi-tariffs validate [OPTIONS]
Options:
-c, --cdr
If no path is provided the CDR is read from standard in.
-t, --tariff
If no path is provided, then the tariff is inferred to be contained inside the provided CDR. If the CDR contains multiple tariff structures, the first valid tariff will be used.
-z, --timezone
[default: Europe/Amsterdam]
-h, --help Print help (see a summary with '-h') ```