typst file generating syntax

This commit is contained in:
Priec
2026-07-31 01:13:12 +02:00
parent 09a661c14e
commit c6b4e62698
4 changed files with 19 additions and 21 deletions

View File

@@ -99,20 +99,19 @@ message PostTableDefinitionRequest {
string accounting_currency = 8;
}
// Defines the input for explicitly creating a table backed by one invoice
// template. typst_source must contain exactly one declaration of the form:
// Defines the input for explicitly creating tables backed by one invoice
// template. typst_source must contain exactly one field declaration:
//
// #let komp_ac_fields = (
// "invoice.number": (source: "local", field_type: "TEXT", write: "user"),
// "items[].product": (source: "reference", table: "stock", required: true),
// "items[].quantity": (source: "local", field_type: "DECIMAL(12,3)", write: "user"),
// "items[].total": (source: "local", field_type: "MONEY", write: "script"),
// "sidlo.nazov",
// "people[].name",
// "people[].requested_quantity",
// )
//
// Root fields create columns and references on table_name. Every [] collection
// creates a child table with a required FK to its immediate parent; fields in
// that collection create columns and references on the child table. Multiple
// template paths in one scope may reuse the same reference.
// A path matching an existing profile table and column becomes a reference to
// that table. Otherwise its final segment becomes a local TEXT column for an
// administrator to refine later. Every [] creates a child table with a required
// FK to its immediate generated parent.
message CreateInvoiceTemplateTableRequest {
string profile_name = 1;
string table_name = 2;

Binary file not shown.

View File

@@ -58,20 +58,19 @@ pub struct PostTableDefinitionRequest {
#[prost(string, tag = "8")]
pub accounting_currency: ::prost::alloc::string::String,
}
/// Defines the input for explicitly creating a table backed by one invoice
/// template. typst_source must contain exactly one declaration of the form:
/// Defines the input for explicitly creating tables backed by one invoice
/// template. typst_source must contain exactly one field declaration:
///
/// \#let komp_ac_fields = (
/// "invoice.number": (source: "local", field_type: "TEXT", write: "user"),
/// "items\[\].product": (source: "reference", table: "stock", required: true),
/// "items\[\].quantity": (source: "local", field_type: "DECIMAL(12,3)", write: "user"),
/// "items\[\].total": (source: "local", field_type: "MONEY", write: "script"),
/// "sidlo.nazov",
/// "people\[\].name",
/// "people\[\].requested_quantity",
/// )
///
/// Root fields create columns and references on table_name. Every \[\] collection
/// creates a child table with a required FK to its immediate parent; fields in
/// that collection create columns and references on the child table. Multiple
/// template paths in one scope may reuse the same reference.
/// A path matching an existing profile table and column becomes a reference to
/// that table. Otherwise its final segment becomes a local TEXT column for an
/// administrator to refine later. Every \[\] creates a child table with a required
/// FK to its immediate generated parent.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateInvoiceTemplateTableRequest {