conversions2

This commit is contained in:
Filipriec
2026-08-23 09:39:18 +02:00
parent 5f2069784d
commit 3a34092e4c
4 changed files with 61 additions and 19 deletions

Binary file not shown.

View File

@@ -10,9 +10,10 @@ pub struct ExchangeRateSelection {
/// Required for SPECIFIC_PUBLICATION_DATE and MANUAL; YYYY-MM-DD.
#[prost(string, optional, tag = "3")]
pub specific_rate_date: ::core::option::Option<::prost::alloc::string::String>,
/// Required only for MANUAL. Exact foreign-currency units per EUR.
/// Required only for MANUAL. Exact foreign-currency units per one unit of
/// the rate source's pivot currency (EUR for ECB).
#[prost(string, optional, tag = "4")]
pub manual_units_per_eur: ::core::option::Option<::prost::alloc::string::String>,
pub manual_units_per_pivot: ::core::option::Option<::prost::alloc::string::String>,
/// Required for SPECIFIC_PUBLICATION_DATE and MANUAL.
#[prost(string, tag = "5")]
pub reason: ::prost::alloc::string::String,
@@ -142,7 +143,7 @@ pub struct PreviewEcbConversionResponse {
#[prost(string, optional, tag = "7")]
pub rate_date: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "8")]
pub units_per_eur: ::core::option::Option<::prost::alloc::string::String>,
pub units_per_pivot: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int64, optional, tag = "9")]
pub rate_observation_id: ::core::option::Option<i64>,
#[prost(string, optional, tag = "10")]
@@ -156,8 +157,8 @@ pub struct PreviewEcbConversionResponse {
#[prost(string, optional, tag = "14")]
pub source_endpoint: ::core::option::Option<::prost::alloc::string::String>,
/// Present only when determination_method is custom_rate. rate_date and
/// units_per_eur then describe the hand-entered row identified here, and the
/// ECB observation fields above are empty.
/// units_per_pivot then describe the hand-entered row identified here, and
/// the ECB observation fields above are empty.
#[prost(int64, optional, tag = "15")]
pub custom_rate_table_definition_id: ::core::option::Option<i64>,
#[prost(int64, optional, tag = "16")]
@@ -234,7 +235,7 @@ pub struct EcbConversionEvidence {
#[prost(string, optional, tag = "10")]
pub rate_date: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "11")]
pub units_per_eur: ::core::option::Option<::prost::alloc::string::String>,
pub units_per_pivot: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int64, optional, tag = "12")]
pub rate_observation_id: ::core::option::Option<i64>,
#[prost(string, optional, tag = "13")]
@@ -250,7 +251,7 @@ pub struct EcbConversionEvidence {
#[prost(string, tag = "18")]
pub evidence_created_at: ::prost::alloc::string::String,
/// Present only when determination_method is custom_rate. The hand-entered row
/// that supplied rate_date and units_per_eur. The row itself stays editable, so
/// that supplied rate_date and units_per_pivot. The row itself stays editable, so
/// the figures above are the immutable record of what was actually applied.
#[prost(int64, optional, tag = "19")]
pub custom_rate_table_definition_id: ::core::option::Option<i64>,
@@ -275,6 +276,25 @@ pub struct EcbConversionEvidence {
/// original_amount/original_currency (always EUR).
#[prost(int64, optional, tag = "26")]
pub derived_from_evidence_id: ::core::option::Option<i64>,
/// The pivot currency of the rate source that priced this hop (EUR for
/// every hop today). A rate-based hop always has this currency on exactly
/// one side of original_currency/converted_currency.
#[prost(string, tag = "27")]
pub pivot_currency: ::prost::alloc::string::String,
/// Which rate source's policy governs this hop's profile ("ecb" for every
/// hop today). Absent only for already_same_currency, where no policy
/// needed to be consulted. This is about which policy applies, not about
/// who actually supplied this specific rate -- see observation_source_id
/// for that.
#[prost(string, optional, tag = "28")]
pub policy_source_id: ::core::option::Option<::prost::alloc::string::String>,
/// Which rate source actually supplied this hop's rate as its own official
/// observation. Present only when determination_method is
/// official_reference_rate; absent for custom_rate, manual_rate, and
/// already_same_currency, since none of those were priced by the policy's
/// source itself -- a human entered them.
#[prost(string, optional, tag = "29")]
pub observation_source_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEcbConversionEvidenceResponse {
@@ -335,7 +355,8 @@ impl ExchangeRateDateRule {
#[repr(i32)]
pub enum ExchangeRateSource {
Unspecified = 0,
Ecb = 1,
/// The rate source's own published reference rate (ECB's, today).
Official = 1,
/// A reusable rate from the profile's custom_exchange_rates table.
SavedCustom = 2,
/// A one-off rate recorded only in this posting's immutable evidence.
@@ -349,7 +370,7 @@ impl ExchangeRateSource {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "EXCHANGE_RATE_SOURCE_UNSPECIFIED",
Self::Ecb => "EXCHANGE_RATE_SOURCE_ECB",
Self::Official => "EXCHANGE_RATE_SOURCE_OFFICIAL",
Self::SavedCustom => "EXCHANGE_RATE_SOURCE_SAVED_CUSTOM",
Self::Manual => "EXCHANGE_RATE_SOURCE_MANUAL",
}
@@ -358,7 +379,7 @@ impl ExchangeRateSource {
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXCHANGE_RATE_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
"EXCHANGE_RATE_SOURCE_ECB" => Some(Self::Ecb),
"EXCHANGE_RATE_SOURCE_OFFICIAL" => Some(Self::Official),
"EXCHANGE_RATE_SOURCE_SAVED_CUSTOM" => Some(Self::SavedCustom),
"EXCHANGE_RATE_SOURCE_MANUAL" => Some(Self::Manual),
_ => None,