diff --git a/common/proto/accounting.proto b/common/proto/accounting.proto index 18d5b3ad..c6af402a 100644 --- a/common/proto/accounting.proto +++ b/common/proto/accounting.proto @@ -7,6 +7,9 @@ package komp_ac.accounting; // without replacing the live accounts projection. Closed periods can be reopened; // approved periods are final. service Accounting { + // Resolve or atomically create every node in a parsed account path. + rpc EnsureAccount(EnsureAccountRequest) returns (Account); + // Create a journal with its first lines when journal_id is absent, or append // all supplied lines atomically when journal_id identifies an existing one. rpc PostJournal(PostJournalRequest) returns (Journal); @@ -53,6 +56,34 @@ service Accounting { rpc ListAccountingPeriods(ListAccountingPeriodsRequest) returns (ListAccountingPeriodsResponse); rpc ListPeriodBalances(ListPeriodBalancesRequest) returns (ListPeriodBalancesResponse); + + // Administratively map one account in a predecessor profile to one account + // in the current profile. Existing activity on the target account is allowed. + rpc MapOpeningBalanceAccount(MapOpeningBalanceAccountRequest) + returns (OpeningBalanceAccountMapping); + rpc UnmapOpeningBalanceAccount(UnmapOpeningBalanceAccountRequest) + returns (UnmapOpeningBalanceAccountResponse); + rpc ListOpeningBalanceAccounts(ListOpeningBalanceAccountsRequest) + returns (ListOpeningBalanceAccountsResponse); +} + +message EnsureAccountRequest { + string profile_name = 1; + repeated string segments = 2; + // Currency accepted by source postings to the leaf account. Empty uses the + // profile accounting currency. Missing ancestors are created in the profile + // accounting currency. + string denomination_currency = 3; +} + +message Account { + int64 id = 1; + optional int64 parent_account_id = 2; + string segment = 3; + // Root-to-leaf path of this account. Same shape as the request that created + // it; the server never joins segments into a delimited code. + repeated string segments = 4; + string denomination_currency = 5; } enum JournalSide { @@ -91,8 +122,9 @@ message PostJournalRequest { // an unknown id is never treated as a request to create one. optional int64 journal_id = 2; - // Required when creating. When appending, empty uses the journal currency; - // a supplied value must match it exactly. + // Currency of the amounts supplied by this request. Required when creating; + // empty uses the profile accounting currency when appending. Journal amounts + // are stored and returned in the profile accounting currency. string currency = 3; // Applied when creating and required to be empty when appending. @@ -242,7 +274,8 @@ message JournalLine { int64 id = 1; int32 line_number = 2; JournalSide side = 3; - string account_code = 4; + // Root-to-leaf path of the posted account, as sent on JournalLineInput. + repeated string account_segments = 4; string amount = 5; string description = 6; bool deleted = 7; @@ -339,7 +372,8 @@ message ListPeriodBalancesRequest { message PeriodBalance { int64 period_id = 1; - string account_code = 2; + // Root-to-leaf path of the account this frozen balance belongs to. + repeated string account_segments = 2; string currency = 3; // Signed nets use debit-positive convention. string opening_balance = 4; @@ -351,3 +385,54 @@ message PeriodBalance { message ListPeriodBalancesResponse { repeated PeriodBalance balances = 1; } + +message MapOpeningBalanceAccountRequest { + // Open period whose profile receives the opening balance. Its configured + // previous_period_id identifies the source profile and period. + int64 target_period_id = 1; + repeated string source_account_segments = 2; + repeated string target_account_segments = 3; +} + +message UnmapOpeningBalanceAccountRequest { + int64 target_period_id = 1; + repeated string target_account_segments = 2; +} + +message UnmapOpeningBalanceAccountResponse { + bool removed = 1; +} + +message ListOpeningBalanceAccountsRequest { + int64 target_period_id = 1; +} + +enum OpeningBalanceStatus { + OPENING_BALANCE_STATUS_UNSPECIFIED = 0; + // The predecessor is still open, so its closed journal activity can change. + OPENING_BALANCE_STATUS_PROVISIONAL = 1; + // The value comes from the predecessor's frozen period snapshot. + OPENING_BALANCE_STATUS_FINAL = 2; +} + +message OpeningBalanceAccountMapping { + int64 target_period_id = 1; + int64 source_period_id = 2; + string source_profile_name = 3; + repeated string source_account_segments = 4; + string target_profile_name = 5; + repeated string target_account_segments = 6; + string currency = 7; + // Signed balances use the debit-positive convention. + string opening_balance = 8; + string period_debit = 9; + string period_credit = 10; + string current_balance = 11; + OpeningBalanceStatus status = 12; + string created_at = 13; + string created_by_user_id = 14; +} + +message ListOpeningBalanceAccountsResponse { + repeated OpeningBalanceAccountMapping mappings = 1; +} diff --git a/common/proto/ecb.proto b/common/proto/ecb.proto index 7c8e34be..a3f81b42 100644 --- a/common/proto/ecb.proto +++ b/common/proto/ecb.proto @@ -18,7 +18,7 @@ service EcbService { returns (ListEcbConversionEvidenceResponse); } -// Accounting date rule used to select an ECB publication. +// Conversion basis rule used to select an ECB publication. enum EcbConversionContext { ECB_CONVERSION_CONTEXT_UNSPECIFIED = 0; ECB_CONVERSION_CONTEXT_ORDINARY_TRANSACTION = 1; @@ -33,9 +33,10 @@ message PreviewEcbConversionRequest { string original_currency = 2; EcbConversionContext conversion_context = 3; - // ISO calendar date (YYYY-MM-DD). Its meaning is selected by - // conversion_context: transaction, statement, or decisive date. - string anchor_date = 4; + // ISO calendar date (YYYY-MM-DD) from which the applicable publication date + // is derived. Its meaning is selected by conversion_context: transaction, + // statement, or decisive date. + string conversion_basis_date = 4; // Required. Profile whose rates apply. Only consulted when use_custom_rate is // set, but always required so a preview names the books it describes. @@ -54,7 +55,7 @@ message PreviewEcbConversionResponse { string original_currency = 2; string eur_amount = 3; EcbConversionContext conversion_context = 4; - string anchor_date = 5; + string conversion_basis_date = 5; string determination_method = 6; string rounding_method = 7; optional string rate_date = 8; @@ -107,7 +108,7 @@ message EcbConversionEvidence { string original_currency = 4; string eur_amount = 5; string conversion_context = 6; - string anchor_date = 7; + string conversion_basis_date = 7; string determination_method = 8; string rounding_method = 9; optional string rate_date = 10; diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index bc7427fa..d894e81f 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.accounting.rs b/common/src/proto/komp_ac.accounting.rs index 0fa81515..d722ecac 100644 --- a/common/src/proto/komp_ac.accounting.rs +++ b/common/src/proto/komp_ac.accounting.rs @@ -1,4 +1,31 @@ // This file is @generated by prost-build. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct EnsureAccountRequest { + #[prost(string, tag = "1")] + pub profile_name: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub segments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Currency accepted by source postings to the leaf account. Empty uses the + /// profile accounting currency. Missing ancestors are created in the profile + /// accounting currency. + #[prost(string, tag = "3")] + pub denomination_currency: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Account { + #[prost(int64, tag = "1")] + pub id: i64, + #[prost(int64, optional, tag = "2")] + pub parent_account_id: ::core::option::Option, + #[prost(string, tag = "3")] + pub segment: ::prost::alloc::string::String, + /// Root-to-leaf path of this account. Same shape as the request that created + /// it; the server never joins segments into a delimited code. + #[prost(string, repeated, tag = "4")] + pub segments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag = "5")] + pub denomination_currency: ::prost::alloc::string::String, +} #[derive(Clone, PartialEq, ::prost::Message)] pub struct PostJournalRequest { #[prost(string, tag = "1")] @@ -7,8 +34,9 @@ pub struct PostJournalRequest { /// an unknown id is never treated as a request to create one. #[prost(int64, optional, tag = "2")] pub journal_id: ::core::option::Option, - /// Required when creating. When appending, empty uses the journal currency; - /// a supplied value must match it exactly. + /// Currency of the amounts supplied by this request. Required when creating; + /// empty uses the profile accounting currency when appending. Journal amounts + /// are stored and returned in the profile accounting currency. #[prost(string, tag = "3")] pub currency: ::prost::alloc::string::String, /// Applied when creating and required to be empty when appending. @@ -210,8 +238,9 @@ pub struct JournalLine { pub line_number: i32, #[prost(enumeration = "JournalSide", tag = "3")] pub side: i32, - #[prost(string, tag = "4")] - pub account_code: ::prost::alloc::string::String, + /// Root-to-leaf path of the posted account, as sent on JournalLineInput. + #[prost(string, repeated, tag = "4")] + pub account_segments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(string, tag = "5")] pub amount: ::prost::alloc::string::String, #[prost(string, tag = "6")] @@ -357,8 +386,9 @@ pub struct ListPeriodBalancesRequest { pub struct PeriodBalance { #[prost(int64, tag = "1")] pub period_id: i64, - #[prost(string, tag = "2")] - pub account_code: ::prost::alloc::string::String, + /// Root-to-leaf path of the account this frozen balance belongs to. + #[prost(string, repeated, tag = "2")] + pub account_segments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(string, tag = "3")] pub currency: ::prost::alloc::string::String, /// Signed nets use debit-positive convention. @@ -376,6 +406,81 @@ pub struct ListPeriodBalancesResponse { #[prost(message, repeated, tag = "1")] pub balances: ::prost::alloc::vec::Vec, } +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct MapOpeningBalanceAccountRequest { + /// Open period whose profile receives the opening balance. Its configured + /// previous_period_id identifies the source profile and period. + #[prost(int64, tag = "1")] + pub target_period_id: i64, + #[prost(string, repeated, tag = "2")] + pub source_account_segments: ::prost::alloc::vec::Vec< + ::prost::alloc::string::String, + >, + #[prost(string, repeated, tag = "3")] + pub target_account_segments: ::prost::alloc::vec::Vec< + ::prost::alloc::string::String, + >, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct UnmapOpeningBalanceAccountRequest { + #[prost(int64, tag = "1")] + pub target_period_id: i64, + #[prost(string, repeated, tag = "2")] + pub target_account_segments: ::prost::alloc::vec::Vec< + ::prost::alloc::string::String, + >, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct UnmapOpeningBalanceAccountResponse { + #[prost(bool, tag = "1")] + pub removed: bool, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ListOpeningBalanceAccountsRequest { + #[prost(int64, tag = "1")] + pub target_period_id: i64, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct OpeningBalanceAccountMapping { + #[prost(int64, tag = "1")] + pub target_period_id: i64, + #[prost(int64, tag = "2")] + pub source_period_id: i64, + #[prost(string, tag = "3")] + pub source_profile_name: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "4")] + pub source_account_segments: ::prost::alloc::vec::Vec< + ::prost::alloc::string::String, + >, + #[prost(string, tag = "5")] + pub target_profile_name: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "6")] + pub target_account_segments: ::prost::alloc::vec::Vec< + ::prost::alloc::string::String, + >, + #[prost(string, tag = "7")] + pub currency: ::prost::alloc::string::String, + /// Signed balances use the debit-positive convention. + #[prost(string, tag = "8")] + pub opening_balance: ::prost::alloc::string::String, + #[prost(string, tag = "9")] + pub period_debit: ::prost::alloc::string::String, + #[prost(string, tag = "10")] + pub period_credit: ::prost::alloc::string::String, + #[prost(string, tag = "11")] + pub current_balance: ::prost::alloc::string::String, + #[prost(enumeration = "OpeningBalanceStatus", tag = "12")] + pub status: i32, + #[prost(string, tag = "13")] + pub created_at: ::prost::alloc::string::String, + #[prost(string, tag = "14")] + pub created_by_user_id: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListOpeningBalanceAccountsResponse { + #[prost(message, repeated, tag = "1")] + pub mappings: ::prost::alloc::vec::Vec, +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum JournalSide { @@ -476,6 +581,37 @@ impl AccountingPeriodType { } } } +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum OpeningBalanceStatus { + Unspecified = 0, + /// The predecessor is still open, so its closed journal activity can change. + Provisional = 1, + /// The value comes from the predecessor's frozen period snapshot. + Final = 2, +} +impl OpeningBalanceStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::Unspecified => "OPENING_BALANCE_STATUS_UNSPECIFIED", + Self::Provisional => "OPENING_BALANCE_STATUS_PROVISIONAL", + Self::Final => "OPENING_BALANCE_STATUS_FINAL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "OPENING_BALANCE_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "OPENING_BALANCE_STATUS_PROVISIONAL" => Some(Self::Provisional), + "OPENING_BALANCE_STATUS_FINAL" => Some(Self::Final), + _ => None, + } + } +} /// Generated client implementations. pub mod accounting_client { #![allow( @@ -572,6 +708,30 @@ pub mod accounting_client { self.inner = self.inner.max_encoding_message_size(limit); self } + /// Resolve or atomically create every node in a parsed account path. + pub async fn ensure_account( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/komp_ac.accounting.Accounting/EnsureAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("komp_ac.accounting.Accounting", "EnsureAccount"), + ); + self.inner.unary(req, path, codec).await + } /// Create a journal with its first lines when journal_id is absent, or append /// all supplied lines atomically when journal_id identifies an existing one. pub async fn post_journal( @@ -1016,6 +1176,95 @@ pub mod accounting_client { ); self.inner.unary(req, path, codec).await } + /// Administratively map one account in a predecessor profile to one account + /// in the current profile. Existing activity on the target account is allowed. + pub async fn map_opening_balance_account( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/komp_ac.accounting.Accounting/MapOpeningBalanceAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.accounting.Accounting", + "MapOpeningBalanceAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn unmap_opening_balance_account( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/komp_ac.accounting.Accounting/UnmapOpeningBalanceAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.accounting.Accounting", + "UnmapOpeningBalanceAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn list_opening_balance_accounts( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/komp_ac.accounting.Accounting/ListOpeningBalanceAccounts", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.accounting.Accounting", + "ListOpeningBalanceAccounts", + ), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -1031,6 +1280,11 @@ pub mod accounting_server { /// Generated trait containing gRPC methods that should be implemented for use with AccountingServer. #[async_trait] pub trait Accounting: std::marker::Send + std::marker::Sync + 'static { + /// Resolve or atomically create every node in a parsed account path. + async fn ensure_account( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; /// Create a journal with its first lines when journal_id is absent, or append /// all supplied lines atomically when journal_id identifies an existing one. async fn post_journal( @@ -1139,6 +1393,29 @@ pub mod accounting_server { tonic::Response, tonic::Status, >; + /// Administratively map one account in a predecessor profile to one account + /// in the current profile. Existing activity on the target account is allowed. + async fn map_opening_balance_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn unmap_opening_balance_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn list_opening_balance_accounts( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } /// Mutable informational journals. A journal may contain only debits, only /// credits, or any non-zero balance. Balance is reported but never enforced. @@ -1221,6 +1498,51 @@ pub mod accounting_server { } fn call(&mut self, req: http::Request) -> Self::Future { match req.uri().path() { + "/komp_ac.accounting.Accounting/EnsureAccount" => { + #[allow(non_camel_case_types)] + struct EnsureAccountSvc(pub Arc); + impl< + T: Accounting, + > tonic::server::UnaryService + for EnsureAccountSvc { + type Response = super::Account; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::ensure_account(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = EnsureAccountSvc(inner); + let codec = tonic_prost::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/komp_ac.accounting.Accounting/PostJournal" => { #[allow(non_camel_case_types)] struct PostJournalSvc(pub Arc); @@ -1957,6 +2279,161 @@ pub mod accounting_server { }; Box::pin(fut) } + "/komp_ac.accounting.Accounting/MapOpeningBalanceAccount" => { + #[allow(non_camel_case_types)] + struct MapOpeningBalanceAccountSvc(pub Arc); + impl< + T: Accounting, + > tonic::server::UnaryService + for MapOpeningBalanceAccountSvc { + type Response = super::OpeningBalanceAccountMapping; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::MapOpeningBalanceAccountRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::map_opening_balance_account( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = MapOpeningBalanceAccountSvc(inner); + let codec = tonic_prost::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/komp_ac.accounting.Accounting/UnmapOpeningBalanceAccount" => { + #[allow(non_camel_case_types)] + struct UnmapOpeningBalanceAccountSvc(pub Arc); + impl< + T: Accounting, + > tonic::server::UnaryService< + super::UnmapOpeningBalanceAccountRequest, + > for UnmapOpeningBalanceAccountSvc { + type Response = super::UnmapOpeningBalanceAccountResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::UnmapOpeningBalanceAccountRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::unmap_opening_balance_account( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = UnmapOpeningBalanceAccountSvc(inner); + let codec = tonic_prost::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/komp_ac.accounting.Accounting/ListOpeningBalanceAccounts" => { + #[allow(non_camel_case_types)] + struct ListOpeningBalanceAccountsSvc(pub Arc); + impl< + T: Accounting, + > tonic::server::UnaryService< + super::ListOpeningBalanceAccountsRequest, + > for ListOpeningBalanceAccountsSvc { + type Response = super::ListOpeningBalanceAccountsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::ListOpeningBalanceAccountsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::list_opening_balance_accounts( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = ListOpeningBalanceAccountsSvc(inner); + let codec = tonic_prost::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => { Box::pin(async move { let mut response = http::Response::new( diff --git a/common/src/proto/komp_ac.ecb.rs b/common/src/proto/komp_ac.ecb.rs index dc18e28f..a46977ab 100644 --- a/common/src/proto/komp_ac.ecb.rs +++ b/common/src/proto/komp_ac.ecb.rs @@ -9,10 +9,11 @@ pub struct PreviewEcbConversionRequest { pub original_currency: ::prost::alloc::string::String, #[prost(enumeration = "EcbConversionContext", tag = "3")] pub conversion_context: i32, - /// ISO calendar date (YYYY-MM-DD). Its meaning is selected by - /// conversion_context: transaction, statement, or decisive date. + /// ISO calendar date (YYYY-MM-DD) from which the applicable publication date + /// is derived. Its meaning is selected by conversion_context: transaction, + /// statement, or decisive date. #[prost(string, tag = "4")] - pub anchor_date: ::prost::alloc::string::String, + pub conversion_basis_date: ::prost::alloc::string::String, /// Required. Profile whose rates apply. Only consulted when use_custom_rate is /// set, but always required so a preview names the books it describes. #[prost(string, tag = "5")] @@ -36,7 +37,7 @@ pub struct PreviewEcbConversionResponse { #[prost(enumeration = "EcbConversionContext", tag = "4")] pub conversion_context: i32, #[prost(string, tag = "5")] - pub anchor_date: ::prost::alloc::string::String, + pub conversion_basis_date: ::prost::alloc::string::String, #[prost(string, tag = "6")] pub determination_method: ::prost::alloc::string::String, #[prost(string, tag = "7")] @@ -109,7 +110,7 @@ pub struct EcbConversionEvidence { #[prost(string, tag = "6")] pub conversion_context: ::prost::alloc::string::String, #[prost(string, tag = "7")] - pub anchor_date: ::prost::alloc::string::String, + pub conversion_basis_date: ::prost::alloc::string::String, #[prost(string, tag = "8")] pub determination_method: ::prost::alloc::string::String, #[prost(string, tag = "9")] @@ -157,7 +158,7 @@ pub struct ListEcbConversionEvidenceResponse { #[prost(bool, tag = "3")] pub has_more: bool, } -/// Accounting date rule used to select an ECB publication. +/// Conversion basis rule used to select an ECB publication. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum EcbConversionContext { diff --git a/server b/server index 4204f743..e09b0b4c 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 4204f743738302176cd0e870249a2afbd2fed41a +Subproject commit e09b0b4c37f1069b7b7790f5ff01b286a938b190