diff --git a/client-gui2 b/client-gui2 index a71fe2f5..5442370d 160000 --- a/client-gui2 +++ b/client-gui2 @@ -1 +1 @@ -Subproject commit a71fe2f543433ec4a58e02006211b3d114089d6b +Subproject commit 5442370d145fcac5210bc11b77e17f4e644cfe4d diff --git a/common/proto/document_data.proto b/common/proto/document_data.proto index d841fbac..5f6ee18b 100644 --- a/common/proto/document_data.proto +++ b/common/proto/document_data.proto @@ -129,6 +129,16 @@ message TypstTemplateVersion { string created_at = 8; string input_table_name = 9; repeated string field_paths = 10; + repeated TypstTemplateFieldBinding field_bindings = 11; +} + +// One profile-specific source mapping for an enabled template version. +message TypstTemplateFieldBinding { + string field_path = 1; + string collection_path = 2; + string column_name = 3; + string source_table_name = 4; + string source_column_name = 5; } message GetTypstTemplateVersionResponse { diff --git a/common/proto/table_definition.proto b/common/proto/table_definition.proto index deaa4bf7..7ce10b52 100644 --- a/common/proto/table_definition.proto +++ b/common/proto/table_definition.proto @@ -216,6 +216,11 @@ message InvoiceTemplateFieldBinding { string collection_path = 2; string column_name = 3; InvoiceTemplateAccountingRole accounting_role = 4; + + // Optional source reached through column_name when that column is a LINK. + // Both names are empty for a value stored directly on the invoice table. + string source_table_name = 5; + string source_column_name = 6; } // One physical dynamic table created for an invoice template scope. The root diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 4c934c98..124ca415 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.document_data.rs b/common/src/proto/komp_ac.document_data.rs index e922f808..100ddfce 100644 --- a/common/src/proto/komp_ac.document_data.rs +++ b/common/src/proto/komp_ac.document_data.rs @@ -36,7 +36,7 @@ pub struct RegisterTypstTemplateRequest { pub typst_compiler_version: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RegisterTypstTemplateResponse { #[prost(message, optional, tag = "1")] pub template_version: ::core::option::Option, @@ -174,7 +174,7 @@ pub struct GetTypstTemplateVersionRequest { pub document_id: i64, } #[derive(serde::Serialize, serde::Deserialize)] -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct TypstTemplateVersion { #[prost(int64, tag = "1")] pub id: i64, @@ -196,9 +196,26 @@ pub struct TypstTemplateVersion { pub input_table_name: ::prost::alloc::string::String, #[prost(string, repeated, tag = "10")] pub field_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "11")] + pub field_bindings: ::prost::alloc::vec::Vec, } +/// One profile-specific source mapping for an enabled template version. #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct TypstTemplateFieldBinding { + #[prost(string, tag = "1")] + pub field_path: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub collection_path: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub column_name: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub source_table_name: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub source_column_name: ::prost::alloc::string::String, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTypstTemplateVersionResponse { #[prost(message, optional, tag = "1")] pub template_version: ::core::option::Option, diff --git a/common/src/proto/komp_ac.table_definition.rs b/common/src/proto/komp_ac.table_definition.rs index 3f61f075..58adeb9c 100644 --- a/common/src/proto/komp_ac.table_definition.rs +++ b/common/src/proto/komp_ac.table_definition.rs @@ -157,6 +157,12 @@ pub struct InvoiceTemplateFieldBinding { pub column_name: ::prost::alloc::string::String, #[prost(enumeration = "InvoiceTemplateAccountingRole", tag = "4")] pub accounting_role: i32, + /// Optional source reached through column_name when that column is a LINK. + /// Both names are empty for a value stored directly on the invoice table. + #[prost(string, tag = "5")] + pub source_table_name: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub source_column_name: ::prost::alloc::string::String, } /// One physical dynamic table created for an invoice template scope. The root /// has an empty collection_path and parent_table_name. Each \[\] scope names its diff --git a/server b/server index c37f2f90..b9e560b1 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit c37f2f902c77651c55891374d40ea7be6f8a69cb +Subproject commit b9e560b185df7b73a2f66ef82521cbfd132d532c