accounting name

This commit is contained in:
Priec
2026-07-21 10:11:46 +02:00
parent 6ab03aae94
commit a96d95f1b2
4 changed files with 179 additions and 5 deletions

View File

@@ -15,6 +15,10 @@ service Accounting {
// Return journal lines and credits-minus-debits informational balance.
rpc GetJournal(GetJournalRequest) returns (Journal);
// Search profile journals by user-facing name while retaining journal ids
// as the stable relationship keys.
rpc SearchJournals(SearchJournalsRequest) returns (SearchJournalsResponse);
// Return the profile-wide count of balanced and unbalanced journals.
rpc GetAccountingStatus(GetAccountingStatusRequest) returns (AccountingStatus);
@@ -26,10 +30,6 @@ service Accounting {
rpc SoftDeleteJournalLine(SoftDeleteJournalLineRequest) returns (Journal);
}
// Tables with an active posting script define journal_id as a permanent BIGINT
// column. PostTableDataRequest.data must include it; the value is stored on the
// source row and selects the journal receiving generated lines.
enum JournalSide {
JOURNAL_SIDE_UNSPECIFIED = 0;
JOURNAL_SIDE_DEBIT = 1;
@@ -53,6 +53,10 @@ message PostJournalRequest {
// At least one line is required. The lines are inserted atomically and the
// journal is allowed to remain unbalanced.
repeated JournalLineInput lines = 5;
// Required and unique within the profile when creating. Must be empty when
// appending to an existing journal selected by journal_id.
string journal_name = 6;
}
message JournalLineInput {
@@ -80,6 +84,38 @@ message GetAccountingStatusRequest {
string profile_name = 1;
}
message SearchJournalsRequest {
string profile_name = 1;
// Case-insensitive literal substring. Empty returns all profile journals.
string name_query = 2;
// Zero uses 50. The maximum is 500.
int32 page_size = 3;
// Opaque cursor returned by the previous response.
string page_token = 4;
}
message JournalSummary {
int64 journal_id = 1;
string journal_name = 2;
string currency = 3;
string description = 4;
string total_debit = 5;
string total_credit = 6;
string balance = 7;
int64 active_line_count = 8;
bool locked = 9;
string created_at = 10;
}
message SearchJournalsResponse {
repeated JournalSummary journals = 1;
int64 total_count = 2;
string next_page_token = 3;
}
message AccountingStatus {
bool all_journals_balanced = 1;
int64 journal_count = 2;
@@ -117,6 +153,7 @@ message UnbalancedJournalSummary {
string missing_amount = 8;
int64 active_line_count = 9;
string created_at = 10;
string journal_name = 11;
}
message ListUnbalancedJournalsResponse {
@@ -161,4 +198,5 @@ message Journal {
bool locked = 10;
string locked_at = 11;
string locked_by_user_id = 12;
string journal_name = 13;
}