ecb conversions with corrections2
This commit is contained in:
Binary file not shown.
@@ -56,13 +56,6 @@ pub struct PostJournalRequest {
|
||||
/// the latest closed or approved accounting boundary for the profile.
|
||||
#[prost(string, tag = "7")]
|
||||
pub accounting_date: ::prost::alloc::string::String,
|
||||
/// Convert this posting with the profile's own rate for the publication date
|
||||
/// instead of the ECB reference rate. False, the default, always uses ECB, even
|
||||
/// where a custom rate for that date exists. True requires one to have been
|
||||
/// entered: a missing rate is refused rather than silently converted at the
|
||||
/// official rate. Ignored when nothing needs converting.
|
||||
#[prost(bool, tag = "8")]
|
||||
pub use_custom_rate: bool,
|
||||
}
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct JournalLineInput {
|
||||
@@ -75,6 +68,12 @@ pub struct JournalLineInput {
|
||||
pub amount: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "4")]
|
||||
pub description: ::prost::alloc::string::String,
|
||||
/// Empty uses previous publication and ECB. Set this per line when the
|
||||
/// accountant needs a different rule, a saved custom rate, or a one-off rate.
|
||||
#[prost(message, optional, tag = "5")]
|
||||
pub exchange_rate_selection: ::core::option::Option<
|
||||
super::ecb::ExchangeRateSelection,
|
||||
>,
|
||||
}
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct CloseJournalRequest {
|
||||
@@ -96,8 +95,8 @@ pub struct GetJournalRequest {
|
||||
pub profile_name: ::prost::alloc::string::String,
|
||||
#[prost(int64, tag = "2")]
|
||||
pub journal_id: i64,
|
||||
/// False by default. True is reserved for a future Casbin permission granted
|
||||
/// only to superadmin and is rejected until that permission is implemented.
|
||||
/// False returns the live journal. True also returns superseded/deleted lines
|
||||
/// so an authorized journal reader can inspect the correction trail.
|
||||
#[prost(bool, tag = "3")]
|
||||
pub include_deleted: bool,
|
||||
}
|
||||
@@ -229,6 +228,31 @@ pub struct SoftDeleteJournalLineRequest {
|
||||
#[prost(int64, tag = "3")]
|
||||
pub journal_line_id: i64,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct CorrectJournalRequest {
|
||||
#[prost(string, tag = "1")]
|
||||
pub profile_name: ::prost::alloc::string::String,
|
||||
#[prost(int64, tag = "2")]
|
||||
pub journal_id: i64,
|
||||
/// One or more line replacements committed as a single correction. Batching
|
||||
/// lets both sides of a closed balanced journal be corrected together.
|
||||
#[prost(message, repeated, tag = "3")]
|
||||
pub corrections: ::prost::alloc::vec::Vec<JournalLineCorrection>,
|
||||
}
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct JournalLineCorrection {
|
||||
#[prost(int64, tag = "1")]
|
||||
pub journal_line_id: i64,
|
||||
/// Full replacement line. Its amount is expressed in currency.
|
||||
#[prost(message, optional, tag = "2")]
|
||||
pub replacement: ::core::option::Option<JournalLineInput>,
|
||||
#[prost(string, tag = "3")]
|
||||
pub currency: ::prost::alloc::string::String,
|
||||
/// Required independently of any exceptional exchange-rate reason and stored
|
||||
/// permanently beside this original/replacement pair.
|
||||
#[prost(string, tag = "4")]
|
||||
pub correction_reason: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct JournalLine {
|
||||
#[prost(int64, tag = "1")]
|
||||
@@ -256,6 +280,21 @@ pub struct JournalLine {
|
||||
pub source_record_id: i64,
|
||||
#[prost(int64, tag = "12")]
|
||||
pub source_row_revision: i64,
|
||||
/// Populated on a replacement created by CorrectJournal.
|
||||
#[prost(int64, tag = "13")]
|
||||
pub supersedes_line_id: i64,
|
||||
#[prost(string, tag = "14")]
|
||||
pub correction_reason: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "15")]
|
||||
pub corrected_by_user_id: ::prost::alloc::string::String,
|
||||
/// Original foreign-currency input and immutable conversion evidence. Empty/
|
||||
/// zero when the line did not require conversion.
|
||||
#[prost(string, tag = "16")]
|
||||
pub original_amount: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "17")]
|
||||
pub original_currency: ::prost::alloc::string::String,
|
||||
#[prost(int64, tag = "18")]
|
||||
pub conversion_evidence_id: i64,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct Journal {
|
||||
@@ -1027,6 +1066,31 @@ pub mod accounting_client {
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Atomically supersede active lines and append corrected replacements. The
|
||||
/// originals and their conversion evidence remain immutable audit history.
|
||||
pub async fn correct_journal(
|
||||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::CorrectJournalRequest>,
|
||||
) -> std::result::Result<tonic::Response<super::Journal>, 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/CorrectJournal",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(
|
||||
GrpcMethod::new("komp_ac.accounting.Accounting", "CorrectJournal"),
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Create an open accounting period for a profile. Periods may be any length
|
||||
/// (month, half-year, year). Overlapping ranges for the same profile are rejected.
|
||||
pub async fn configure_accounting_period(
|
||||
@@ -1456,6 +1520,12 @@ pub mod accounting_server {
|
||||
&self,
|
||||
request: tonic::Request<super::SoftDeleteJournalLineRequest>,
|
||||
) -> std::result::Result<tonic::Response<super::Journal>, tonic::Status>;
|
||||
/// Atomically supersede active lines and append corrected replacements. The
|
||||
/// originals and their conversion evidence remain immutable audit history.
|
||||
async fn correct_journal(
|
||||
&self,
|
||||
request: tonic::Request<super::CorrectJournalRequest>,
|
||||
) -> std::result::Result<tonic::Response<super::Journal>, tonic::Status>;
|
||||
/// Create an open accounting period for a profile. Periods may be any length
|
||||
/// (month, half-year, year). Overlapping ranges for the same profile are rejected.
|
||||
async fn configure_accounting_period(
|
||||
@@ -2037,6 +2107,51 @@ pub mod accounting_server {
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.accounting.Accounting/CorrectJournal" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct CorrectJournalSvc<T: Accounting>(pub Arc<T>);
|
||||
impl<
|
||||
T: Accounting,
|
||||
> tonic::server::UnaryService<super::CorrectJournalRequest>
|
||||
for CorrectJournalSvc<T> {
|
||||
type Response = super::Journal;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<super::CorrectJournalRequest>,
|
||||
) -> Self::Future {
|
||||
let inner = Arc::clone(&self.0);
|
||||
let fut = async move {
|
||||
<T as Accounting>::correct_journal(&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 = CorrectJournalSvc(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/ConfigureAccountingPeriod" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct ConfigureAccountingPeriodSvc<T: Accounting>(pub Arc<T>);
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
// This file is @generated by prost-build.
|
||||
/// Accountant-controlled conversion treatment. Exceptional choices remain
|
||||
/// explicit and auditable rather than being inferred from a legal label.
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct ExchangeRateSelection {
|
||||
#[prost(enumeration = "ExchangeRateDateRule", tag = "1")]
|
||||
pub date_rule: i32,
|
||||
#[prost(enumeration = "ExchangeRateSource", tag = "2")]
|
||||
pub source: i32,
|
||||
/// 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.
|
||||
#[prost(string, optional, tag = "4")]
|
||||
pub manual_units_per_eur: ::core::option::Option<::prost::alloc::string::String>,
|
||||
/// Required for SPECIFIC_PUBLICATION_DATE and MANUAL.
|
||||
#[prost(string, tag = "5")]
|
||||
pub reason: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct GetEcbPipelineStatusRequest {
|
||||
/// Optional. How many recent import attempts to return. Zero uses 20; the
|
||||
@@ -94,22 +112,16 @@ pub struct PreviewEcbConversionRequest {
|
||||
pub original_amount: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "2")]
|
||||
pub original_currency: ::prost::alloc::string::String,
|
||||
#[prost(enumeration = "EcbConversionContext", tag = "3")]
|
||||
pub conversion_context: i32,
|
||||
/// 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")]
|
||||
/// ISO calendar date (YYYY-MM-DD) of the accounting case.
|
||||
#[prost(string, tag = "3")]
|
||||
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")]
|
||||
/// Required. Profile whose rates apply. Consulted when the selection requests
|
||||
/// a saved custom rate, and always required so the preview names its books.
|
||||
#[prost(string, tag = "4")]
|
||||
pub profile_name: ::prost::alloc::string::String,
|
||||
/// Preview the profile's own rate for the publication date rather than the ECB
|
||||
/// reference rate. Must match what the posting will ask for, or the preview
|
||||
/// describes a conversion that will not happen.
|
||||
#[prost(bool, tag = "6")]
|
||||
pub use_custom_rate: bool,
|
||||
/// Empty uses previous publication and ECB.
|
||||
#[prost(message, optional, tag = "5")]
|
||||
pub exchange_rate_selection: ::core::option::Option<ExchangeRateSelection>,
|
||||
}
|
||||
/// The conversion and immutable local ECB observation that would be used now.
|
||||
/// No rounding is performed and no conversion evidence is persisted.
|
||||
@@ -121,41 +133,47 @@ pub struct PreviewEcbConversionResponse {
|
||||
pub original_currency: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "3")]
|
||||
pub eur_amount: ::prost::alloc::string::String,
|
||||
#[prost(enumeration = "EcbConversionContext", tag = "4")]
|
||||
pub conversion_context: i32,
|
||||
#[prost(string, tag = "5")]
|
||||
#[prost(string, tag = "4")]
|
||||
pub conversion_basis_date: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "6")]
|
||||
#[prost(string, tag = "5")]
|
||||
pub determination_method: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "7")]
|
||||
#[prost(string, tag = "6")]
|
||||
pub rounding_method: ::prost::alloc::string::String,
|
||||
#[prost(string, optional, tag = "8")]
|
||||
#[prost(string, optional, tag = "7")]
|
||||
pub rate_date: ::core::option::Option<::prost::alloc::string::String>,
|
||||
#[prost(string, optional, tag = "9")]
|
||||
#[prost(string, optional, tag = "8")]
|
||||
pub units_per_eur: ::core::option::Option<::prost::alloc::string::String>,
|
||||
#[prost(int64, optional, tag = "10")]
|
||||
#[prost(int64, optional, tag = "9")]
|
||||
pub rate_observation_id: ::core::option::Option<i64>,
|
||||
#[prost(string, optional, tag = "11")]
|
||||
#[prost(string, optional, tag = "10")]
|
||||
pub observation_hash: ::core::option::Option<::prost::alloc::string::String>,
|
||||
#[prost(string, optional, tag = "12")]
|
||||
#[prost(string, optional, tag = "11")]
|
||||
pub source_payload_hash: ::core::option::Option<::prost::alloc::string::String>,
|
||||
#[prost(string, optional, tag = "13")]
|
||||
#[prost(string, optional, tag = "12")]
|
||||
pub rate_fetched_at: ::core::option::Option<::prost::alloc::string::String>,
|
||||
#[prost(int64, optional, tag = "14")]
|
||||
#[prost(int64, optional, tag = "13")]
|
||||
pub import_batch_id: ::core::option::Option<i64>,
|
||||
#[prost(string, optional, tag = "15")]
|
||||
#[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.
|
||||
#[prost(int64, optional, tag = "16")]
|
||||
#[prost(int64, optional, tag = "15")]
|
||||
pub custom_rate_table_definition_id: ::core::option::Option<i64>,
|
||||
#[prost(int64, optional, tag = "17")]
|
||||
#[prost(int64, optional, tag = "16")]
|
||||
pub custom_rate_record_id: ::core::option::Option<i64>,
|
||||
#[prost(int64, optional, tag = "18")]
|
||||
#[prost(int64, optional, tag = "17")]
|
||||
pub custom_rate_row_revision: ::core::option::Option<i64>,
|
||||
#[prost(string, optional, tag = "19")]
|
||||
#[prost(string, optional, tag = "18")]
|
||||
pub custom_rate_note: ::core::option::Option<::prost::alloc::string::String>,
|
||||
/// Accountant-supplied justification for an exceptional publication date or
|
||||
/// one-off manual rate. Empty for the normal/default rule.
|
||||
#[prost(enumeration = "ExchangeRateDateRule", tag = "19")]
|
||||
pub applied_date_rule: i32,
|
||||
#[prost(enumeration = "ExchangeRateSource", tag = "20")]
|
||||
pub applied_source: i32,
|
||||
#[prost(string, tag = "21")]
|
||||
pub selection_reason: ::prost::alloc::string::String,
|
||||
}
|
||||
/// Identify one logical money cell whose conversion history should be inspected.
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
@@ -231,11 +249,16 @@ pub struct EcbConversionEvidence {
|
||||
pub custom_rate_row_revision: ::core::option::Option<i64>,
|
||||
#[prost(string, optional, tag = "22")]
|
||||
pub custom_rate_note: ::core::option::Option<::prost::alloc::string::String>,
|
||||
/// Immutable audit data for an accountant-controlled exception.
|
||||
#[prost(string, tag = "23")]
|
||||
pub selection_reason: ::prost::alloc::string::String,
|
||||
#[prost(string, optional, tag = "24")]
|
||||
pub selected_by_user_id: ::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 a rate, whether it
|
||||
/// came from ECB or from a hand-entered custom row.
|
||||
/// True when at least one evidence row for this cell used an ECB, saved
|
||||
/// custom, or one-off manual rate.
|
||||
#[prost(bool, tag = "1")]
|
||||
pub has_exchange: bool,
|
||||
/// Newest-first immutable history for this page.
|
||||
@@ -245,39 +268,78 @@ pub struct ListEcbConversionEvidenceResponse {
|
||||
#[prost(bool, tag = "3")]
|
||||
pub has_more: bool,
|
||||
}
|
||||
/// Conversion basis rule used to select an ECB publication.
|
||||
/// How the publication date is selected from the accounting basis date.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
||||
#[repr(i32)]
|
||||
pub enum EcbConversionContext {
|
||||
pub enum ExchangeRateDateRule {
|
||||
Unspecified = 0,
|
||||
OrdinaryTransaction = 1,
|
||||
FinancialStatement = 2,
|
||||
DecisiveDate = 3,
|
||||
/// Latest TARGET publication strictly before the basis date.
|
||||
PreviousPublication = 1,
|
||||
/// Latest TARGET publication on or before the basis date.
|
||||
OnOrBeforeDate = 2,
|
||||
/// The exact publication date supplied in specific_rate_date.
|
||||
SpecificPublicationDate = 3,
|
||||
}
|
||||
impl EcbConversionContext {
|
||||
impl ExchangeRateDateRule {
|
||||
/// 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 => "ECB_CONVERSION_CONTEXT_UNSPECIFIED",
|
||||
Self::OrdinaryTransaction => "ECB_CONVERSION_CONTEXT_ORDINARY_TRANSACTION",
|
||||
Self::FinancialStatement => "ECB_CONVERSION_CONTEXT_FINANCIAL_STATEMENT",
|
||||
Self::DecisiveDate => "ECB_CONVERSION_CONTEXT_DECISIVE_DATE",
|
||||
Self::Unspecified => "EXCHANGE_RATE_DATE_RULE_UNSPECIFIED",
|
||||
Self::PreviousPublication => "EXCHANGE_RATE_DATE_RULE_PREVIOUS_PUBLICATION",
|
||||
Self::OnOrBeforeDate => "EXCHANGE_RATE_DATE_RULE_ON_OR_BEFORE_DATE",
|
||||
Self::SpecificPublicationDate => {
|
||||
"EXCHANGE_RATE_DATE_RULE_SPECIFIC_PUBLICATION_DATE"
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Creates an enum from field names used in the ProtoBuf definition.
|
||||
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
|
||||
match value {
|
||||
"ECB_CONVERSION_CONTEXT_UNSPECIFIED" => Some(Self::Unspecified),
|
||||
"ECB_CONVERSION_CONTEXT_ORDINARY_TRANSACTION" => {
|
||||
Some(Self::OrdinaryTransaction)
|
||||
"EXCHANGE_RATE_DATE_RULE_UNSPECIFIED" => Some(Self::Unspecified),
|
||||
"EXCHANGE_RATE_DATE_RULE_PREVIOUS_PUBLICATION" => {
|
||||
Some(Self::PreviousPublication)
|
||||
}
|
||||
"ECB_CONVERSION_CONTEXT_FINANCIAL_STATEMENT" => {
|
||||
Some(Self::FinancialStatement)
|
||||
"EXCHANGE_RATE_DATE_RULE_ON_OR_BEFORE_DATE" => Some(Self::OnOrBeforeDate),
|
||||
"EXCHANGE_RATE_DATE_RULE_SPECIFIC_PUBLICATION_DATE" => {
|
||||
Some(Self::SpecificPublicationDate)
|
||||
}
|
||||
"ECB_CONVERSION_CONTEXT_DECISIVE_DATE" => Some(Self::DecisiveDate),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
||||
#[repr(i32)]
|
||||
pub enum ExchangeRateSource {
|
||||
Unspecified = 0,
|
||||
Ecb = 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.
|
||||
Manual = 3,
|
||||
}
|
||||
impl ExchangeRateSource {
|
||||
/// 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 => "EXCHANGE_RATE_SOURCE_UNSPECIFIED",
|
||||
Self::Ecb => "EXCHANGE_RATE_SOURCE_ECB",
|
||||
Self::SavedCustom => "EXCHANGE_RATE_SOURCE_SAVED_CUSTOM",
|
||||
Self::Manual => "EXCHANGE_RATE_SOURCE_MANUAL",
|
||||
}
|
||||
}
|
||||
/// Creates an enum from field names used in the ProtoBuf definition.
|
||||
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_SAVED_CUSTOM" => Some(Self::SavedCustom),
|
||||
"EXCHANGE_RATE_SOURCE_MANUAL" => Some(Self::Manual),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,15 @@ pub struct PostTableDataRequest {
|
||||
::prost_types::Value,
|
||||
>,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct PostAccountingTableDataRequest {
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub row: ::core::option::Option<PostTableDataRequest>,
|
||||
#[prost(message, optional, tag = "2")]
|
||||
pub exchange_rate_selection: ::core::option::Option<
|
||||
super::ecb::ExchangeRateSelection,
|
||||
>,
|
||||
}
|
||||
/// Insert response.
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct PostTableDataResponse {
|
||||
@@ -134,6 +143,21 @@ pub struct PutTableDataRequest {
|
||||
pub expected_revision: i64,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct PutAccountingTableDataRequest {
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub update: ::core::option::Option<PutTableDataRequest>,
|
||||
#[prost(message, optional, tag = "2")]
|
||||
pub exchange_rate_selection: ::core::option::Option<
|
||||
super::ecb::ExchangeRateSelection,
|
||||
>,
|
||||
#[prost(bool, tag = "3")]
|
||||
pub confirmed: bool,
|
||||
#[prost(string, repeated, tag = "4")]
|
||||
pub expected_affected_profiles: ::prost::alloc::vec::Vec<
|
||||
::prost::alloc::string::String,
|
||||
>,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct PutTableDataConfirmedRequest {
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub update: ::core::option::Option<PutTableDataRequest>,
|
||||
@@ -517,6 +541,37 @@ pub mod tables_data_client {
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Insert an ACCOUNTING-enabled source row with an explicit exchange-rate
|
||||
/// treatment for the journal line created from it.
|
||||
pub async fn post_accounting_table_data(
|
||||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::PostAccountingTableDataRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::PostTableDataResponse>,
|
||||
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.tables_data.TablesData/PostAccountingTableData",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(
|
||||
GrpcMethod::new(
|
||||
"komp_ac.tables_data.TablesData",
|
||||
"PostAccountingTableData",
|
||||
),
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Insert multiple rows by applying PostTableData behavior to each row.
|
||||
///
|
||||
/// Behavior:
|
||||
@@ -594,6 +649,35 @@ pub mod tables_data_client {
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
pub async fn put_accounting_table_data(
|
||||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::PutAccountingTableDataRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::PutTableDataResponse>,
|
||||
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.tables_data.TablesData/PutAccountingTableData",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(
|
||||
GrpcMethod::new(
|
||||
"komp_ac.tables_data.TablesData",
|
||||
"PutAccountingTableData",
|
||||
),
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Performs a PUT after the user explicitly accepted changing a referenced version.
|
||||
pub async fn put_table_data_confirmed(
|
||||
&mut self,
|
||||
@@ -888,6 +972,15 @@ pub mod tables_data_server {
|
||||
tonic::Response<super::PostTableDataResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// Insert an ACCOUNTING-enabled source row with an explicit exchange-rate
|
||||
/// treatment for the journal line created from it.
|
||||
async fn post_accounting_table_data(
|
||||
&self,
|
||||
request: tonic::Request<super::PostAccountingTableDataRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::PostTableDataResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// Insert multiple rows by applying PostTableData behavior to each row.
|
||||
///
|
||||
/// Behavior:
|
||||
@@ -924,6 +1017,13 @@ pub mod tables_data_server {
|
||||
tonic::Response<super::PutTableDataResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
async fn put_accounting_table_data(
|
||||
&self,
|
||||
request: tonic::Request<super::PutAccountingTableDataRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::PutTableDataResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// Performs a PUT after the user explicitly accepted changing a referenced version.
|
||||
async fn put_table_data_confirmed(
|
||||
&self,
|
||||
@@ -1145,6 +1245,57 @@ pub mod tables_data_server {
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.tables_data.TablesData/PostAccountingTableData" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct PostAccountingTableDataSvc<T: TablesData>(pub Arc<T>);
|
||||
impl<
|
||||
T: TablesData,
|
||||
> tonic::server::UnaryService<super::PostAccountingTableDataRequest>
|
||||
for PostAccountingTableDataSvc<T> {
|
||||
type Response = super::PostTableDataResponse;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<
|
||||
super::PostAccountingTableDataRequest,
|
||||
>,
|
||||
) -> Self::Future {
|
||||
let inner = Arc::clone(&self.0);
|
||||
let fut = async move {
|
||||
<T as TablesData>::post_accounting_table_data(
|
||||
&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 = PostAccountingTableDataSvc(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.tables_data.TablesData/PostTableDataBulk" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct PostTableDataBulkSvc<T: TablesData>(pub Arc<T>);
|
||||
@@ -1236,6 +1387,55 @@ pub mod tables_data_server {
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.tables_data.TablesData/PutAccountingTableData" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct PutAccountingTableDataSvc<T: TablesData>(pub Arc<T>);
|
||||
impl<
|
||||
T: TablesData,
|
||||
> tonic::server::UnaryService<super::PutAccountingTableDataRequest>
|
||||
for PutAccountingTableDataSvc<T> {
|
||||
type Response = super::PutTableDataResponse;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<super::PutAccountingTableDataRequest>,
|
||||
) -> Self::Future {
|
||||
let inner = Arc::clone(&self.0);
|
||||
let fut = async move {
|
||||
<T as TablesData>::put_accounting_table_data(
|
||||
&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 = PutAccountingTableDataSvc(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.tables_data.TablesData/PutTableDataConfirmed" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct PutTableDataConfirmedSvc<T: TablesData>(pub Arc<T>);
|
||||
|
||||
Reference in New Issue
Block a user