pub struct Cdr {Show 31 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 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_2_1 only.Expand description
A Charge Detail Record: one charging session and its costs, in OCPI 2.2.1.
Spec: 2.2.1 §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.
session_id: Option<CiString<36>>The Session this CDR belongs to.
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.
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, 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.
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.
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.
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