rust_ocpp/v2_0_1/messages/
cost_updated.rs

1//! CostUpdated
2use rust_decimal::Decimal;
3use validator::Validate;
4
5/// CostUpdatedRequest, sent by the CSMS to the Charging Station.
6///
7/// With this request the CSMS can send the current cost of a transaction to a Charging Station.
8#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
9#[serde(rename_all = "camelCase")]
10pub struct CostUpdatedRequest {
11    /// Current total cost, based on the information known by the CSMS, of the transaction including taxes. In the currency configured with the configuration Variable: [Currency]
12    #[serde(with = "rust_decimal::serde::arbitrary_precision")]
13    pub total_cost: Decimal,
14    /// Transaction Id of the transaction the current cost are asked for.
15    #[validate(length(min = 0, max = 36))]
16    pub transaction_id: String,
17}
18
19/// CostUpdatedResponse, sent by the Charging Station to the CSMS in response to [`CostUpdatedRequest`].
20///
21/// No fields are defined.
22#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
23#[serde(rename_all = "camelCase")]
24pub struct CostUpdatedResponse {
25    // No fields are defined.
26}