2969 lines
134 KiB
Rust
2969 lines
134 KiB
Rust
// This file is @generated by prost-build.
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct EnsureAccountRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
/// Slash-delimited root-to-leaf account path, for example "123/12/1".
|
|
#[prost(string, tag = "2")]
|
|
pub account: ::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(serde::Serialize, serde::Deserialize)]
|
|
#[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,
|
|
/// Slash-delimited root-to-leaf account path.
|
|
#[prost(string, tag = "4")]
|
|
pub account: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub denomination_currency: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct PostJournalRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
/// Absent creates a new journal. Present must identify an existing journal;
|
|
/// an unknown id is never treated as a request to create one.
|
|
#[prost(int64, optional, tag = "2")]
|
|
pub journal_id: ::core::option::Option<i64>,
|
|
/// 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.
|
|
#[prost(string, tag = "4")]
|
|
pub description: ::prost::alloc::string::String,
|
|
/// At least one line is required. The lines are inserted atomically and the
|
|
/// journal is allowed to remain unbalanced.
|
|
#[prost(message, repeated, tag = "5")]
|
|
pub lines: ::prost::alloc::vec::Vec<JournalLineInput>,
|
|
/// Required, unique within the profile, and at most 10 characters when
|
|
/// creating. Must be empty when appending to an existing journal selected by
|
|
/// journal_id.
|
|
#[prost(string, tag = "6")]
|
|
pub journal_name: ::prost::alloc::string::String,
|
|
/// Accounting date in YYYY-MM-DD. Empty defaults to the current UTC date when
|
|
/// creating. Must be empty when appending. Rejected when it falls at or before
|
|
/// the latest closed or approved accounting boundary for the profile.
|
|
#[prost(string, tag = "7")]
|
|
pub accounting_date: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct JournalLineInput {
|
|
#[prost(enumeration = "JournalSide", tag = "1")]
|
|
pub side: i32,
|
|
/// Slash-delimited root-to-leaf account path.
|
|
#[prost(string, tag = "2")]
|
|
pub account: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub amount: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub description: ::prost::alloc::string::String,
|
|
/// Empty uses the profile provider's previous publication. 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::exchange_rates::ExchangeRateSelection,
|
|
>,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct CloseJournalRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
#[prost(int64, tag = "2")]
|
|
pub journal_id: i64,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct ReopenJournalRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
#[prost(int64, tag = "2")]
|
|
pub journal_id: i64,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct GetJournalRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
#[prost(int64, tag = "2")]
|
|
pub journal_id: i64,
|
|
/// 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,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct GetAccountingStatusRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct SearchJournalsRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
/// Case-insensitive literal substring. Empty returns all profile journals.
|
|
#[prost(string, tag = "2")]
|
|
pub name_query: ::prost::alloc::string::String,
|
|
/// Zero uses 50. The maximum is 500.
|
|
#[prost(int32, tag = "3")]
|
|
pub page_size: i32,
|
|
/// Opaque cursor returned by the previous response.
|
|
#[prost(string, tag = "4")]
|
|
pub page_token: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct JournalSummary {
|
|
#[prost(int64, tag = "1")]
|
|
pub journal_id: i64,
|
|
#[prost(string, tag = "2")]
|
|
pub journal_name: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub currency: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub description: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub total_debit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "6")]
|
|
pub total_credit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "7")]
|
|
pub balance: ::prost::alloc::string::String,
|
|
#[prost(int64, tag = "8")]
|
|
pub active_line_count: i64,
|
|
#[prost(bool, tag = "9")]
|
|
pub closed: bool,
|
|
#[prost(string, tag = "10")]
|
|
pub created_at: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "11")]
|
|
pub accounting_date: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct SearchJournalsResponse {
|
|
#[prost(message, repeated, tag = "1")]
|
|
pub journals: ::prost::alloc::vec::Vec<JournalSummary>,
|
|
#[prost(int64, tag = "2")]
|
|
pub total_count: i64,
|
|
#[prost(string, tag = "3")]
|
|
pub next_page_token: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct AccountingStatus {
|
|
#[prost(bool, tag = "1")]
|
|
pub all_journals_balanced: bool,
|
|
#[prost(int64, tag = "2")]
|
|
pub journal_count: i64,
|
|
#[prost(int64, tag = "3")]
|
|
pub balanced_journal_count: i64,
|
|
#[prost(int64, tag = "4")]
|
|
pub unbalanced_journal_count: i64,
|
|
#[prost(string, tag = "5")]
|
|
pub calculated_at: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct ListUnbalancedJournalsRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
/// Zero uses 50. The maximum is 500.
|
|
#[prost(int32, tag = "2")]
|
|
pub page_size: i32,
|
|
/// Opaque cursor returned by the previous response. Empty starts at the
|
|
/// oldest unbalanced journal.
|
|
#[prost(string, tag = "3")]
|
|
pub page_token: ::prost::alloc::string::String,
|
|
/// Optional ISO 4217 currency filter. Empty includes every currency.
|
|
#[prost(string, tag = "4")]
|
|
pub currency: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct UnbalancedJournalSummary {
|
|
#[prost(int64, tag = "1")]
|
|
pub journal_id: i64,
|
|
#[prost(string, tag = "2")]
|
|
pub description: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub currency: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub total_debit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub total_credit: ::prost::alloc::string::String,
|
|
/// Signed credits-minus-debits difference.
|
|
#[prost(string, tag = "6")]
|
|
pub balance: ::prost::alloc::string::String,
|
|
/// Side and positive amount needed to make the journal balance zero.
|
|
#[prost(enumeration = "JournalSide", tag = "7")]
|
|
pub missing_side: i32,
|
|
#[prost(string, tag = "8")]
|
|
pub missing_amount: ::prost::alloc::string::String,
|
|
#[prost(int64, tag = "9")]
|
|
pub active_line_count: i64,
|
|
#[prost(string, tag = "10")]
|
|
pub created_at: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "11")]
|
|
pub journal_name: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "12")]
|
|
pub accounting_date: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ListUnbalancedJournalsResponse {
|
|
#[prost(message, repeated, tag = "1")]
|
|
pub journals: ::prost::alloc::vec::Vec<UnbalancedJournalSummary>,
|
|
#[prost(int64, tag = "2")]
|
|
pub total_unbalanced_count: i64,
|
|
#[prost(string, tag = "3")]
|
|
pub next_page_token: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct SoftDeleteJournalLineRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
#[prost(int64, tag = "2")]
|
|
pub journal_id: i64,
|
|
#[prost(int64, tag = "3")]
|
|
pub journal_line_id: i64,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[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(serde::Serialize, serde::Deserialize)]
|
|
#[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(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct JournalLine {
|
|
#[prost(int64, tag = "1")]
|
|
pub id: i64,
|
|
#[prost(int32, tag = "2")]
|
|
pub line_number: i32,
|
|
#[prost(enumeration = "JournalSide", tag = "3")]
|
|
pub side: i32,
|
|
/// Slash-delimited root-to-leaf path of the posted account.
|
|
#[prost(string, tag = "4")]
|
|
pub account: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub amount: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "6")]
|
|
pub description: ::prost::alloc::string::String,
|
|
#[prost(bool, tag = "7")]
|
|
pub deleted: bool,
|
|
#[prost(string, tag = "8")]
|
|
pub created_at: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "9")]
|
|
pub deleted_at: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "10")]
|
|
pub source_table_name: ::prost::alloc::string::String,
|
|
#[prost(int64, tag = "11")]
|
|
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(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct Journal {
|
|
#[prost(int64, tag = "1")]
|
|
pub id: i64,
|
|
#[prost(string, tag = "2")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub currency: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub description: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub created_at: ::prost::alloc::string::String,
|
|
#[prost(message, repeated, tag = "6")]
|
|
pub lines: ::prost::alloc::vec::Vec<JournalLine>,
|
|
#[prost(string, tag = "7")]
|
|
pub total_debit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "8")]
|
|
pub total_credit: ::prost::alloc::string::String,
|
|
/// Informational difference calculated as credits minus debits.
|
|
#[prost(string, tag = "9")]
|
|
pub balance: ::prost::alloc::string::String,
|
|
#[prost(bool, tag = "10")]
|
|
pub closed: bool,
|
|
#[prost(string, tag = "11")]
|
|
pub closed_at: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "12")]
|
|
pub closed_by_user_id: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "13")]
|
|
pub journal_name: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "14")]
|
|
pub accounting_date: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct ConfigureAccountingPeriodRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
/// First day of the period, YYYY-MM-DD. Must be the first day of a month.
|
|
#[prost(string, tag = "2")]
|
|
pub period_start: ::prost::alloc::string::String,
|
|
/// Optional link to the preceding period in a carry chain.
|
|
#[prost(int64, optional, tag = "4")]
|
|
pub previous_period_id: ::core::option::Option<i64>,
|
|
/// Required. Decides the length of the period.
|
|
#[prost(enumeration = "AccountingPeriodType", tag = "5")]
|
|
pub period_type: i32,
|
|
/// Last day of the period, YYYY-MM-DD. Required for PARTIAL and rejected for
|
|
/// every other type, whose end follows from the start.
|
|
#[prost(string, tag = "6")]
|
|
pub period_end: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct CloseAccountingPeriodRequest {
|
|
#[prost(int64, tag = "1")]
|
|
pub period_id: i64,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct ReopenAccountingPeriodRequest {
|
|
#[prost(int64, tag = "1")]
|
|
pub period_id: i64,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct ApproveProfileRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct GetProfileApprovalRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
}
|
|
/// Approval state of one profile's financial statement.
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct ProfileApproval {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
#[prost(bool, tag = "2")]
|
|
pub approved: bool,
|
|
/// Empty while the profile is unapproved.
|
|
#[prost(string, tag = "3")]
|
|
pub approved_at: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub approved_by_user_id: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct GetAccountingPeriodRequest {
|
|
#[prost(int64, tag = "1")]
|
|
pub period_id: i64,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct ListAccountingPeriodsRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ListAccountingPeriodsResponse {
|
|
#[prost(message, repeated, tag = "1")]
|
|
pub periods: ::prost::alloc::vec::Vec<AccountingPeriod>,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct AccountingPeriod {
|
|
#[prost(int64, tag = "1")]
|
|
pub id: i64,
|
|
#[prost(string, tag = "2")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub period_start: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub period_end: ::prost::alloc::string::String,
|
|
#[prost(enumeration = "AccountingPeriodStatus", tag = "5")]
|
|
pub status: i32,
|
|
#[prost(int64, tag = "6")]
|
|
pub previous_period_id: i64,
|
|
#[prost(string, tag = "7")]
|
|
pub closed_at: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "8")]
|
|
pub closed_by_user_id: ::prost::alloc::string::String,
|
|
#[prost(enumeration = "AccountingPeriodType", tag = "11")]
|
|
pub period_type: i32,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct ListPeriodBalancesRequest {
|
|
#[prost(int64, tag = "1")]
|
|
pub period_id: i64,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct PeriodBalance {
|
|
#[prost(int64, tag = "1")]
|
|
pub period_id: i64,
|
|
/// Slash-delimited root-to-leaf path of this frozen balance's account.
|
|
#[prost(string, tag = "2")]
|
|
pub account: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub currency: ::prost::alloc::string::String,
|
|
/// Signed nets use debit-positive convention.
|
|
#[prost(string, tag = "4")]
|
|
pub opening_balance: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub period_debit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "6")]
|
|
pub period_credit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "7")]
|
|
pub closing_balance: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct PeriodDenominationBalance {
|
|
#[prost(int64, tag = "1")]
|
|
pub period_id: i64,
|
|
/// Exact denominated account. Unlike book balances, this quantity is not
|
|
/// rolled up into parent accounts with a different denomination.
|
|
#[prost(string, tag = "2")]
|
|
pub account: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub denomination_currency: ::prost::alloc::string::String,
|
|
/// Signed nets use debit-positive convention and remain in the denomination
|
|
/// currency without conversion during carry-forward.
|
|
#[prost(string, tag = "4")]
|
|
pub opening_quantity: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub period_debit_quantity: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "6")]
|
|
pub period_credit_quantity: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "7")]
|
|
pub closing_quantity: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ListPeriodBalancesResponse {
|
|
#[prost(message, repeated, tag = "1")]
|
|
pub balances: ::prost::alloc::vec::Vec<PeriodBalance>,
|
|
#[prost(message, repeated, tag = "2")]
|
|
pub denomination_balances: ::prost::alloc::vec::Vec<PeriodDenominationBalance>,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct GetTrialBalanceRequest {
|
|
#[prost(int64, tag = "1")]
|
|
pub period_id: i64,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct TrialBalanceRow {
|
|
/// Slash-delimited root-to-leaf account path. Rows include both posting
|
|
/// accounts and consolidated ancestors from the frozen period snapshot.
|
|
#[prost(string, tag = "1")]
|
|
pub account: ::prost::alloc::string::String,
|
|
#[prost(uint32, tag = "2")]
|
|
pub depth: u32,
|
|
#[prost(bool, tag = "3")]
|
|
pub is_summary: bool,
|
|
#[prost(string, tag = "4")]
|
|
pub currency: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub opening_debit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "6")]
|
|
pub opening_credit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "7")]
|
|
pub period_debit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "8")]
|
|
pub period_credit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "9")]
|
|
pub closing_debit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "10")]
|
|
pub closing_credit: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct TrialBalanceTotals {
|
|
/// Totals are calculated from root rows only, because descendant rows are
|
|
/// already consolidated into their ancestors.
|
|
#[prost(string, tag = "1")]
|
|
pub opening_debit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub opening_credit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub period_debit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub period_credit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub closing_debit: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "6")]
|
|
pub closing_credit: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct GetTrialBalanceResponse {
|
|
#[prost(message, optional, tag = "1")]
|
|
pub period: ::core::option::Option<AccountingPeriod>,
|
|
#[prost(string, tag = "2")]
|
|
pub currency: ::prost::alloc::string::String,
|
|
#[prost(message, repeated, tag = "3")]
|
|
pub rows: ::prost::alloc::vec::Vec<TrialBalanceRow>,
|
|
#[prost(message, optional, tag = "4")]
|
|
pub totals: ::core::option::Option<TrialBalanceTotals>,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct GenerateAccountingTransferRequest {
|
|
#[prost(string, tag = "1")]
|
|
pub profile_name: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "2")]
|
|
pub table_name: ::prost::alloc::string::String,
|
|
#[prost(int64, tag = "3")]
|
|
pub source_period_id: i64,
|
|
#[prost(int64, tag = "4")]
|
|
pub target_period_id: i64,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct GenerateAccountingTransferResponse {
|
|
#[prost(int64, tag = "1")]
|
|
pub table_definition_id: i64,
|
|
#[prost(int64, tag = "2")]
|
|
pub generated_row_count: i64,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[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, tag = "2")]
|
|
pub source_account: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub target_account: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct UnmapOpeningBalanceAccountRequest {
|
|
#[prost(int64, tag = "1")]
|
|
pub target_period_id: i64,
|
|
#[prost(string, tag = "2")]
|
|
pub target_account: ::prost::alloc::string::String,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct UnmapOpeningBalanceAccountResponse {
|
|
#[prost(bool, tag = "1")]
|
|
pub removed: bool,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct ListOpeningBalanceAccountsRequest {
|
|
#[prost(int64, tag = "1")]
|
|
pub target_period_id: i64,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[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, tag = "4")]
|
|
pub source_account: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "5")]
|
|
pub target_profile_name: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "6")]
|
|
pub target_account: ::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,
|
|
#[prost(string, tag = "15")]
|
|
pub denomination_currency: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "16")]
|
|
pub denomination_opening_quantity: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "17")]
|
|
pub denomination_period_debit_quantity: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "18")]
|
|
pub denomination_period_credit_quantity: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "19")]
|
|
pub denomination_current_quantity: ::prost::alloc::string::String,
|
|
}
|
|
/// A portion of a predecessor account's value that no mapping carries into the
|
|
/// target period. Closing the target period drops this value, so each entry must
|
|
/// either be covered by a broader mapping or deliberately closed out.
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct UnmappedSourceBalance {
|
|
#[prost(int64, tag = "1")]
|
|
pub source_period_id: i64,
|
|
#[prost(string, tag = "2")]
|
|
pub source_profile_name: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub source_account: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub currency: ::prost::alloc::string::String,
|
|
/// Signed portion not covered by a mapping, using the debit-positive
|
|
/// convention. This is never zero and may be less than the account's
|
|
/// aggregate closing balance when descendants are mapped separately.
|
|
#[prost(string, tag = "5")]
|
|
pub unmapped_balance: ::prost::alloc::string::String,
|
|
#[prost(enumeration = "OpeningBalanceStatus", tag = "6")]
|
|
pub status: i32,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
pub struct UnmappedSourceDenominationBalance {
|
|
#[prost(int64, tag = "1")]
|
|
pub source_period_id: i64,
|
|
#[prost(string, tag = "2")]
|
|
pub source_profile_name: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "3")]
|
|
pub source_account: ::prost::alloc::string::String,
|
|
#[prost(string, tag = "4")]
|
|
pub denomination_currency: ::prost::alloc::string::String,
|
|
/// Exact foreign-currency quantity that no mapping carries forward.
|
|
#[prost(string, tag = "5")]
|
|
pub unmapped_quantity: ::prost::alloc::string::String,
|
|
#[prost(enumeration = "OpeningBalanceStatus", tag = "6")]
|
|
pub status: i32,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct ListOpeningBalanceAccountsResponse {
|
|
#[prost(message, repeated, tag = "1")]
|
|
pub mappings: ::prost::alloc::vec::Vec<OpeningBalanceAccountMapping>,
|
|
/// Empty while the target period still inherits every predecessor balance by
|
|
/// account path. Populated once the period carries balances by explicit
|
|
/// mapping only, which happens when the predecessor belongs to another
|
|
/// profile or when the period has at least one mapping of its own.
|
|
#[prost(message, repeated, tag = "2")]
|
|
pub unmapped_source_balances: ::prost::alloc::vec::Vec<UnmappedSourceBalance>,
|
|
#[prost(message, repeated, tag = "3")]
|
|
pub unmapped_source_denomination_balances: ::prost::alloc::vec::Vec<
|
|
UnmappedSourceDenominationBalance,
|
|
>,
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
|
#[repr(i32)]
|
|
pub enum JournalSide {
|
|
Unspecified = 0,
|
|
Debit = 1,
|
|
Credit = 2,
|
|
}
|
|
impl JournalSide {
|
|
/// 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 => "JOURNAL_SIDE_UNSPECIFIED",
|
|
Self::Debit => "JOURNAL_SIDE_DEBIT",
|
|
Self::Credit => "JOURNAL_SIDE_CREDIT",
|
|
}
|
|
}
|
|
/// Creates an enum from field names used in the ProtoBuf definition.
|
|
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
|
|
match value {
|
|
"JOURNAL_SIDE_UNSPECIFIED" => Some(Self::Unspecified),
|
|
"JOURNAL_SIDE_DEBIT" => Some(Self::Debit),
|
|
"JOURNAL_SIDE_CREDIT" => Some(Self::Credit),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|
|
/// A period is only ever open or closed. Approval is a fact about the whole
|
|
/// profile, because the profile is the accounting period being reported on.
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
|
#[repr(i32)]
|
|
pub enum AccountingPeriodStatus {
|
|
Unspecified = 0,
|
|
Open = 1,
|
|
Closed = 2,
|
|
}
|
|
impl AccountingPeriodStatus {
|
|
/// 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 => "ACCOUNTING_PERIOD_STATUS_UNSPECIFIED",
|
|
Self::Open => "ACCOUNTING_PERIOD_STATUS_OPEN",
|
|
Self::Closed => "ACCOUNTING_PERIOD_STATUS_CLOSED",
|
|
}
|
|
}
|
|
/// Creates an enum from field names used in the ProtoBuf definition.
|
|
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
|
|
match value {
|
|
"ACCOUNTING_PERIOD_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
|
|
"ACCOUNTING_PERIOD_STATUS_OPEN" => Some(Self::Open),
|
|
"ACCOUNTING_PERIOD_STATUS_CLOSED" => Some(Self::Closed),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|
|
/// How long one accounting period lasts. MONTH and YEAR span whole months, so
|
|
/// the caller states only the start and the end is derived. PARTIAL is the
|
|
/// exception for periods real life cut short.
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
|
#[repr(i32)]
|
|
pub enum AccountingPeriodType {
|
|
Unspecified = 0,
|
|
/// One calendar month.
|
|
Month = 1,
|
|
/// Twelve consecutive months. Starting in January gives the calendar year;
|
|
/// any other start month gives a business year (hospodársky rok).
|
|
Year = 2,
|
|
/// Neither a whole month nor a whole year, because the entity was formed or
|
|
/// terminated part-way through one. The only type carrying an explicit end.
|
|
Partial = 3,
|
|
}
|
|
impl AccountingPeriodType {
|
|
/// 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 => "ACCOUNTING_PERIOD_TYPE_UNSPECIFIED",
|
|
Self::Month => "ACCOUNTING_PERIOD_TYPE_MONTH",
|
|
Self::Year => "ACCOUNTING_PERIOD_TYPE_YEAR",
|
|
Self::Partial => "ACCOUNTING_PERIOD_TYPE_PARTIAL",
|
|
}
|
|
}
|
|
/// Creates an enum from field names used in the ProtoBuf definition.
|
|
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
|
|
match value {
|
|
"ACCOUNTING_PERIOD_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
|
|
"ACCOUNTING_PERIOD_TYPE_MONTH" => Some(Self::Month),
|
|
"ACCOUNTING_PERIOD_TYPE_YEAR" => Some(Self::Year),
|
|
"ACCOUNTING_PERIOD_TYPE_PARTIAL" => Some(Self::Partial),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|
|
#[derive(serde::Serialize, serde::Deserialize)]
|
|
#[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.
|
|
pub mod accounting_client {
|
|
#![allow(
|
|
unused_variables,
|
|
dead_code,
|
|
missing_docs,
|
|
clippy::wildcard_imports,
|
|
clippy::let_unit_value,
|
|
)]
|
|
use tonic::codegen::*;
|
|
use tonic::codegen::http::Uri;
|
|
/// Mutable informational journals. A journal may contain only debits, only
|
|
/// credits, or any non-zero balance. Balance is reported but never enforced.
|
|
/// Accounting periods close date ranges inside a profile and freeze account sums
|
|
/// without replacing the live accounts projection. Closed periods can be reopened;
|
|
/// approved periods are final.
|
|
#[derive(Debug, Clone)]
|
|
pub struct AccountingClient<T> {
|
|
inner: tonic::client::Grpc<T>,
|
|
}
|
|
impl AccountingClient<tonic::transport::Channel> {
|
|
/// Attempt to create a new client by connecting to a given endpoint.
|
|
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
|
|
where
|
|
D: TryInto<tonic::transport::Endpoint>,
|
|
D::Error: Into<StdError>,
|
|
{
|
|
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
|
|
Ok(Self::new(conn))
|
|
}
|
|
}
|
|
impl<T> AccountingClient<T>
|
|
where
|
|
T: tonic::client::GrpcService<tonic::body::Body>,
|
|
T::Error: Into<StdError>,
|
|
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
|
|
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
|
|
{
|
|
pub fn new(inner: T) -> Self {
|
|
let inner = tonic::client::Grpc::new(inner);
|
|
Self { inner }
|
|
}
|
|
pub fn with_origin(inner: T, origin: Uri) -> Self {
|
|
let inner = tonic::client::Grpc::with_origin(inner, origin);
|
|
Self { inner }
|
|
}
|
|
pub fn with_interceptor<F>(
|
|
inner: T,
|
|
interceptor: F,
|
|
) -> AccountingClient<InterceptedService<T, F>>
|
|
where
|
|
F: tonic::service::Interceptor,
|
|
T::ResponseBody: Default,
|
|
T: tonic::codegen::Service<
|
|
http::Request<tonic::body::Body>,
|
|
Response = http::Response<
|
|
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
|
|
>,
|
|
>,
|
|
<T as tonic::codegen::Service<
|
|
http::Request<tonic::body::Body>,
|
|
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
|
|
{
|
|
AccountingClient::new(InterceptedService::new(inner, interceptor))
|
|
}
|
|
/// Compress requests with the given encoding.
|
|
///
|
|
/// This requires the server to support it otherwise it might respond with an
|
|
/// error.
|
|
#[must_use]
|
|
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
|
|
self.inner = self.inner.send_compressed(encoding);
|
|
self
|
|
}
|
|
/// Enable decompressing responses.
|
|
#[must_use]
|
|
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
|
|
self.inner = self.inner.accept_compressed(encoding);
|
|
self
|
|
}
|
|
/// Limits the maximum size of a decoded message.
|
|
///
|
|
/// Default: `4MB`
|
|
#[must_use]
|
|
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
|
|
self.inner = self.inner.max_decoding_message_size(limit);
|
|
self
|
|
}
|
|
/// Limits the maximum size of an encoded message.
|
|
///
|
|
/// Default: `usize::MAX`
|
|
#[must_use]
|
|
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
|
|
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<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
|
|
/// all supplied lines atomically when journal_id identifies an existing one.
|
|
pub async fn post_journal(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::PostJournalRequest>,
|
|
) -> 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/PostJournal",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("komp_ac.accounting.Accounting", "PostJournal"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
/// Close a balanced journal. Closed journals can be reopened while their
|
|
/// accounting period is open.
|
|
pub async fn close_journal(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::CloseJournalRequest>,
|
|
) -> 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/CloseJournal",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new("komp_ac.accounting.Accounting", "CloseJournal"),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn reopen_journal(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ReopenJournalRequest>,
|
|
) -> 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/ReopenJournal",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new("komp_ac.accounting.Accounting", "ReopenJournal"),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
/// Return journal lines and credits-minus-debits informational balance.
|
|
pub async fn get_journal(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GetJournalRequest>,
|
|
) -> 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/GetJournal",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(GrpcMethod::new("komp_ac.accounting.Accounting", "GetJournal"));
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
/// Search profile journals by user-facing name while retaining journal ids
|
|
/// as the stable relationship keys.
|
|
pub async fn search_journals(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::SearchJournalsRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::SearchJournalsResponse>,
|
|
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/SearchJournals",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new("komp_ac.accounting.Accounting", "SearchJournals"),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
/// Return the profile-wide count of balanced and unbalanced journals.
|
|
pub async fn get_accounting_status(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GetAccountingStatusRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::AccountingStatus>,
|
|
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/GetAccountingStatus",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new(
|
|
"komp_ac.accounting.Accounting",
|
|
"GetAccountingStatus",
|
|
),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
/// Return an oldest-first, paginated queue of unbalanced journals.
|
|
pub async fn list_unbalanced_journals(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ListUnbalancedJournalsRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::ListUnbalancedJournalsResponse>,
|
|
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/ListUnbalancedJournals",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new(
|
|
"komp_ac.accounting.Accounting",
|
|
"ListUnbalancedJournals",
|
|
),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
/// Soft-delete one line while retaining it for audit display.
|
|
pub async fn soft_delete_journal_line(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::SoftDeleteJournalLineRequest>,
|
|
) -> 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/SoftDeleteJournalLine",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new(
|
|
"komp_ac.accounting.Accounting",
|
|
"SoftDeleteJournalLine",
|
|
),
|
|
);
|
|
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(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ConfigureAccountingPeriodRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::AccountingPeriod>,
|
|
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/ConfigureAccountingPeriod",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new(
|
|
"komp_ac.accounting.Accounting",
|
|
"ConfigureAccountingPeriod",
|
|
),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
/// Closing snapshots balances and blocks mutations through the period end.
|
|
/// A closed period may be reopened until the profile is approved.
|
|
pub async fn close_accounting_period(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::CloseAccountingPeriodRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::AccountingPeriod>,
|
|
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/CloseAccountingPeriod",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new(
|
|
"komp_ac.accounting.Accounting",
|
|
"CloseAccountingPeriod",
|
|
),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn reopen_accounting_period(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ReopenAccountingPeriodRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::AccountingPeriod>,
|
|
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/ReopenAccountingPeriod",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new(
|
|
"komp_ac.accounting.Accounting",
|
|
"ReopenAccountingPeriod",
|
|
),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
/// Approves the profile's financial statement. One profile is one accounting
|
|
/// period, and approval happens once for it, not once per period inside it.
|
|
/// Every period must be closed first, and none may be reopened afterwards.
|
|
pub async fn approve_profile(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ApproveProfileRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::ProfileApproval>,
|
|
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/ApproveProfile",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new("komp_ac.accounting.Accounting", "ApproveProfile"),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn get_profile_approval(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GetProfileApprovalRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::ProfileApproval>,
|
|
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/GetProfileApproval",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new(
|
|
"komp_ac.accounting.Accounting",
|
|
"GetProfileApproval",
|
|
),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn get_accounting_period(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GetAccountingPeriodRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::AccountingPeriod>,
|
|
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/GetAccountingPeriod",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new(
|
|
"komp_ac.accounting.Accounting",
|
|
"GetAccountingPeriod",
|
|
),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn list_accounting_periods(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ListAccountingPeriodsRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::ListAccountingPeriodsResponse>,
|
|
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/ListAccountingPeriods",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new(
|
|
"komp_ac.accounting.Accounting",
|
|
"ListAccountingPeriods",
|
|
),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
pub async fn list_period_balances(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::ListPeriodBalancesRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::ListPeriodBalancesResponse>,
|
|
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/ListPeriodBalances",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new(
|
|
"komp_ac.accounting.Accounting",
|
|
"ListPeriodBalances",
|
|
),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
/// Return a predvaha from one closed period's frozen account balances.
|
|
/// Opening and closing signed balances are presented on their debit or credit
|
|
/// side, while period turnover retains the journal's debit and credit columns.
|
|
pub async fn get_trial_balance(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GetTrialBalanceRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::GetTrialBalanceResponse>,
|
|
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/GetTrialBalance",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new("komp_ac.accounting.Accounting", "GetTrialBalance"),
|
|
);
|
|
self.inner.unary(req, path, codec).await
|
|
}
|
|
/// Materialize one row per directly transferable source account in a table
|
|
/// containing an ACCOUNTING_TRANSFER definition. Source fields are frozen
|
|
/// accounting facts; target fields start as an unchanged same-path copy and
|
|
/// may then be changed by the table's Steel logic or by the user.
|
|
pub async fn generate_accounting_transfer(
|
|
&mut self,
|
|
request: impl tonic::IntoRequest<super::GenerateAccountingTransferRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::GenerateAccountingTransferResponse>,
|
|
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/GenerateAccountingTransfer",
|
|
);
|
|
let mut req = request.into_request();
|
|
req.extensions_mut()
|
|
.insert(
|
|
GrpcMethod::new(
|
|
"komp_ac.accounting.Accounting",
|
|
"GenerateAccountingTransfer",
|
|
),
|
|
);
|
|
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.
|
|
pub mod accounting_server {
|
|
#![allow(
|
|
unused_variables,
|
|
dead_code,
|
|
missing_docs,
|
|
clippy::wildcard_imports,
|
|
clippy::let_unit_value,
|
|
)]
|
|
use tonic::codegen::*;
|
|
/// 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<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
|
|
/// all supplied lines atomically when journal_id identifies an existing one.
|
|
async fn post_journal(
|
|
&self,
|
|
request: tonic::Request<super::PostJournalRequest>,
|
|
) -> std::result::Result<tonic::Response<super::Journal>, tonic::Status>;
|
|
/// Close a balanced journal. Closed journals can be reopened while their
|
|
/// accounting period is open.
|
|
async fn close_journal(
|
|
&self,
|
|
request: tonic::Request<super::CloseJournalRequest>,
|
|
) -> std::result::Result<tonic::Response<super::Journal>, tonic::Status>;
|
|
async fn reopen_journal(
|
|
&self,
|
|
request: tonic::Request<super::ReopenJournalRequest>,
|
|
) -> std::result::Result<tonic::Response<super::Journal>, tonic::Status>;
|
|
/// Return journal lines and credits-minus-debits informational balance.
|
|
async fn get_journal(
|
|
&self,
|
|
request: tonic::Request<super::GetJournalRequest>,
|
|
) -> std::result::Result<tonic::Response<super::Journal>, tonic::Status>;
|
|
/// Search profile journals by user-facing name while retaining journal ids
|
|
/// as the stable relationship keys.
|
|
async fn search_journals(
|
|
&self,
|
|
request: tonic::Request<super::SearchJournalsRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::SearchJournalsResponse>,
|
|
tonic::Status,
|
|
>;
|
|
/// Return the profile-wide count of balanced and unbalanced journals.
|
|
async fn get_accounting_status(
|
|
&self,
|
|
request: tonic::Request<super::GetAccountingStatusRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::AccountingStatus>,
|
|
tonic::Status,
|
|
>;
|
|
/// Return an oldest-first, paginated queue of unbalanced journals.
|
|
async fn list_unbalanced_journals(
|
|
&self,
|
|
request: tonic::Request<super::ListUnbalancedJournalsRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::ListUnbalancedJournalsResponse>,
|
|
tonic::Status,
|
|
>;
|
|
/// Soft-delete one line while retaining it for audit display.
|
|
async fn soft_delete_journal_line(
|
|
&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(
|
|
&self,
|
|
request: tonic::Request<super::ConfigureAccountingPeriodRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::AccountingPeriod>,
|
|
tonic::Status,
|
|
>;
|
|
/// Closing snapshots balances and blocks mutations through the period end.
|
|
/// A closed period may be reopened until the profile is approved.
|
|
async fn close_accounting_period(
|
|
&self,
|
|
request: tonic::Request<super::CloseAccountingPeriodRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::AccountingPeriod>,
|
|
tonic::Status,
|
|
>;
|
|
async fn reopen_accounting_period(
|
|
&self,
|
|
request: tonic::Request<super::ReopenAccountingPeriodRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::AccountingPeriod>,
|
|
tonic::Status,
|
|
>;
|
|
/// Approves the profile's financial statement. One profile is one accounting
|
|
/// period, and approval happens once for it, not once per period inside it.
|
|
/// Every period must be closed first, and none may be reopened afterwards.
|
|
async fn approve_profile(
|
|
&self,
|
|
request: tonic::Request<super::ApproveProfileRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ProfileApproval>, tonic::Status>;
|
|
async fn get_profile_approval(
|
|
&self,
|
|
request: tonic::Request<super::GetProfileApprovalRequest>,
|
|
) -> std::result::Result<tonic::Response<super::ProfileApproval>, tonic::Status>;
|
|
async fn get_accounting_period(
|
|
&self,
|
|
request: tonic::Request<super::GetAccountingPeriodRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::AccountingPeriod>,
|
|
tonic::Status,
|
|
>;
|
|
async fn list_accounting_periods(
|
|
&self,
|
|
request: tonic::Request<super::ListAccountingPeriodsRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::ListAccountingPeriodsResponse>,
|
|
tonic::Status,
|
|
>;
|
|
async fn list_period_balances(
|
|
&self,
|
|
request: tonic::Request<super::ListPeriodBalancesRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::ListPeriodBalancesResponse>,
|
|
tonic::Status,
|
|
>;
|
|
/// Return a predvaha from one closed period's frozen account balances.
|
|
/// Opening and closing signed balances are presented on their debit or credit
|
|
/// side, while period turnover retains the journal's debit and credit columns.
|
|
async fn get_trial_balance(
|
|
&self,
|
|
request: tonic::Request<super::GetTrialBalanceRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::GetTrialBalanceResponse>,
|
|
tonic::Status,
|
|
>;
|
|
/// Materialize one row per directly transferable source account in a table
|
|
/// containing an ACCOUNTING_TRANSFER definition. Source fields are frozen
|
|
/// accounting facts; target fields start as an unchanged same-path copy and
|
|
/// may then be changed by the table's Steel logic or by the user.
|
|
async fn generate_accounting_transfer(
|
|
&self,
|
|
request: tonic::Request<super::GenerateAccountingTransferRequest>,
|
|
) -> std::result::Result<
|
|
tonic::Response<super::GenerateAccountingTransferResponse>,
|
|
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
|
|
/// credits, or any non-zero balance. Balance is reported but never enforced.
|
|
/// Accounting periods close date ranges inside a profile and freeze account sums
|
|
/// without replacing the live accounts projection. Closed periods can be reopened;
|
|
/// approved periods are final.
|
|
#[derive(Debug)]
|
|
pub struct AccountingServer<T> {
|
|
inner: Arc<T>,
|
|
accept_compression_encodings: EnabledCompressionEncodings,
|
|
send_compression_encodings: EnabledCompressionEncodings,
|
|
max_decoding_message_size: Option<usize>,
|
|
max_encoding_message_size: Option<usize>,
|
|
}
|
|
impl<T> AccountingServer<T> {
|
|
pub fn new(inner: T) -> Self {
|
|
Self::from_arc(Arc::new(inner))
|
|
}
|
|
pub fn from_arc(inner: Arc<T>) -> Self {
|
|
Self {
|
|
inner,
|
|
accept_compression_encodings: Default::default(),
|
|
send_compression_encodings: Default::default(),
|
|
max_decoding_message_size: None,
|
|
max_encoding_message_size: None,
|
|
}
|
|
}
|
|
pub fn with_interceptor<F>(
|
|
inner: T,
|
|
interceptor: F,
|
|
) -> InterceptedService<Self, F>
|
|
where
|
|
F: tonic::service::Interceptor,
|
|
{
|
|
InterceptedService::new(Self::new(inner), interceptor)
|
|
}
|
|
/// Enable decompressing requests with the given encoding.
|
|
#[must_use]
|
|
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
|
|
self.accept_compression_encodings.enable(encoding);
|
|
self
|
|
}
|
|
/// Compress responses with the given encoding, if the client supports it.
|
|
#[must_use]
|
|
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
|
|
self.send_compression_encodings.enable(encoding);
|
|
self
|
|
}
|
|
/// Limits the maximum size of a decoded message.
|
|
///
|
|
/// Default: `4MB`
|
|
#[must_use]
|
|
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
|
|
self.max_decoding_message_size = Some(limit);
|
|
self
|
|
}
|
|
/// Limits the maximum size of an encoded message.
|
|
///
|
|
/// Default: `usize::MAX`
|
|
#[must_use]
|
|
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
|
|
self.max_encoding_message_size = Some(limit);
|
|
self
|
|
}
|
|
}
|
|
impl<T, B> tonic::codegen::Service<http::Request<B>> for AccountingServer<T>
|
|
where
|
|
T: Accounting,
|
|
B: Body + std::marker::Send + 'static,
|
|
B::Error: Into<StdError> + std::marker::Send + 'static,
|
|
{
|
|
type Response = http::Response<tonic::body::Body>;
|
|
type Error = std::convert::Infallible;
|
|
type Future = BoxFuture<Self::Response, Self::Error>;
|
|
fn poll_ready(
|
|
&mut self,
|
|
_cx: &mut Context<'_>,
|
|
) -> Poll<std::result::Result<(), Self::Error>> {
|
|
Poll::Ready(Ok(()))
|
|
}
|
|
fn call(&mut self, req: http::Request<B>) -> Self::Future {
|
|
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" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct PostJournalSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::PostJournalRequest>
|
|
for PostJournalSvc<T> {
|
|
type Response = super::Journal;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::PostJournalRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::post_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 = PostJournalSvc(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/CloseJournal" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct CloseJournalSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::CloseJournalRequest>
|
|
for CloseJournalSvc<T> {
|
|
type Response = super::Journal;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::CloseJournalRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::close_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 = CloseJournalSvc(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/ReopenJournal" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ReopenJournalSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::ReopenJournalRequest>
|
|
for ReopenJournalSvc<T> {
|
|
type Response = super::Journal;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::ReopenJournalRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::reopen_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 = ReopenJournalSvc(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/GetJournal" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct GetJournalSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::GetJournalRequest>
|
|
for GetJournalSvc<T> {
|
|
type Response = super::Journal;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::GetJournalRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::get_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 = GetJournalSvc(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/SearchJournals" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct SearchJournalsSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::SearchJournalsRequest>
|
|
for SearchJournalsSvc<T> {
|
|
type Response = super::SearchJournalsResponse;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::SearchJournalsRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::search_journals(&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 = SearchJournalsSvc(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/GetAccountingStatus" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct GetAccountingStatusSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::GetAccountingStatusRequest>
|
|
for GetAccountingStatusSvc<T> {
|
|
type Response = super::AccountingStatus;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::GetAccountingStatusRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::get_accounting_status(&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 = GetAccountingStatusSvc(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/ListUnbalancedJournals" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ListUnbalancedJournalsSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::ListUnbalancedJournalsRequest>
|
|
for ListUnbalancedJournalsSvc<T> {
|
|
type Response = super::ListUnbalancedJournalsResponse;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::ListUnbalancedJournalsRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::list_unbalanced_journals(&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 = ListUnbalancedJournalsSvc(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/SoftDeleteJournalLine" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct SoftDeleteJournalLineSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::SoftDeleteJournalLineRequest>
|
|
for SoftDeleteJournalLineSvc<T> {
|
|
type Response = super::Journal;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::SoftDeleteJournalLineRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::soft_delete_journal_line(&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 = SoftDeleteJournalLineSvc(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/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>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<
|
|
super::ConfigureAccountingPeriodRequest,
|
|
> for ConfigureAccountingPeriodSvc<T> {
|
|
type Response = super::AccountingPeriod;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<
|
|
super::ConfigureAccountingPeriodRequest,
|
|
>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::configure_accounting_period(
|
|
&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 = ConfigureAccountingPeriodSvc(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/CloseAccountingPeriod" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct CloseAccountingPeriodSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::CloseAccountingPeriodRequest>
|
|
for CloseAccountingPeriodSvc<T> {
|
|
type Response = super::AccountingPeriod;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::CloseAccountingPeriodRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::close_accounting_period(&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 = CloseAccountingPeriodSvc(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/ReopenAccountingPeriod" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ReopenAccountingPeriodSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::ReopenAccountingPeriodRequest>
|
|
for ReopenAccountingPeriodSvc<T> {
|
|
type Response = super::AccountingPeriod;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::ReopenAccountingPeriodRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::reopen_accounting_period(&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 = ReopenAccountingPeriodSvc(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/ApproveProfile" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ApproveProfileSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::ApproveProfileRequest>
|
|
for ApproveProfileSvc<T> {
|
|
type Response = super::ProfileApproval;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::ApproveProfileRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::approve_profile(&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 = ApproveProfileSvc(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/GetProfileApproval" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct GetProfileApprovalSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::GetProfileApprovalRequest>
|
|
for GetProfileApprovalSvc<T> {
|
|
type Response = super::ProfileApproval;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::GetProfileApprovalRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::get_profile_approval(&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 = GetProfileApprovalSvc(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/GetAccountingPeriod" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct GetAccountingPeriodSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::GetAccountingPeriodRequest>
|
|
for GetAccountingPeriodSvc<T> {
|
|
type Response = super::AccountingPeriod;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::GetAccountingPeriodRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::get_accounting_period(&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 = GetAccountingPeriodSvc(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/ListAccountingPeriods" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ListAccountingPeriodsSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::ListAccountingPeriodsRequest>
|
|
for ListAccountingPeriodsSvc<T> {
|
|
type Response = super::ListAccountingPeriodsResponse;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::ListAccountingPeriodsRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::list_accounting_periods(&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 = ListAccountingPeriodsSvc(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/ListPeriodBalances" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct ListPeriodBalancesSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::ListPeriodBalancesRequest>
|
|
for ListPeriodBalancesSvc<T> {
|
|
type Response = super::ListPeriodBalancesResponse;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::ListPeriodBalancesRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::list_period_balances(&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 = ListPeriodBalancesSvc(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/GetTrialBalance" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct GetTrialBalanceSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<super::GetTrialBalanceRequest>
|
|
for GetTrialBalanceSvc<T> {
|
|
type Response = super::GetTrialBalanceResponse;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<super::GetTrialBalanceRequest>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::get_trial_balance(&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 = GetTrialBalanceSvc(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/GenerateAccountingTransfer" => {
|
|
#[allow(non_camel_case_types)]
|
|
struct GenerateAccountingTransferSvc<T: Accounting>(pub Arc<T>);
|
|
impl<
|
|
T: Accounting,
|
|
> tonic::server::UnaryService<
|
|
super::GenerateAccountingTransferRequest,
|
|
> for GenerateAccountingTransferSvc<T> {
|
|
type Response = super::GenerateAccountingTransferResponse;
|
|
type Future = BoxFuture<
|
|
tonic::Response<Self::Response>,
|
|
tonic::Status,
|
|
>;
|
|
fn call(
|
|
&mut self,
|
|
request: tonic::Request<
|
|
super::GenerateAccountingTransferRequest,
|
|
>,
|
|
) -> Self::Future {
|
|
let inner = Arc::clone(&self.0);
|
|
let fut = async move {
|
|
<T as Accounting>::generate_accounting_transfer(
|
|
&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 = GenerateAccountingTransferSvc(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/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 {
|
|
let mut response = http::Response::new(
|
|
tonic::body::Body::default(),
|
|
);
|
|
let headers = response.headers_mut();
|
|
headers
|
|
.insert(
|
|
tonic::Status::GRPC_STATUS,
|
|
(tonic::Code::Unimplemented as i32).into(),
|
|
);
|
|
headers
|
|
.insert(
|
|
http::header::CONTENT_TYPE,
|
|
tonic::metadata::GRPC_CONTENT_TYPE,
|
|
);
|
|
Ok(response)
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
impl<T> Clone for AccountingServer<T> {
|
|
fn clone(&self) -> Self {
|
|
let inner = self.inner.clone();
|
|
Self {
|
|
inner,
|
|
accept_compression_encodings: self.accept_compression_encodings,
|
|
send_compression_encodings: self.send_compression_encodings,
|
|
max_decoding_message_size: self.max_decoding_message_size,
|
|
max_encoding_message_size: self.max_encoding_message_size,
|
|
}
|
|
}
|
|
}
|
|
/// Generated gRPC service name
|
|
pub const SERVICE_NAME: &str = "komp_ac.accounting.Accounting";
|
|
impl<T> tonic::server::NamedService for AccountingServer<T> {
|
|
const NAME: &'static str = SERVICE_NAME;
|
|
}
|
|
}
|