ocpi_kit/v2_3_0/mod.rs
1//! The OCPI **2.3.0** wire model: the canonical model of this crate.
2//!
3//! Every other version in `ocpi-kit` is described as a delta from this one — [`crate::v2_2_1`]
4//! re-exports the types that are byte-identical and defines only what changed, and
5//! [`crate::convert`] carries objects between them with an explicit account of what was lost.
6//!
7//! # What 2.3.0 added
8//!
9//! | Area | Change |
10//! |---|---|
11//! | [`payments`] | new module: payment terminals and financial advice confirmations |
12//! | [`types::Price`] | `{before_taxes, taxes[]}` replaces 2.2.1's `{excl_vat, incl_vat}` |
13//! | [`tariffs::TaxIncluded`] | new required `Tariff.tax_included`, for North American tax rules |
14//! | [`tariffs::PriceLimit`] | `min_price`/`max_price` gained an `after_taxes` bound |
15//! | [`locations::Parking`] | new object, for EU AFIR reporting to National Access Points |
16//! | [`locations::ConnectorType`] | became an `OpenEnum`, and gained `MCS` |
17//! | [`locations::ConnectorCapability`] | new: ISO 15118-2 / -20 Plug & Charge |
18//! | [`tokens::TokenType`] | became an `OpenEnum`, and gained `EMAID` |
19//! | [`types::Role`] | `HUB` **removed**; a hub is now `Credentials.hub_party_id` |
20//! | [`credentials::Credentials`] | gained `hub_party_id` |
21//! | [`locations::Location`] | gained `help_phone` |
22//!
23//! # Conventions used throughout
24//!
25//! * Every object carries an `extensions` field: undocumented JSON is preserved, never dropped.
26//! * A field the spec marks optional (`?`) is an `Option`; a list (`*` or `+`) is a `Vec`, and
27//! the `+` cardinality is checked by [`Validate`](crate::types::Validate) rather than by the
28//! type system, so a peer's under-filled object still decodes.
29//! * A field named `type` on the wire is spelled out in Rust — `token_type`, `image_type`,
30//! `tariff_type` — and carries `#[serde(rename = "type")]`.
31//! * Objects that are more than a handful of fields have a compile-time-checked builder:
32//! `Location::builder().country_code("NL")…build()`.
33//!
34//! Spec: <https://github.com/ocpi/ocpi>, `release-2.3.0-bugfixes`
35
36pub mod cdrs;
37pub mod charging_profiles;
38pub mod commands;
39pub mod credentials;
40pub mod hub_client_info;
41pub mod locations;
42pub mod payments;
43pub mod sessions;
44pub mod tariffs;
45pub mod tokens;
46pub mod types;
47pub mod versions;
48
49#[cfg(feature = "bookings")]
50#[cfg_attr(docsrs, doc(cfg(feature = "bookings")))]
51pub mod bookings;
52
53#[cfg(feature = "invoice-reconciliation")]
54#[cfg_attr(docsrs, doc(cfg(feature = "invoice-reconciliation")))]
55pub mod invoice_reconciliation;
56
57pub use cdrs::Cdr;
58pub use credentials::Credentials;
59pub use locations::{Connector, Evse, Location};
60pub use payments::{FinancialAdviceConfirmation, Terminal};
61
62#[cfg(feature = "bookings")]
63pub use bookings::{Booking, BookingLocation, Calendar};
64
65#[cfg(feature = "invoice-reconciliation")]
66pub use invoice_reconciliation::{InvoiceReconciliationRecord, Reconciliation, reconcile};
67pub use sessions::Session;
68pub use tariffs::Tariff;
69pub use tokens::Token;
70pub use types::{Price, Role, TaxAmount};
71pub use versions::{Endpoint, Version, VersionDetails};
72
73/// The version number this module implements.
74pub const VERSION: crate::VersionNumber = crate::VersionNumber::V2_3_0;