journal id is now part of the db

This commit is contained in:
Priec
2026-07-21 08:37:36 +02:00
parent 5cec91b0f7
commit 6ab03aae94
7 changed files with 23 additions and 4 deletions

2
client

Submodule client updated: 88902a4b5d...baa60556d0

View File

@@ -121,6 +121,11 @@ message PostTableDataRequest {
// - Some application-specific validations may apply (e.g., max length for // - Some application-specific validations may apply (e.g., max length for
// certain fields like "telefon") // certain fields like "telefon")
map<string, google.protobuf.Value> data = 3; map<string, google.protobuf.Value> data = 3;
// Optional. Existing journal that receives the posting generated for this row.
// Required when the table has an active after-insert posting script and rejected
// when the table has no active posting script.
optional int64 journal_id = 4;
} }
// Insert response. // Insert response.
@@ -145,6 +150,9 @@ message PostTableDataResponse {
message PostTableDataBulkRow { message PostTableDataBulkRow {
// Required. Same data payload as PostTableDataRequest.data. // Required. Same data payload as PostTableDataRequest.data.
map<string, google.protobuf.Value> data = 1; map<string, google.protobuf.Value> data = 1;
// Optional. Existing journal that receives the posting generated for this row.
optional int64 journal_id = 2;
} }
// Bulk insert request. // Bulk insert request.

Binary file not shown.

View File

@@ -45,6 +45,11 @@ pub struct PostTableDataRequest {
::prost::alloc::string::String, ::prost::alloc::string::String,
::prost_types::Value, ::prost_types::Value,
>, >,
/// Optional. Existing journal that receives the posting generated for this row.
/// Required when the table has an active after-insert posting script and rejected
/// when the table has no active posting script.
#[prost(int64, optional, tag = "4")]
pub journal_id: ::core::option::Option<i64>,
} }
/// Insert response. /// Insert response.
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
@@ -74,6 +79,9 @@ pub struct PostTableDataBulkRow {
::prost::alloc::string::String, ::prost::alloc::string::String,
::prost_types::Value, ::prost_types::Value,
>, >,
/// Optional. Existing journal that receives the posting generated for this row.
#[prost(int64, optional, tag = "2")]
pub journal_id: ::core::option::Option<i64>,
} }
/// Bulk insert request. /// Bulk insert request.
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]

View File

@@ -182,7 +182,10 @@ fn row_for_table(table: &ImportTable, positions: &[(usize, String)], row: &[Stri
let value = csv_value(row.get(*index).map(String::as_str).unwrap_or_default(), data_type)?; let value = csv_value(row.get(*index).map(String::as_str).unwrap_or_default(), data_type)?;
data.insert(column.clone(), value); data.insert(column.clone(), value);
} }
Ok(PostTableDataBulkRow { data }) Ok(PostTableDataBulkRow {
data,
journal_id: None,
})
} }
fn render_loaded(result: Result<super::state::ImportPageState, LoadError>) -> Response { fn render_loaded(result: Result<super::state::ImportPageState, LoadError>) -> Response {

2
server

Submodule server updated: 255f334bf4...8a6be133f1