diff --git a/common/proto/accounting.proto b/common/proto/accounting.proto index c6af402a..be33939a 100644 --- a/common/proto/accounting.proto +++ b/common/proto/accounting.proto @@ -433,6 +433,25 @@ message OpeningBalanceAccountMapping { string created_by_user_id = 14; } +// A predecessor account still holding value that no mapping carries into the +// target period. Closing the target period drops these balances silently, so +// each one is either an account left to map or one deliberately closed out. +message UnmappedSourceAccount { + int64 source_period_id = 1; + string source_profile_name = 2; + repeated string source_account_segments = 3; + string currency = 4; + // Signed balance uses the debit-positive convention, and is never zero. + string closing_balance = 5; + OpeningBalanceStatus status = 6; +} + message ListOpeningBalanceAccountsResponse { repeated OpeningBalanceAccountMapping mappings = 1; + + // 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. + repeated UnmappedSourceAccount unmapped_source_accounts = 2; } diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index d894e81f..e9e23e75 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.accounting.rs b/common/src/proto/komp_ac.accounting.rs index d722ecac..65a336ea 100644 --- a/common/src/proto/komp_ac.accounting.rs +++ b/common/src/proto/komp_ac.accounting.rs @@ -476,10 +476,37 @@ pub struct OpeningBalanceAccountMapping { #[prost(string, tag = "14")] pub created_by_user_id: ::prost::alloc::string::String, } +/// A predecessor account still holding value that no mapping carries into the +/// target period. Closing the target period drops these balances silently, so +/// each one is either an account left to map or one deliberately closed out. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct UnmappedSourceAccount { + #[prost(int64, tag = "1")] + pub source_period_id: i64, + #[prost(string, tag = "2")] + pub source_profile_name: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "3")] + pub source_account_segments: ::prost::alloc::vec::Vec< + ::prost::alloc::string::String, + >, + #[prost(string, tag = "4")] + pub currency: ::prost::alloc::string::String, + /// Signed balance uses the debit-positive convention, and is never zero. + #[prost(string, tag = "5")] + pub closing_balance: ::prost::alloc::string::String, + #[prost(enumeration = "OpeningBalanceStatus", tag = "6")] + pub status: i32, +} #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListOpeningBalanceAccountsResponse { #[prost(message, repeated, tag = "1")] pub mappings: ::prost::alloc::vec::Vec, + /// 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_accounts: ::prost::alloc::vec::Vec, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] diff --git a/server b/server index 82402387..45e95554 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 8240238732b5487ca9d5ccaad32e3789805a7638 +Subproject commit 45e95554c9a9ba82d6b421bf5599e2a74f966a3e