aliasing for accounting, where accounting real column names are the same as others, which is 0..n as opposed to previously real names and hardcoded search via those. Now we are using a look up table for the numbers mapping to look em up

This commit is contained in:
Priec
2026-08-13 13:41:07 +02:00
parent 774c9a3ce0
commit 27d3e9af34
11 changed files with 444 additions and 10 deletions

View File

@@ -94,6 +94,32 @@ message PostTableDefinitionRequest {
// visible from every profile. profile_name and accounting_currency are ignored.
bool global = 9;
// Names for the columns a definition row generates, in place of the ones the
// backend would give them. See GeneratedColumnAlias.
repeated GeneratedColumnAlias generated_aliases = 10;
}
// Renames one column a definition row generates, at the moment it is created.
//
// A generated column cannot be named in the column list -- the definition row
// is required to be named after its own type, and what it expands into is the
// backend's to decide. The name is only ever a display name over a physical
// column, though, so it is free to be anything: this is where that choice is
// made, instead of a RenameColumnAlias call afterwards.
//
// The ACCOUNTING_TRANSFER connectors are the exception. They are refused here
// exactly as RenameColumnAlias refuses them.
message GeneratedColumnAlias {
// The name the backend would otherwise give the column: one of ACCOUNTING's
// "name", "tax_point_date", "debit", "credit" or "account", or a companion
// such as "work_phone_extension". Must name a column the request really
// generates -- an alias for anything else is rejected rather than ignored,
// so a typo cannot pass silently.
string generated_name = 1;
// What the column should be called instead. Same rules as any column name.
string alias = 2;
}
// Defines the input for explicitly creating tables backed by one invoice
@@ -147,6 +173,10 @@ message AddTableColumnsRequest {
// Optional indexes for the new columns only.
repeated string indexes = 4;
// Names for the columns the appended definition rows generate, exactly as on
// PostTableDefinitionRequest.
repeated GeneratedColumnAlias generated_aliases = 5;
}
enum MoneyRounding {