pub struct Cdr {Show 32 fields
pub country_code: CountryCode,
pub party_id: PartyId,
pub id: CiString<39>,
pub start_date_time: DateTime,
pub end_date_time: DateTime,
pub session_id: Option<CiString<36>>,
pub cdr_token: CdrToken,
pub auth_method: AuthMethod,
pub authorization_reference: Option<CiString<36>>,
pub booking_id: Option<CiString<36>>,
pub cdr_location: CdrLocation,
pub meter_id: Option<OcpiString<255>>,
pub currency: Currency,
pub tariffs: Vec<Tariff>,
pub charging_periods: Vec<ChargingPeriod>,
pub signed_data: Option<SignedData>,
pub total_cost: Price,
pub total_fixed_cost: Option<Price>,
pub total_energy: Number,
pub total_energy_cost: Option<Price>,
pub total_time: Number,
pub total_time_cost: Option<Price>,
pub total_parking_time: Option<Number>,
pub total_parking_cost: Option<Price>,
pub total_reservation_cost: Option<Price>,
pub remark: Option<OcpiString<255>>,
pub invoice_reference_id: Option<CiString<39>>,
pub credit: Option<bool>,
pub credit_reference_id: Option<CiString<39>>,
pub home_charging_compensation: Option<bool>,
pub last_updated: DateTime,
pub extensions: Extensions,
}v2_3_0 only.Expand description
A Charge Detail Record: one charging session and its costs.
Spec: 2.3.0 §mod_cdrs_cdr_object
Fields§
§country_code: CountryCodeISO-3166 alpha-2 country code of the CPO that ‘owns’ this CDR.
party_id: PartyIdID of the CPO that ‘owns’ this CDR.
id: CiString<39>Uniquely identifies the CDR, unique per country_code/party_id combination.
start_date_time: DateTimeStart of the charging session, or of the reservation when there was no session.
end_date_time: DateTimeWhen the session was completed. Charging may have finished earlier.
session_id: Option<CiString<36>>The Session this CDR belongs to.
Is only allowed to be omitted when the CPO has not implemented the Sessions module or this CDR is the result of a reservation that never became a charging session.
cdr_token: CdrTokenToken used to start this charging session.
auth_method: AuthMethodMethod used for authentication. The last method used during the session.
Reference to the authorization given by the eMSP.
booking_id: Option<CiString<36>>bookings only.The Booking this CDR also belongs to.
Is only allowed to be omitted when the Session was reserved.
Added by the OCPI 2.3.0 bookings release branch, so it is behind the bookings feature.
Spec: 2.3.0-bookings §mod_cdrs_cdr_object
cdr_location: CdrLocationWhere the charging session took place.
meter_id: Option<OcpiString<255>>Identification of the meter inside the Charge Point.
currency: CurrencyCurrency of the CDR in ISO 4217 code.
tariffs: Vec<Tariff>Relevant Tariffs, as they were at the start of the session.
charging_periods: Vec<ChargingPeriod>Charging Periods that make up this session. Cardinality +.
signed_data: Option<SignedData>Signed metering data belonging to this session.
total_cost: PriceTotal sum of all the costs of this transaction.
total_fixed_cost: Option<Price>Total of the fixed costs, except fixed price components of parking and reservation.
total_energy: NumberTotal energy charged, in kWh.
total_energy_cost: Option<Price>Total cost of all the energy used.
total_time: NumberTotal duration of the charging session, charging and not charging, in hours.
total_time_cost: Option<Price>Total cost related to the duration of charging.
total_parking_time: Option<Number>Total duration during which the EV was not charging, in hours.
total_parking_cost: Option<Price>Total cost related to parking, including fixed price components.
total_reservation_cost: Option<Price>Total cost related to a reservation, including fixed price components.
remark: Option<OcpiString<255>>Human-readable remark, e.g. the reason a transaction was stopped.
invoice_reference_id: Option<CiString<39>>Reference to an invoice that will later be sent for this CDR.
credit: Option<bool>Whether this is a Credit CDR. Requires credit_reference_id.
credit_reference_id: Option<CiString<39>>The id of the CDR this Credit CDR corrects.
home_charging_compensation: Option<bool>Whether the energy cost of this home-charging session is compensated to the EV driver.
last_updated: DateTimeTimestamp when this CDR was last updated (or created).
extensions: ExtensionsUndocumented JSON fields, preserved verbatim.
Implementations§
Source§impl Cdr
impl Cdr
Sourcepub fn builder() -> CdrBuilder
pub fn builder() -> CdrBuilder
Create an instance of Cdr using the builder syntax
Source§impl Cdr
impl Cdr
Sourcepub fn owner_party(&self) -> PartyRef
pub fn owner_party(&self) -> PartyRef
The CPO that owns this CDR.
Sourcepub fn total_charging_time(&self) -> Number
pub fn total_charging_time(&self) -> Number
The time the EV was actually charging, in hours.
The actual charging duration … can be calculated:
total_charging_time = total_time - total_parking_time.
Sourcepub fn dimension_total(&self, dimension: CdrDimensionType) -> Number
pub fn dimension_total(&self, dimension: CdrDimensionType) -> Number
The total volume of one dimension across every charging period.
Sourcepub fn has_placeholder_timestamps(&self) -> bool
pub fn has_placeholder_timestamps(&self) -> bool
Whether the timestamps are the 1970-1-1T00:00:00Z placeholder the spec permits.
If the MSP and CPO both agree that they accept CDRs that miss either or both the
start_date_timeandend_date_time… the CPO could send a CDR where thestart_date_timeand/orend_date_timeare set to “1970-1-1T00:00:00Z”.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cdr
impl<'de> Deserialize<'de> for Cdr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Cdr
impl JsonSchema for Cdr
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more