moving balances of accounts between profiles - also other things in proto files

This commit is contained in:
Priec
2026-08-04 09:31:25 +02:00
parent f248a60b07
commit 0635e3bf10
6 changed files with 587 additions and 23 deletions

View File

@@ -7,6 +7,9 @@ package komp_ac.accounting;
// without replacing the live accounts projection. Closed periods can be reopened; // without replacing the live accounts projection. Closed periods can be reopened;
// approved periods are final. // approved periods are final.
service Accounting { 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 // 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. // all supplied lines atomically when journal_id identifies an existing one.
rpc PostJournal(PostJournalRequest) returns (Journal); rpc PostJournal(PostJournalRequest) returns (Journal);
@@ -53,6 +56,34 @@ service Accounting {
rpc ListAccountingPeriods(ListAccountingPeriodsRequest) rpc ListAccountingPeriods(ListAccountingPeriodsRequest)
returns (ListAccountingPeriodsResponse); returns (ListAccountingPeriodsResponse);
rpc ListPeriodBalances(ListPeriodBalancesRequest) returns (ListPeriodBalancesResponse); 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 { enum JournalSide {
@@ -91,8 +122,9 @@ message PostJournalRequest {
// an unknown id is never treated as a request to create one. // an unknown id is never treated as a request to create one.
optional int64 journal_id = 2; optional int64 journal_id = 2;
// Required when creating. When appending, empty uses the journal currency; // Currency of the amounts supplied by this request. Required when creating;
// a supplied value must match it exactly. // empty uses the profile accounting currency when appending. Journal amounts
// are stored and returned in the profile accounting currency.
string currency = 3; string currency = 3;
// Applied when creating and required to be empty when appending. // Applied when creating and required to be empty when appending.
@@ -242,7 +274,8 @@ message JournalLine {
int64 id = 1; int64 id = 1;
int32 line_number = 2; int32 line_number = 2;
JournalSide side = 3; 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 amount = 5;
string description = 6; string description = 6;
bool deleted = 7; bool deleted = 7;
@@ -339,7 +372,8 @@ message ListPeriodBalancesRequest {
message PeriodBalance { message PeriodBalance {
int64 period_id = 1; 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; string currency = 3;
// Signed nets use debit-positive convention. // Signed nets use debit-positive convention.
string opening_balance = 4; string opening_balance = 4;
@@ -351,3 +385,54 @@ message PeriodBalance {
message ListPeriodBalancesResponse { message ListPeriodBalancesResponse {
repeated PeriodBalance balances = 1; 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;
}

View File

@@ -18,7 +18,7 @@ service EcbService {
returns (ListEcbConversionEvidenceResponse); returns (ListEcbConversionEvidenceResponse);
} }
// Accounting date rule used to select an ECB publication. // Conversion basis rule used to select an ECB publication.
enum EcbConversionContext { enum EcbConversionContext {
ECB_CONVERSION_CONTEXT_UNSPECIFIED = 0; ECB_CONVERSION_CONTEXT_UNSPECIFIED = 0;
ECB_CONVERSION_CONTEXT_ORDINARY_TRANSACTION = 1; ECB_CONVERSION_CONTEXT_ORDINARY_TRANSACTION = 1;
@@ -33,9 +33,10 @@ message PreviewEcbConversionRequest {
string original_currency = 2; string original_currency = 2;
EcbConversionContext conversion_context = 3; EcbConversionContext conversion_context = 3;
// ISO calendar date (YYYY-MM-DD). Its meaning is selected by // ISO calendar date (YYYY-MM-DD) from which the applicable publication date
// conversion_context: transaction, statement, or decisive date. // is derived. Its meaning is selected by conversion_context: transaction,
string anchor_date = 4; // statement, or decisive date.
string conversion_basis_date = 4;
// Required. Profile whose rates apply. Only consulted when use_custom_rate is // Required. Profile whose rates apply. Only consulted when use_custom_rate is
// set, but always required so a preview names the books it describes. // set, but always required so a preview names the books it describes.
@@ -54,7 +55,7 @@ message PreviewEcbConversionResponse {
string original_currency = 2; string original_currency = 2;
string eur_amount = 3; string eur_amount = 3;
EcbConversionContext conversion_context = 4; EcbConversionContext conversion_context = 4;
string anchor_date = 5; string conversion_basis_date = 5;
string determination_method = 6; string determination_method = 6;
string rounding_method = 7; string rounding_method = 7;
optional string rate_date = 8; optional string rate_date = 8;
@@ -107,7 +108,7 @@ message EcbConversionEvidence {
string original_currency = 4; string original_currency = 4;
string eur_amount = 5; string eur_amount = 5;
string conversion_context = 6; string conversion_context = 6;
string anchor_date = 7; string conversion_basis_date = 7;
string determination_method = 8; string determination_method = 8;
string rounding_method = 9; string rounding_method = 9;
optional string rate_date = 10; optional string rate_date = 10;

Binary file not shown.

View File

@@ -1,4 +1,31 @@
// This file is @generated by prost-build. // 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<i64>,
#[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)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct PostJournalRequest { pub struct PostJournalRequest {
#[prost(string, tag = "1")] #[prost(string, tag = "1")]
@@ -7,8 +34,9 @@ pub struct PostJournalRequest {
/// an unknown id is never treated as a request to create one. /// an unknown id is never treated as a request to create one.
#[prost(int64, optional, tag = "2")] #[prost(int64, optional, tag = "2")]
pub journal_id: ::core::option::Option<i64>, pub journal_id: ::core::option::Option<i64>,
/// Required when creating. When appending, empty uses the journal currency; /// Currency of the amounts supplied by this request. Required when creating;
/// a supplied value must match it exactly. /// empty uses the profile accounting currency when appending. Journal amounts
/// are stored and returned in the profile accounting currency.
#[prost(string, tag = "3")] #[prost(string, tag = "3")]
pub currency: ::prost::alloc::string::String, pub currency: ::prost::alloc::string::String,
/// Applied when creating and required to be empty when appending. /// Applied when creating and required to be empty when appending.
@@ -210,8 +238,9 @@ pub struct JournalLine {
pub line_number: i32, pub line_number: i32,
#[prost(enumeration = "JournalSide", tag = "3")] #[prost(enumeration = "JournalSide", tag = "3")]
pub side: i32, pub side: i32,
#[prost(string, tag = "4")] /// Root-to-leaf path of the posted account, as sent on JournalLineInput.
pub account_code: ::prost::alloc::string::String, #[prost(string, repeated, tag = "4")]
pub account_segments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "5")] #[prost(string, tag = "5")]
pub amount: ::prost::alloc::string::String, pub amount: ::prost::alloc::string::String,
#[prost(string, tag = "6")] #[prost(string, tag = "6")]
@@ -357,8 +386,9 @@ pub struct ListPeriodBalancesRequest {
pub struct PeriodBalance { pub struct PeriodBalance {
#[prost(int64, tag = "1")] #[prost(int64, tag = "1")]
pub period_id: i64, pub period_id: i64,
#[prost(string, tag = "2")] /// Root-to-leaf path of the account this frozen balance belongs to.
pub account_code: ::prost::alloc::string::String, #[prost(string, repeated, tag = "2")]
pub account_segments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "3")] #[prost(string, tag = "3")]
pub currency: ::prost::alloc::string::String, pub currency: ::prost::alloc::string::String,
/// Signed nets use debit-positive convention. /// Signed nets use debit-positive convention.
@@ -376,6 +406,81 @@ pub struct ListPeriodBalancesResponse {
#[prost(message, repeated, tag = "1")] #[prost(message, repeated, tag = "1")]
pub balances: ::prost::alloc::vec::Vec<PeriodBalance>, pub balances: ::prost::alloc::vec::Vec<PeriodBalance>,
} }
#[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<OpeningBalanceAccountMapping>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)] #[repr(i32)]
pub enum JournalSide { 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<Self> {
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. /// Generated client implementations.
pub mod accounting_client { pub mod accounting_client {
#![allow( #![allow(
@@ -572,6 +708,30 @@ pub mod accounting_client {
self.inner = self.inner.max_encoding_message_size(limit); self.inner = self.inner.max_encoding_message_size(limit);
self self
} }
/// Resolve or atomically create every node in a parsed account path.
pub async fn ensure_account(
&mut self,
request: impl tonic::IntoRequest<super::EnsureAccountRequest>,
) -> std::result::Result<tonic::Response<super::Account>, 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 /// 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. /// all supplied lines atomically when journal_id identifies an existing one.
pub async fn post_journal( pub async fn post_journal(
@@ -1016,6 +1176,95 @@ pub mod accounting_client {
); );
self.inner.unary(req, path, codec).await 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<super::MapOpeningBalanceAccountRequest>,
) -> std::result::Result<
tonic::Response<super::OpeningBalanceAccountMapping>,
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<super::UnmapOpeningBalanceAccountRequest>,
) -> std::result::Result<
tonic::Response<super::UnmapOpeningBalanceAccountResponse>,
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<super::ListOpeningBalanceAccountsRequest>,
) -> std::result::Result<
tonic::Response<super::ListOpeningBalanceAccountsResponse>,
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. /// Generated server implementations.
@@ -1031,6 +1280,11 @@ pub mod accounting_server {
/// Generated trait containing gRPC methods that should be implemented for use with AccountingServer. /// Generated trait containing gRPC methods that should be implemented for use with AccountingServer.
#[async_trait] #[async_trait]
pub trait Accounting: std::marker::Send + std::marker::Sync + 'static { 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<super::EnsureAccountRequest>,
) -> std::result::Result<tonic::Response<super::Account>, tonic::Status>;
/// Create a journal with its first lines when journal_id is absent, or append /// 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. /// all supplied lines atomically when journal_id identifies an existing one.
async fn post_journal( async fn post_journal(
@@ -1139,6 +1393,29 @@ pub mod accounting_server {
tonic::Response<super::ListPeriodBalancesResponse>, tonic::Response<super::ListPeriodBalancesResponse>,
tonic::Status, 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<super::MapOpeningBalanceAccountRequest>,
) -> std::result::Result<
tonic::Response<super::OpeningBalanceAccountMapping>,
tonic::Status,
>;
async fn unmap_opening_balance_account(
&self,
request: tonic::Request<super::UnmapOpeningBalanceAccountRequest>,
) -> std::result::Result<
tonic::Response<super::UnmapOpeningBalanceAccountResponse>,
tonic::Status,
>;
async fn list_opening_balance_accounts(
&self,
request: tonic::Request<super::ListOpeningBalanceAccountsRequest>,
) -> std::result::Result<
tonic::Response<super::ListOpeningBalanceAccountsResponse>,
tonic::Status,
>;
} }
/// Mutable informational journals. A journal may contain only debits, only /// Mutable informational journals. A journal may contain only debits, only
/// credits, or any non-zero balance. Balance is reported but never enforced. /// 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<B>) -> Self::Future { fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() { match req.uri().path() {
"/komp_ac.accounting.Accounting/EnsureAccount" => {
#[allow(non_camel_case_types)]
struct EnsureAccountSvc<T: Accounting>(pub Arc<T>);
impl<
T: Accounting,
> tonic::server::UnaryService<super::EnsureAccountRequest>
for EnsureAccountSvc<T> {
type Response = super::Account;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::EnsureAccountRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Accounting>::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" => { "/komp_ac.accounting.Accounting/PostJournal" => {
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
struct PostJournalSvc<T: Accounting>(pub Arc<T>); struct PostJournalSvc<T: Accounting>(pub Arc<T>);
@@ -1957,6 +2279,161 @@ pub mod accounting_server {
}; };
Box::pin(fut) Box::pin(fut)
} }
"/komp_ac.accounting.Accounting/MapOpeningBalanceAccount" => {
#[allow(non_camel_case_types)]
struct MapOpeningBalanceAccountSvc<T: Accounting>(pub Arc<T>);
impl<
T: Accounting,
> tonic::server::UnaryService<super::MapOpeningBalanceAccountRequest>
for MapOpeningBalanceAccountSvc<T> {
type Response = super::OpeningBalanceAccountMapping;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::MapOpeningBalanceAccountRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Accounting>::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<T: Accounting>(pub Arc<T>);
impl<
T: Accounting,
> tonic::server::UnaryService<
super::UnmapOpeningBalanceAccountRequest,
> for UnmapOpeningBalanceAccountSvc<T> {
type Response = super::UnmapOpeningBalanceAccountResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::UnmapOpeningBalanceAccountRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Accounting>::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<T: Accounting>(pub Arc<T>);
impl<
T: Accounting,
> tonic::server::UnaryService<
super::ListOpeningBalanceAccountsRequest,
> for ListOpeningBalanceAccountsSvc<T> {
type Response = super::ListOpeningBalanceAccountsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::ListOpeningBalanceAccountsRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Accounting>::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 { Box::pin(async move {
let mut response = http::Response::new( let mut response = http::Response::new(

View File

@@ -9,10 +9,11 @@ pub struct PreviewEcbConversionRequest {
pub original_currency: ::prost::alloc::string::String, pub original_currency: ::prost::alloc::string::String,
#[prost(enumeration = "EcbConversionContext", tag = "3")] #[prost(enumeration = "EcbConversionContext", tag = "3")]
pub conversion_context: i32, pub conversion_context: i32,
/// ISO calendar date (YYYY-MM-DD). Its meaning is selected by /// ISO calendar date (YYYY-MM-DD) from which the applicable publication date
/// conversion_context: transaction, statement, or decisive date. /// is derived. Its meaning is selected by conversion_context: transaction,
/// statement, or decisive date.
#[prost(string, tag = "4")] #[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 /// Required. Profile whose rates apply. Only consulted when use_custom_rate is
/// set, but always required so a preview names the books it describes. /// set, but always required so a preview names the books it describes.
#[prost(string, tag = "5")] #[prost(string, tag = "5")]
@@ -36,7 +37,7 @@ pub struct PreviewEcbConversionResponse {
#[prost(enumeration = "EcbConversionContext", tag = "4")] #[prost(enumeration = "EcbConversionContext", tag = "4")]
pub conversion_context: i32, pub conversion_context: i32,
#[prost(string, tag = "5")] #[prost(string, tag = "5")]
pub anchor_date: ::prost::alloc::string::String, pub conversion_basis_date: ::prost::alloc::string::String,
#[prost(string, tag = "6")] #[prost(string, tag = "6")]
pub determination_method: ::prost::alloc::string::String, pub determination_method: ::prost::alloc::string::String,
#[prost(string, tag = "7")] #[prost(string, tag = "7")]
@@ -109,7 +110,7 @@ pub struct EcbConversionEvidence {
#[prost(string, tag = "6")] #[prost(string, tag = "6")]
pub conversion_context: ::prost::alloc::string::String, pub conversion_context: ::prost::alloc::string::String,
#[prost(string, tag = "7")] #[prost(string, tag = "7")]
pub anchor_date: ::prost::alloc::string::String, pub conversion_basis_date: ::prost::alloc::string::String,
#[prost(string, tag = "8")] #[prost(string, tag = "8")]
pub determination_method: ::prost::alloc::string::String, pub determination_method: ::prost::alloc::string::String,
#[prost(string, tag = "9")] #[prost(string, tag = "9")]
@@ -157,7 +158,7 @@ pub struct ListEcbConversionEvidenceResponse {
#[prost(bool, tag = "3")] #[prost(bool, tag = "3")]
pub has_more: bool, 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)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)] #[repr(i32)]
pub enum EcbConversionContext { pub enum EcbConversionContext {

2
server

Submodule server updated: 4204f74373...e09b0b4c37