diff --git a/client b/client index 9f68031..7a63161 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit 9f68031ff4259e4a616a2103c42b37a240f2c6fd +Subproject commit 7a63161ad87165f68913b1e80727a2ca8840c266 diff --git a/common/proto/table_definition.proto b/common/proto/table_definition.proto index 9f29788..5147ed5 100644 --- a/common/proto/table_definition.proto +++ b/common/proto/table_definition.proto @@ -178,9 +178,8 @@ message ColumnDefinition { // PHONE (international or national phone number; generates extension/type/country/calling-code companions) // TIME (timezone-free time of day) // MONEY (= unconstrained NUMERIC; currency comes from the table) - // ACCOUNTING (creates schema-managed name, debit, and credit columns; - // automatically creates a required accounts_id link and posts - // the referenced canonical account row's account value; + // ACCOUNTING (creates schema-managed name, account, debit, and credit fields; + // account always selects a row from the profile's managed accounts table; // name is limited to 10 characters and one stored row contributes // one line to the profile journal) // INT diff --git a/common/proto/table_structure.proto b/common/proto/table_structure.proto index 8def2fc..db60a16 100644 --- a/common/proto/table_structure.proto +++ b/common/proto/table_structure.proto @@ -46,7 +46,8 @@ message GetTableStructureResponse { message TableStructureResponse { // Columns of the physical table, including system columns (id, deleted, // created_at, row_revision), user-defined columns, and any foreign-key columns such as - // "_id". May be empty if the physical table is missing. + // "_id", plus the dedicated "account_id" column on + // ACCOUNTING-enabled tables. May be empty if the physical table is missing. repeated TableColumn columns = 1; } diff --git a/common/proto/tables_data.proto b/common/proto/tables_data.proto index 056b1e6..71d7cc2 100644 --- a/common/proto/tables_data.proto +++ b/common/proto/tables_data.proto @@ -62,7 +62,8 @@ service TablesData { // - Validates profile and table definition // - Returns all columns as strings (COALESCE(col::TEXT, '') AS col) // including: id, deleted, row_revision, all user-defined columns, and FK columns - // named "_id" for each table link + // named "_id" for each table link, plus "account_id" on + // ACCOUNTING-enabled tables // - Fails with NOT_FOUND if record does not exist or is soft-deleted // - If the physical table is missing but the definition exists, returns INTERNAL rpc GetTableData(GetTableDataRequest) returns (GetTableDataResponse); @@ -101,6 +102,7 @@ message PostTableDataRequest { // - System/FK columns: // • "deleted" (BOOLEAN), optional; default FALSE if not provided // • "_id" (BIGINT) for each table link + // • "account_id" (BIGINT) on ACCOUNTING-enabled tables // // Type expectations by SQL type: // - TEXT: string value; empty string is treated as NULL @@ -266,6 +268,7 @@ message GetTableDataResponse { // - id, deleted // - all user-defined columns from the table definition // - FK columns named "_id" for each table link + // - account_id for ACCOUNTING-enabled tables // // All values are returned as TEXT via col::TEXT and COALESCEed to empty string // (NULL becomes ""). The row is returned only if deleted = FALSE. diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 2530afc..dbfcbb0 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.table_definition.rs b/common/src/proto/komp_ac.table_definition.rs index 7b376a7..c51a65e 100644 --- a/common/src/proto/komp_ac.table_definition.rs +++ b/common/src/proto/komp_ac.table_definition.rs @@ -149,9 +149,8 @@ pub struct ColumnDefinition { /// PHONE (international or national phone number; generates extension/type/country/calling-code companions) /// TIME (timezone-free time of day) /// MONEY (= unconstrained NUMERIC; currency comes from the table) - /// ACCOUNTING (creates schema-managed name, debit, and credit columns; - /// automatically creates a required accounts_id link and posts - /// the referenced canonical account row's account value; + /// ACCOUNTING (creates schema-managed name, account, debit, and credit fields; + /// account always selects a row from the profile's managed accounts table; /// name is limited to 10 characters and one stored row contributes /// one line to the profile journal) /// INT diff --git a/common/src/proto/komp_ac.table_structure.rs b/common/src/proto/komp_ac.table_structure.rs index 17af7c3..eb89f06 100644 --- a/common/src/proto/komp_ac.table_structure.rs +++ b/common/src/proto/komp_ac.table_structure.rs @@ -26,7 +26,8 @@ pub struct GetTableStructureResponse { pub struct TableStructureResponse { /// Columns of the physical table, including system columns (id, deleted, /// created_at, row_revision), user-defined columns, and any foreign-key columns such as - /// "\\_id". May be empty if the physical table is missing. + /// "\\_id", plus the dedicated "account_id" column on + /// ACCOUNTING-enabled tables. May be empty if the physical table is missing. #[prost(message, repeated, tag = "1")] pub columns: ::prost::alloc::vec::Vec, } diff --git a/common/src/proto/komp_ac.tables_data.rs b/common/src/proto/komp_ac.tables_data.rs index fa82b8d..5c26ab1 100644 --- a/common/src/proto/komp_ac.tables_data.rs +++ b/common/src/proto/komp_ac.tables_data.rs @@ -18,6 +18,7 @@ pub struct PostTableDataRequest { /// * System/FK columns: /// • "deleted" (BOOLEAN), optional; default FALSE if not provided /// • "\\_id" (BIGINT) for each table link + /// • "account_id" (BIGINT) on ACCOUNTING-enabled tables /// /// Type expectations by SQL type: /// @@ -208,6 +209,7 @@ pub struct GetTableDataResponse { /// * id, deleted /// * all user-defined columns from the table definition /// * FK columns named "\\_id" for each table link + /// * account_id for ACCOUNTING-enabled tables /// /// All values are returned as TEXT via col::TEXT and COALESCEed to empty string /// (NULL becomes ""). The row is returned only if deleted = FALSE. @@ -498,7 +500,8 @@ pub mod tables_data_client { /// * Validates profile and table definition /// * Returns all columns as strings (COALESCE(col::TEXT, '') AS col) /// including: id, deleted, row_revision, all user-defined columns, and FK columns - /// named "\\_id" for each table link + /// named "\\_id" for each table link, plus "account_id" on + /// ACCOUNTING-enabled tables /// * Fails with NOT_FOUND if record does not exist or is soft-deleted /// * If the physical table is missing but the definition exists, returns INTERNAL pub async fn get_table_data( @@ -690,7 +693,8 @@ pub mod tables_data_server { /// * Validates profile and table definition /// * Returns all columns as strings (COALESCE(col::TEXT, '') AS col) /// including: id, deleted, row_revision, all user-defined columns, and FK columns - /// named "\\_id" for each table link + /// named "\\_id" for each table link, plus "account_id" on + /// ACCOUNTING-enabled tables /// * Fails with NOT_FOUND if record does not exist or is soft-deleted /// * If the physical table is missing but the definition exists, returns INTERNAL async fn get_table_data( diff --git a/server b/server index 8dd5dcb..df7f5aa 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 8dd5dcbdcb306e2371e6aee1c39edd2bb9f8213f +Subproject commit df7f5aaf95bd44633998d635c758aef698230c50