From 03b50e8f81f668f7609939152782ec176a1ae9c2 Mon Sep 17 00:00:00 2001 From: Priec Date: Mon, 14 Sep 2026 22:57:39 +0200 Subject: [PATCH] reports1 --- common/proto/accounting.proto | 175 +++++ common/src/proto/descriptor.bin | Bin 268409 -> 280776 bytes common/src/proto/komp_ac.accounting.rs | 998 +++++++++++++++++++++++++ 3 files changed, 1173 insertions(+) diff --git a/common/proto/accounting.proto b/common/proto/accounting.proto index bc476a65..f2ad13b2 100644 --- a/common/proto/accounting.proto +++ b/common/proto/accounting.proto @@ -585,3 +585,178 @@ message ListOpeningBalanceAccountsResponse { repeated UnmappedSourceDenominationBalance unmapped_source_denomination_balances = 3; } + +// Implemented by financial_reports_basic. Module approvals and user read +// permissions for both the journal and account catalogue are required. +service FinancialReports { + rpc PreviewFinancialReports(FinancialReportRequest) returns (FinancialReportBundle); + // Saves immutable source data and results; requires a closed, reconciled period. + rpc FinalizeFinancialReports(FinancialReportRequest) returns (SavedFinancialReport); + rpc GetFinancialReport(GetFinancialReportRequest) returns (SavedFinancialReport); + rpc ListFinancialReports(ListFinancialReportsRequest) returns (ListFinancialReportsResponse); +} + +enum ReportStatementClass { + REPORT_STATEMENT_CLASS_UNSPECIFIED = 0; + REPORT_STATEMENT_CLASS_ASSETS = 1; + REPORT_STATEMENT_CLASS_EQUITY_AND_LIABILITIES = 2; + REPORT_STATEMENT_CLASS_EXPENSES = 3; + REPORT_STATEMENT_CLASS_REVENUE = 4; +} + +enum ReportBalanceSide { + REPORT_BALANCE_SIDE_UNSPECIFIED = 0; + REPORT_BALANCE_SIDE_DEBIT = 1; + REPORT_BALANCE_SIDE_CREDIT = 2; + REPORT_BALANCE_SIDE_EITHER = 3; +} + +enum FinancialReportBasis { + FINANCIAL_REPORT_BASIS_UNSPECIFIED = 0; + FINANCIAL_REPORT_BASIS_POSTED = 1; + FINANCIAL_REPORT_BASIS_BEFORE_TECHNICAL_CLOSING = 2; +} + +message FinancialReportRequest { + string profile_name = 1; + int64 period_id = 2; + // Must be chosen explicitly. The server never guesses closing journals. + FinancialReportBasis basis = 3; + // Verified technical transfers removed from all three reports. + repeated TechnicalClosingJournal closing_journals = 4; + // Zero selects period_id alone; otherwise report consecutive periods through period_id. + int64 first_period_id = 5; +} + +enum TechnicalClosingKind { + TECHNICAL_CLOSING_KIND_UNSPECIFIED = 0; + TECHNICAL_CLOSING_KIND_INCOME_TRANSFER = 1; + TECHNICAL_CLOSING_KIND_BALANCE_TRANSFER = 2; +} + +message TechnicalClosingJournal { + int64 journal_id = 1; + TechnicalClosingKind kind = 2; + // Explicit account identity, never inferred from account numbers or descriptions. + string closing_account = 3; +} + +message FinancialReportSourceRow { + repeated string account_segments = 1; + string denomination_currency = 2; + ReportStatementClass statement_class = 3; + ReportBalanceSide balance_side = 4; + // Aggregate amounts include descendants, in the profile bookkeeping currency. + string opening_balance = 5; + string period_debit = 6; + string period_credit = 7; + string closing_balance = 8; + // Direct movements of the explicitly selected closing journals only. + string excluded_debit = 9; + string excluded_credit = 10; +} + +message FinancialReportSource { + AccountingPeriod period = 1; + string currency = 2; + string account_catalogue = 3; + int64 account_catalogue_id = 4; + FinancialReportBasis basis = 5; + repeated TechnicalClosingJournal closing_journals = 6; + repeated FinancialReportSourceRow rows = 7; + // Actual period generations; period above describes their combined range. + repeated AccountingPeriod periods = 8; +} + +message FinancialStatementRow { + string account = 1; + ReportStatementClass statement_class = 2; + // Direct account amount, excluding descendants. Contra balances stay signed. + string amount = 3; +} + +message BalanceSheet { + repeated FinancialStatementRow rows = 1; + string assets = 2; + string equity_and_liabilities = 3; + // Negative N/V balances on the selected report basis. + string untransferred_result = 4; + // Assets minus equity/liabilities minus untransferred result. + string difference = 5; +} + +message ProfitAndLoss { + repeated FinancialStatementRow rows = 1; + string expenses = 2; + string revenue = 3; + string result = 4; +} + +enum FinancialReportIssueKind { + FINANCIAL_REPORT_ISSUE_KIND_UNSPECIFIED = 0; + FINANCIAL_REPORT_ISSUE_KIND_UNEXPECTED_BALANCE_SIDE = 1; + FINANCIAL_REPORT_ISSUE_KIND_UNBALANCED_OPENING = 2; + FINANCIAL_REPORT_ISSUE_KIND_UNBALANCED_MOVEMENT = 3; + FINANCIAL_REPORT_ISSUE_KIND_UNBALANCED_CLOSING = 4; + FINANCIAL_REPORT_ISSUE_KIND_UNADJUSTED_OPEN_PERIOD = 5; +} + +message FinancialReportIssue { + FinancialReportIssueKind kind = 1; + string account = 2; + string message = 3; +} + +message FinancialReportBundle { + uint32 calculation_version = 1; + FinancialReportSource source = 2; + GetTrialBalanceResponse trial_balance = 3; + BalanceSheet balance_sheet = 4; + ProfitAndLoss profit_and_loss = 5; + repeated FinancialReportIssue issues = 6; +} + +enum FinancialReportPeriodState { + FINANCIAL_REPORT_PERIOD_STATE_UNSPECIFIED = 0; + FINANCIAL_REPORT_PERIOD_STATE_SAME_CLOSED_PERIOD = 1; + FINANCIAL_REPORT_PERIOD_STATE_REOPENED_OR_CHANGED = 2; + FINANCIAL_REPORT_PERIOD_STATE_REMOVED = 3; +} + +message SavedFinancialReport { + int64 id = 1; + string created_at = 2; + string created_by_user_id = 3; + FinancialReportBundle report = 4; + // Only describes the period generation. Saved classifications are immutable + // even when the current account catalogue is edited later. + FinancialReportPeriodState period_state = 5; +} + +message GetFinancialReportRequest { + string profile_name = 1; + int64 report_id = 2; +} + +message ListFinancialReportsRequest { + string profile_name = 1; + // Exclusive cursor; zero starts at the newest report. + int64 before_id = 2; + uint32 limit = 3; +} + +message FinancialReportSummary { + int64 id = 1; + int64 period_id = 2; + string period_start = 3; + string period_end = 4; + string created_at = 5; + string created_by_user_id = 6; + uint32 calculation_version = 7; +} + +message ListFinancialReportsResponse { + repeated FinancialReportSummary reports = 1; + // Pass as before_id for the next page; zero when no more rows remain. + int64 next_before_id = 2; +} diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index b711dd99b99286b0b21329172c4a19206a2d1e70..589dddf9d089f0614fda26af82ec323a1f83a944 100644 GIT binary patch delta 11408 zcmbVSdvIITnU}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4&-ULJO9J8tDn3(5gHE#FFpm^L{hc<-7Vh00^Rh+FCN`T^^Qg3{;4E@A7jj z#NJ>%crWF?k5v$Q!1^9n@1;EygyVXb0YNRGvKGt4*@qLdG!O!6S*q<1bzcB4L_gGhp@&R7srv$ugj$q3_DS6rK!vDxQa6Sk zI-ow%XATf#0kte$0zcBHB&d-6NS-+c+hPTO%khhvd=lIO&foG7{p7&d7E0YIHE$7u zZ-BBR0@D5W6t5LOGY}cFr+AaxxPVyY6m8t3PzB;AczB7#?44*QcG|@Yw)#^W@dF$6 z4*IhZdlY{Urb=8il|m7ZCG@Kr{yGumJ(A89RC%x7B1!^kWk~>vRYLMo2M7~B!2`~< Vrw`tE`k){G7>}Jk7`XbX{{=@&Oq~D# delta 63 zcmX>xQSj#mfeo{nm>;iW+B}a*L2I+Wl^oON2*>Z7JYI_qF>, } #[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FinancialReportRequest { + #[prost(string, tag = "1")] + pub profile_name: ::prost::alloc::string::String, + #[prost(int64, tag = "2")] + pub period_id: i64, + /// Must be chosen explicitly. The server never guesses closing journals. + #[prost(enumeration = "FinancialReportBasis", tag = "3")] + pub basis: i32, + /// Verified technical transfers removed from all three reports. + #[prost(message, repeated, tag = "4")] + pub closing_journals: ::prost::alloc::vec::Vec, + /// Zero selects period_id alone; otherwise report consecutive periods through period_id. + #[prost(int64, tag = "5")] + pub first_period_id: i64, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct TechnicalClosingJournal { + #[prost(int64, tag = "1")] + pub journal_id: i64, + #[prost(enumeration = "TechnicalClosingKind", tag = "2")] + pub kind: i32, + /// Explicit account identity, never inferred from account numbers or descriptions. + #[prost(string, tag = "3")] + pub closing_account: ::prost::alloc::string::String, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct FinancialReportSourceRow { + #[prost(string, repeated, tag = "1")] + pub account_segments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag = "2")] + pub denomination_currency: ::prost::alloc::string::String, + #[prost(enumeration = "ReportStatementClass", tag = "3")] + pub statement_class: i32, + #[prost(enumeration = "ReportBalanceSide", tag = "4")] + pub balance_side: i32, + /// Aggregate amounts include descendants, in the profile bookkeeping currency. + #[prost(string, tag = "5")] + pub opening_balance: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub period_debit: ::prost::alloc::string::String, + #[prost(string, tag = "7")] + pub period_credit: ::prost::alloc::string::String, + #[prost(string, tag = "8")] + pub closing_balance: ::prost::alloc::string::String, + /// Direct movements of the explicitly selected closing journals only. + #[prost(string, tag = "9")] + pub excluded_debit: ::prost::alloc::string::String, + #[prost(string, tag = "10")] + pub excluded_credit: ::prost::alloc::string::String, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FinancialReportSource { + #[prost(message, optional, tag = "1")] + pub period: ::core::option::Option, + #[prost(string, tag = "2")] + pub currency: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub account_catalogue: ::prost::alloc::string::String, + #[prost(int64, tag = "4")] + pub account_catalogue_id: i64, + #[prost(enumeration = "FinancialReportBasis", tag = "5")] + pub basis: i32, + #[prost(message, repeated, tag = "6")] + pub closing_journals: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "7")] + pub rows: ::prost::alloc::vec::Vec, + /// Actual period generations; period above describes their combined range. + #[prost(message, repeated, tag = "8")] + pub periods: ::prost::alloc::vec::Vec, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct FinancialStatementRow { + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, + #[prost(enumeration = "ReportStatementClass", tag = "2")] + pub statement_class: i32, + /// Direct account amount, excluding descendants. Contra balances stay signed. + #[prost(string, tag = "3")] + pub amount: ::prost::alloc::string::String, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BalanceSheet { + #[prost(message, repeated, tag = "1")] + pub rows: ::prost::alloc::vec::Vec, + #[prost(string, tag = "2")] + pub assets: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub equity_and_liabilities: ::prost::alloc::string::String, + /// Negative N/V balances on the selected report basis. + #[prost(string, tag = "4")] + pub untransferred_result: ::prost::alloc::string::String, + /// Assets minus equity/liabilities minus untransferred result. + #[prost(string, tag = "5")] + pub difference: ::prost::alloc::string::String, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ProfitAndLoss { + #[prost(message, repeated, tag = "1")] + pub rows: ::prost::alloc::vec::Vec, + #[prost(string, tag = "2")] + pub expenses: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub revenue: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub result: ::prost::alloc::string::String, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct FinancialReportIssue { + #[prost(enumeration = "FinancialReportIssueKind", tag = "1")] + pub kind: i32, + #[prost(string, tag = "2")] + pub account: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub message: ::prost::alloc::string::String, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FinancialReportBundle { + #[prost(uint32, tag = "1")] + pub calculation_version: u32, + #[prost(message, optional, tag = "2")] + pub source: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub trial_balance: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub balance_sheet: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub profit_and_loss: ::core::option::Option, + #[prost(message, repeated, tag = "6")] + pub issues: ::prost::alloc::vec::Vec, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SavedFinancialReport { + #[prost(int64, tag = "1")] + pub id: i64, + #[prost(string, tag = "2")] + pub created_at: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub created_by_user_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub report: ::core::option::Option, + /// Only describes the period generation. Saved classifications are immutable + /// even when the current account catalogue is edited later. + #[prost(enumeration = "FinancialReportPeriodState", tag = "5")] + pub period_state: i32, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetFinancialReportRequest { + #[prost(string, tag = "1")] + pub profile_name: ::prost::alloc::string::String, + #[prost(int64, tag = "2")] + pub report_id: i64, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ListFinancialReportsRequest { + #[prost(string, tag = "1")] + pub profile_name: ::prost::alloc::string::String, + /// Exclusive cursor; zero starts at the newest report. + #[prost(int64, tag = "2")] + pub before_id: i64, + #[prost(uint32, tag = "3")] + pub limit: u32, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct FinancialReportSummary { + #[prost(int64, tag = "1")] + pub id: i64, + #[prost(int64, tag = "2")] + pub period_id: i64, + #[prost(string, tag = "3")] + pub period_start: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub period_end: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub created_at: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub created_by_user_id: ::prost::alloc::string::String, + #[prost(uint32, tag = "7")] + pub calculation_version: u32, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListFinancialReportsResponse { + #[prost(message, repeated, tag = "1")] + pub reports: ::prost::alloc::vec::Vec, + /// Pass as before_id for the next page; zero when no more rows remain. + #[prost(int64, tag = "2")] + pub next_before_id: i64, +} +#[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum JournalSide { @@ -858,6 +1060,233 @@ impl OpeningBalanceStatus { } } } +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ReportStatementClass { + Unspecified = 0, + Assets = 1, + EquityAndLiabilities = 2, + Expenses = 3, + Revenue = 4, +} +impl ReportStatementClass { + /// 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 => "REPORT_STATEMENT_CLASS_UNSPECIFIED", + Self::Assets => "REPORT_STATEMENT_CLASS_ASSETS", + Self::EquityAndLiabilities => "REPORT_STATEMENT_CLASS_EQUITY_AND_LIABILITIES", + Self::Expenses => "REPORT_STATEMENT_CLASS_EXPENSES", + Self::Revenue => "REPORT_STATEMENT_CLASS_REVENUE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "REPORT_STATEMENT_CLASS_UNSPECIFIED" => Some(Self::Unspecified), + "REPORT_STATEMENT_CLASS_ASSETS" => Some(Self::Assets), + "REPORT_STATEMENT_CLASS_EQUITY_AND_LIABILITIES" => { + Some(Self::EquityAndLiabilities) + } + "REPORT_STATEMENT_CLASS_EXPENSES" => Some(Self::Expenses), + "REPORT_STATEMENT_CLASS_REVENUE" => Some(Self::Revenue), + _ => None, + } + } +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ReportBalanceSide { + Unspecified = 0, + Debit = 1, + Credit = 2, + Either = 3, +} +impl ReportBalanceSide { + /// 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 => "REPORT_BALANCE_SIDE_UNSPECIFIED", + Self::Debit => "REPORT_BALANCE_SIDE_DEBIT", + Self::Credit => "REPORT_BALANCE_SIDE_CREDIT", + Self::Either => "REPORT_BALANCE_SIDE_EITHER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "REPORT_BALANCE_SIDE_UNSPECIFIED" => Some(Self::Unspecified), + "REPORT_BALANCE_SIDE_DEBIT" => Some(Self::Debit), + "REPORT_BALANCE_SIDE_CREDIT" => Some(Self::Credit), + "REPORT_BALANCE_SIDE_EITHER" => Some(Self::Either), + _ => None, + } + } +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum FinancialReportBasis { + Unspecified = 0, + Posted = 1, + BeforeTechnicalClosing = 2, +} +impl FinancialReportBasis { + /// 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 => "FINANCIAL_REPORT_BASIS_UNSPECIFIED", + Self::Posted => "FINANCIAL_REPORT_BASIS_POSTED", + Self::BeforeTechnicalClosing => { + "FINANCIAL_REPORT_BASIS_BEFORE_TECHNICAL_CLOSING" + } + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "FINANCIAL_REPORT_BASIS_UNSPECIFIED" => Some(Self::Unspecified), + "FINANCIAL_REPORT_BASIS_POSTED" => Some(Self::Posted), + "FINANCIAL_REPORT_BASIS_BEFORE_TECHNICAL_CLOSING" => { + Some(Self::BeforeTechnicalClosing) + } + _ => None, + } + } +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum TechnicalClosingKind { + Unspecified = 0, + IncomeTransfer = 1, + BalanceTransfer = 2, +} +impl TechnicalClosingKind { + /// 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 => "TECHNICAL_CLOSING_KIND_UNSPECIFIED", + Self::IncomeTransfer => "TECHNICAL_CLOSING_KIND_INCOME_TRANSFER", + Self::BalanceTransfer => "TECHNICAL_CLOSING_KIND_BALANCE_TRANSFER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "TECHNICAL_CLOSING_KIND_UNSPECIFIED" => Some(Self::Unspecified), + "TECHNICAL_CLOSING_KIND_INCOME_TRANSFER" => Some(Self::IncomeTransfer), + "TECHNICAL_CLOSING_KIND_BALANCE_TRANSFER" => Some(Self::BalanceTransfer), + _ => None, + } + } +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum FinancialReportIssueKind { + Unspecified = 0, + UnexpectedBalanceSide = 1, + UnbalancedOpening = 2, + UnbalancedMovement = 3, + UnbalancedClosing = 4, + UnadjustedOpenPeriod = 5, +} +impl FinancialReportIssueKind { + /// 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 => "FINANCIAL_REPORT_ISSUE_KIND_UNSPECIFIED", + Self::UnexpectedBalanceSide => { + "FINANCIAL_REPORT_ISSUE_KIND_UNEXPECTED_BALANCE_SIDE" + } + Self::UnbalancedOpening => "FINANCIAL_REPORT_ISSUE_KIND_UNBALANCED_OPENING", + Self::UnbalancedMovement => "FINANCIAL_REPORT_ISSUE_KIND_UNBALANCED_MOVEMENT", + Self::UnbalancedClosing => "FINANCIAL_REPORT_ISSUE_KIND_UNBALANCED_CLOSING", + Self::UnadjustedOpenPeriod => { + "FINANCIAL_REPORT_ISSUE_KIND_UNADJUSTED_OPEN_PERIOD" + } + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "FINANCIAL_REPORT_ISSUE_KIND_UNSPECIFIED" => Some(Self::Unspecified), + "FINANCIAL_REPORT_ISSUE_KIND_UNEXPECTED_BALANCE_SIDE" => { + Some(Self::UnexpectedBalanceSide) + } + "FINANCIAL_REPORT_ISSUE_KIND_UNBALANCED_OPENING" => { + Some(Self::UnbalancedOpening) + } + "FINANCIAL_REPORT_ISSUE_KIND_UNBALANCED_MOVEMENT" => { + Some(Self::UnbalancedMovement) + } + "FINANCIAL_REPORT_ISSUE_KIND_UNBALANCED_CLOSING" => { + Some(Self::UnbalancedClosing) + } + "FINANCIAL_REPORT_ISSUE_KIND_UNADJUSTED_OPEN_PERIOD" => { + Some(Self::UnadjustedOpenPeriod) + } + _ => None, + } + } +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum FinancialReportPeriodState { + Unspecified = 0, + SameClosedPeriod = 1, + ReopenedOrChanged = 2, + Removed = 3, +} +impl FinancialReportPeriodState { + /// 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 => "FINANCIAL_REPORT_PERIOD_STATE_UNSPECIFIED", + Self::SameClosedPeriod => "FINANCIAL_REPORT_PERIOD_STATE_SAME_CLOSED_PERIOD", + Self::ReopenedOrChanged => { + "FINANCIAL_REPORT_PERIOD_STATE_REOPENED_OR_CHANGED" + } + Self::Removed => "FINANCIAL_REPORT_PERIOD_STATE_REMOVED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "FINANCIAL_REPORT_PERIOD_STATE_UNSPECIFIED" => Some(Self::Unspecified), + "FINANCIAL_REPORT_PERIOD_STATE_SAME_CLOSED_PERIOD" => { + Some(Self::SameClosedPeriod) + } + "FINANCIAL_REPORT_PERIOD_STATE_REOPENED_OR_CHANGED" => { + Some(Self::ReopenedOrChanged) + } + "FINANCIAL_REPORT_PERIOD_STATE_REMOVED" => Some(Self::Removed), + _ => None, + } + } +} /// Generated client implementations. pub mod accounting_client { #![allow( @@ -2976,3 +3405,572 @@ pub mod accounting_server { const NAME: &'static str = SERVICE_NAME; } } +/// Generated client implementations. +pub mod financial_reports_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Implemented by financial_reports_basic. Module approvals and user read + /// permissions for both the journal and account catalogue are required. + #[derive(Debug, Clone)] + pub struct FinancialReportsClient { + inner: tonic::client::Grpc, + } + impl FinancialReportsClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl FinancialReportsClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + 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( + inner: T, + interceptor: F, + ) -> FinancialReportsClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + std::marker::Send + std::marker::Sync, + { + FinancialReportsClient::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 + } + pub async fn preview_financial_reports( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/komp_ac.accounting.FinancialReports/PreviewFinancialReports", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.accounting.FinancialReports", + "PreviewFinancialReports", + ), + ); + self.inner.unary(req, path, codec).await + } + /// Saves immutable source data and results; requires a closed, reconciled period. + pub async fn finalize_financial_reports( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/komp_ac.accounting.FinancialReports/FinalizeFinancialReports", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.accounting.FinancialReports", + "FinalizeFinancialReports", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_financial_report( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/komp_ac.accounting.FinancialReports/GetFinancialReport", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.accounting.FinancialReports", + "GetFinancialReport", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn list_financial_reports( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/komp_ac.accounting.FinancialReports/ListFinancialReports", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.accounting.FinancialReports", + "ListFinancialReports", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod financial_reports_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 FinancialReportsServer. + #[async_trait] + pub trait FinancialReports: std::marker::Send + std::marker::Sync + 'static { + async fn preview_financial_reports( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Saves immutable source data and results; requires a closed, reconciled period. + async fn finalize_financial_reports( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_financial_report( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn list_financial_reports( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Implemented by financial_reports_basic. Module approvals and user read + /// permissions for both the journal and account catalogue are required. + #[derive(Debug)] + pub struct FinancialReportsServer { + inner: Arc, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + impl FinancialReportsServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> 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( + inner: T, + interceptor: F, + ) -> InterceptedService + 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 tonic::codegen::Service> for FinancialReportsServer + where + T: FinancialReports, + B: Body + std::marker::Send + 'static, + B::Error: Into + std::marker::Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + match req.uri().path() { + "/komp_ac.accounting.FinancialReports/PreviewFinancialReports" => { + #[allow(non_camel_case_types)] + struct PreviewFinancialReportsSvc(pub Arc); + impl< + T: FinancialReports, + > tonic::server::UnaryService + for PreviewFinancialReportsSvc { + type Response = super::FinancialReportBundle; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::preview_financial_reports( + &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 = PreviewFinancialReportsSvc(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.FinancialReports/FinalizeFinancialReports" => { + #[allow(non_camel_case_types)] + struct FinalizeFinancialReportsSvc(pub Arc); + impl< + T: FinancialReports, + > tonic::server::UnaryService + for FinalizeFinancialReportsSvc { + type Response = super::SavedFinancialReport; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::finalize_financial_reports( + &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 = FinalizeFinancialReportsSvc(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.FinancialReports/GetFinancialReport" => { + #[allow(non_camel_case_types)] + struct GetFinancialReportSvc(pub Arc); + impl< + T: FinancialReports, + > tonic::server::UnaryService + for GetFinancialReportSvc { + type Response = super::SavedFinancialReport; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_financial_report( + &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 = GetFinancialReportSvc(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.FinancialReports/ListFinancialReports" => { + #[allow(non_camel_case_types)] + struct ListFinancialReportsSvc(pub Arc); + impl< + T: FinancialReports, + > tonic::server::UnaryService + for ListFinancialReportsSvc { + type Response = super::ListFinancialReportsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::list_financial_reports( + &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 = ListFinancialReportsSvc(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 Clone for FinancialReportsServer { + 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.FinancialReports"; + impl tonic::server::NamedService for FinancialReportsServer { + const NAME: &'static str = SERVICE_NAME; + } +}