Document Template
What It Models
Templates supply the content used to render Accounting documents and software downloads. They combine prepared wording with merge values, and include message or output parts where the kind requires them. Selection belongs to the requesting producer, unit or workspace settings; Books supplies the shared resolver.
Identity and Attributes
Customer templates are workspace records. The nine protected built-ins are code-based defaults that can be read, previewed and copied. A copy becomes a separate active customer template.
Kind remains fixed. Liquid sources use a kind-specific catalogue, statements add recipient choices, and downloads add output and filename settings. The returned usage list helps staff identify current configuration dependencies.
Relationships
Unit document choices and the statement default reference content without owning it. Those references protect the content from removal or deactivation. Invoice rendering uses the shared resolver; the examined statement action handles its own choice, so uniform producer adoption is not established.
Invariants
Saved sources receive syntax and vocabulary validation, while database checks enforce kind-specific parts. Built-ins remain protected. Explicit resolution fails when the requested template is absent, wrong-kind or inactive; an unusable configured fallback is skipped in favor of built-in resolution.
How It Is Stored and Shared
Books maintains customer content, built-ins, variables, filters and preview behavior. Preview uses sample data and does not save or send a document. Producing modules load content and render it within their own workflows. Maintenance includes customer templates in workspace export and erasure.
Template rows carry no custom-field capability. Workspace foreign keys and row policies prevent cross-customer configuration references.
Open Design Questions
Each producer needs examination of resolver adoption. Rejecting inactive receipt, statement and download content remains a proposed departure from the described legacy behavior. The design does not establish language-specific template selection.