pub enum Warning {
Country(Warning),
CountryShouldBeAlpha2,
Currency(Warning),
DateTime(Warning),
Decode(Warning),
Duration(Warning),
Money(Warning),
NoPeriods,
Number(Warning),
PeriodsOutsideStartEndDateTime {
cdr_range: Range<Timestamp>,
period_range: PeriodRange,
},
String(Warning),
Rejected,
}Expand description
The faults build finds in a CDR’s values, such as a malformed timestamp or a CDR
without charging periods.
The faults in the CDR’s structure are the schema::Warnings that check returns. A fault
in the values of a tariff the CDR contains is a tariff::Warning, which Cdr::tariffs
returns.
Variants§
Country(Warning)
Raised while reading a country code.
CountryShouldBeAlpha2
The $.country_code field names an alpha-3 code where OCPI defines it as alpha-2.
The alpha-3 is read and converted to its alpha-2, so the CDR still prices. Only the CDR’s
own $.country_code raises this. A location.country is alpha-3 by definition and reports
timezone::Warning::LocationCountryShouldBeAlpha3 instead.
Currency(Warning)
Raised while reading a currency code.
DateTime(Warning)
Raised while reading a timestamp.
Decode(Warning)
Raised while decoding a JSON string’s escape sequences.
Duration(Warning)
Raised while reading a duration.
Money(Warning)
Raised while reading a price.
NoPeriods
The CDR has no charging periods.
Number(Warning)
Raised while reading a number.
PeriodsOutsideStartEndDateTime
The start_date_time of at least one of the charging_periods is outside of the
CDR’s start_date_time-end_date_time range.
Fields
period_range: PeriodRangeThe range the charging periods actually span.
String(Warning)
Raised while reading a string.
Rejected
A required field of a CDR object was missing or invalid, so the object couldn’t be read.
The schema warnings locate the cause (see warning::Rejected).