diff --git a/common/proto/ecb.proto b/common/proto/ecb.proto index e388e66..25279d3 100644 --- a/common/proto/ecb.proto +++ b/common/proto/ecb.proto @@ -36,6 +36,11 @@ message PreviewEcbConversionRequest { // ISO calendar date (YYYY-MM-DD). Its meaning is selected by // conversion_context: transaction, statement, or decisive date. string anchor_date = 4; + + // Required. Profile whose custom exchange rate table is consulted before the + // ECB observations, so the preview matches what posting into that profile + // would do. + string profile_name = 5; } // The conversion and immutable local ECB observation that would be used now. @@ -56,6 +61,14 @@ message PreviewEcbConversionResponse { optional string rate_fetched_at = 13; optional int64 import_batch_id = 14; optional string source_endpoint = 15; + + // 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. + optional int64 custom_rate_table_definition_id = 16; + optional int64 custom_rate_record_id = 17; + optional int64 custom_rate_row_revision = 18; + optional string custom_rate_note = 19; } // Identify one logical money cell whose conversion history should be inspected. @@ -102,10 +115,19 @@ message EcbConversionEvidence { optional int64 import_batch_id = 16; optional string source_endpoint = 17; string evidence_created_at = 18; + + // 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 + // the figures above are the immutable record of what was actually applied. + optional int64 custom_rate_table_definition_id = 19; + optional int64 custom_rate_record_id = 20; + optional int64 custom_rate_row_revision = 21; + optional string custom_rate_note = 22; } message ListEcbConversionEvidenceResponse { - // True when at least one evidence row for this cell used an ECB rate. + // True when at least one evidence row for this cell used a rate, whether it + // came from ECB or from a hand-entered custom row. bool has_exchange = 1; // Newest-first immutable history for this page. diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index bc4d217..0e288a4 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.ecb.rs b/common/src/proto/komp_ac.ecb.rs index 0f485a3..82349c5 100644 --- a/common/src/proto/komp_ac.ecb.rs +++ b/common/src/proto/komp_ac.ecb.rs @@ -13,6 +13,11 @@ pub struct PreviewEcbConversionRequest { /// conversion_context: transaction, statement, or decisive date. #[prost(string, tag = "4")] pub anchor_date: ::prost::alloc::string::String, + /// Required. Profile whose custom exchange rate table is consulted before the + /// ECB observations, so the preview matches what posting into that profile + /// would do. + #[prost(string, tag = "5")] + pub profile_name: ::prost::alloc::string::String, } /// The conversion and immutable local ECB observation that would be used now. /// No rounding is performed and no conversion evidence is persisted. @@ -48,6 +53,17 @@ pub struct PreviewEcbConversionResponse { pub import_batch_id: ::core::option::Option, #[prost(string, optional, tag = "15")] 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. + #[prost(int64, optional, tag = "16")] + pub custom_rate_table_definition_id: ::core::option::Option, + #[prost(int64, optional, tag = "17")] + pub custom_rate_record_id: ::core::option::Option, + #[prost(int64, optional, tag = "18")] + pub custom_rate_row_revision: ::core::option::Option, + #[prost(string, optional, tag = "19")] + pub custom_rate_note: ::core::option::Option<::prost::alloc::string::String>, } /// Identify one logical money cell whose conversion history should be inspected. #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] @@ -112,10 +128,22 @@ pub struct EcbConversionEvidence { pub source_endpoint: ::core::option::Option<::prost::alloc::string::String>, #[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 + /// 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, + #[prost(int64, optional, tag = "20")] + pub custom_rate_record_id: ::core::option::Option, + #[prost(int64, optional, tag = "21")] + pub custom_rate_row_revision: ::core::option::Option, + #[prost(string, optional, tag = "22")] + pub custom_rate_note: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListEcbConversionEvidenceResponse { - /// True when at least one evidence row for this cell used an ECB rate. + /// True when at least one evidence row for this cell used a rate, whether it + /// came from ECB or from a hand-entered custom row. #[prost(bool, tag = "1")] pub has_exchange: bool, /// Newest-first immutable history for this page.