Section-based document builder: catalogue, variants, presets
The zones and rules of the section catalogue, role and data placeholders, cross-references, the structure check, the additive migration rules and the 9 structure presets.
The document builder assembles contract documents from a section catalogue, text variants and structure presets. The content (catalogue, 76 variants, 9 presets) is tested on a real database; the user interface is the second phase of the plan and has not run on live data, so its behaviour cannot be described in more detail here.
Text rules
Role names come from variables; no fixed role name is written in the texts. The values are the inflected forms of the buyer-side and seller-side roles of the contract type (role master, three languages); the Hungarian text puts no article before the role name.
| Placeholder | Meaning |
|---|---|
{buyer}, {seller} | nominative |
{buyer_acc}, {seller_acc} | accusative |
{buyer_abl}, {seller_abl} | "from" form |
{buyer_dat}, {seller_dat} | "to" form |
{buyer_ins}, {seller_ins} | "with" form |
{contract_no}, {date_from}, {payment_days}, {commission_sale} … | existing data placeholders of contract documents |
{ref:code} | the point number of the referenced numbered section; may only point to a section required in the "depends on" column |
Parameters without a data field appear as "……"; the texts contain no personal data. After the section text comes the data block produced by the system (parties, fees, properties, reasons, contacts, persons, annexes, signatures).
The catalogue
- 47 sections plus the earlier "Free text", by zone: head (title, parties, introduction), body (the numbered sections and the bodies of amendment, termination statement and certificate), tail (copies, annexes, signatures, guarantor declaration).
- Per section: zone, data block, numbered or not, document kind, main type (for example mandate, sale, lease, works), the document kinds where it is mandatory, and the section it depends on (for example payment on fees, advance on payment, guarantor declaration on guarantee).
- Mandatory: title and signatures for every document kind; parties for contracts and amendments; subject for contracts; the bodies of amendment, termination and certificate for their own kind.
- 76 variants with title and text in three languages. The variants of title, parties, introduction, copies, signatures, termination statement and certificate have an empty title; when copied into the document the catalogue title takes their place.
Structure presets
| Document kind, main type, subtype | Non-default variants |
|---|---|
| contract, mandate, real_estate_brokerage | brokerage subject, brokerage tasks, commission per deal |
| contract, works | works subject, technical handover, lump sum, performance retention, ordinary termination excluded, one-sided confidentiality |
| contract, mandate, accounting | accounting subject, automatic renewal, monthly advance payment, advance on individual order, accountant's liability |
| contract, mandate, site_supervision | supervision subject and tasks, until completion, one-sided confidentiality, supervisor's liability |
| amendment | title, parties, introduction, content of the amendment, copies, signatures |
| termination (general and brokerage) | statement parties and signature; for brokerage the brokerage termination statement |
| certificate (general and brokerage) | statement parties and signature; for brokerage the settlement of the commission |
The presets of amendment, termination and certificate without a main type apply to every contract type.
Structure check and updates
- Before saving: mandatory sections, dependencies, whether the section fits the document kind and main type, and the order of zones (head, body, tail).
- The migration only adds: it never overwrites an existing section, variant or description; it fills a preset only for an empty key; it marks a default variant only if the section has none yet. Every language of every built-in variant gets a version 1 history row (
contract_text_history). - Table names carry the installation's own prefix in the database.
Known limitations
The behaviour of the user interface (document builder card, menu items) cannot be described in more detail from the code; it has not yet run on live data, in a browser or with real PDF rendering.