Data model and placeholders of contract templates

The template table, document kinds and signing modes, the built-in templates, placeholders by group, filling rules and the pairing of the bilingual PDF.

A template is shared installation master data (contract/contracttemplate, no content scope); the filled document is produced under the contract's content permission.

Data model

Table names carry the installation's own prefix in the database. contract_template: code (built-in identifier; empty = custom), doc_kind, sub_type, name, signing, is_default, sort_order, status; contract_template_description: title, body per language.

doc_kind: contract, amendment, termination, certificate, expiry, registration, annex, reg_rejection, offer. signing: bilateral (every party), unilateral (only the declaring party: termination → the terminating party, both if mutual; certificate → the principal; rejection → the principal; offer → the offeror; other → the client party), none. An unknown value falls back to the kind's default.

Built-in templates

All with Hungarian, English and German text: brokerage_contract_hu_v1, site_supervision_contract_hu_v1 (sub-type site_supervision), brokerage_amendment_hu_v1, brokerage_termination_hu_v1, brokerage_certificate_hu_v1 and _v2 (v2 is the default), contract_expiry_hu_v1, brokerage_registration_v1, brokerage_registration_rejection_v1, brokerage_offer_v1, contract_annex_generic_v1, contract_annex_dataroom_policy_v1. Translations keep the paragraph structure and placeholder set of the Hungarian text. Migrations only insert missing language rows and never touch manually edited text. In the built-in contract templates {esign_clause} was placed before {signature_block}. Templates contain no personal or company data. The site supervision template cites legal provisions fixed in code (Government Decree 191/2009 s. 16, Hungarian VAT Act s. 58, Criminal Code s. 290–291, Civil Code 6:272–6:280).

Placeholders

GroupPlaceholders
Contract{contract_no}, {contract_title}, {contract_date_signed}, {date_from}, {date_to}, {term_months}, {tail_months}, {payment_days}, {place}, {date_signed} (date of the document), {commission_sale}, {commission_share_sale}, {commission_rent_months}, {commission_rent_short}, {property_list} (HTML), {contract_description}, {fee_table} (HTML), {notice_days}, {principal_bank_account}, {agent_bank_account}, {annex_list} (HTML), {immediate_termination_reasons} (HTML), {esign_clause}, {principal_contact}, {agent_contact}, {property_owner}, {mandate_clause}
Parties and signature{parties_block} (HTML), {party_roles_line}, {signature_block} (HTML)
Principal, agent{principal_name}, {principal_address}, {principal_taxhu}, {principal_regno}, {principal_rep}, {principal_rep_phone}, {principal_rep_email}; likewise {agent_name} etc.
Amendment{amendment_no}, {amendment_date}, {amendment_effective}, {amendment_text} (HTML), {new_date_to}
Termination{termination_title}, {termination_statement}, {termination_date}, {termination_effective}, {termination_reason_block} (HTML), {termination_note} (HTML), {terminating_name}, {addressee_name}, {addressee_address}, {termination_reasons}, {termination_clause_refs}
Completion certificate{certificate_no}, {certificate_date}, {property_name}, {property_address}, {deal_type}, {counterparty_name}, {base_amount}, {commission_basis}, {commission_amount}, {vat_rate_text}, {vat_amount}, {gross_amount}, {vat_basis_text}, {certified_total}, {certificate_note} (HTML), {deal_total_amount}, {payment_list} (HTML), {deal_contract_ref}, {deal_contract_no}, {deal_contract_date_signed}
Client registration{registration_no}, {registration_date}, {reg_agent_name}, {reg_agent_taxhu}, {client_name}, {client_address}, {client_taxhu}, {client_regno}, {client_contact}, {client_phone_email}, {property_text} (HTML), {deal_title_marks}, {date_first_contact}, {date_offer_sent}, {date_presentation}, {date_negotiation}, {activity_text} (HTML), {offered_price}, {payment_schedule}, {financing_marks}, {coverage_text}, {att_intent_mark}, {att_presentation_mark}, {att_offer_mark}, {att_financing_mark}, {decision_accept_mark}, {decision_reject_mark}, {decision_date}, {decision_note}
Rejection{rejection_rows} (HTML), {rejection_reason}, {rejection_note}, {rejection_date}
Offer{offer_no}, {offer_date}, {offer_property}, {offer_type_text}, {offer_terms} (HTML), {offer_amount}, {offer_monthly_rent}, {offer_term_months}, {offer_valid_until}, {offer_decision}
Annex, expiry notice{annex_no}, {annex_title}, {annex_date}; {expiry_date}, {expiry_clause}, {recipient_name}, {client_name}

Filling inserts text values HTML-escaped; placeholders carrying HTML are produced by the caller. An unknown placeholder stays empty in the issued document, is shown in yellow with its name in the preview, and is listed in the response.

Bilingual PDF

  1. A Hungarian text is required for every document; for a non-Hungarian language the PDF has two columns (Hungarian left, foreign language right). The Hungarian column is built from the Hungarian version of the same template with Hungarian placeholder data; without a Hungarian template it fails.
  2. Pairing by the top-level HTML blocks (p, h1–h6, ul, ol, table, div, blockquote, pre, hr, dl): with equal block counts per paragraph (paired), otherwise one row with both full texts (columns). In two columns page breaks are dropped and the font size is 8.5 pt (otherwise 9.5 pt).

Endpoints and permissions

contract/contracttemplate: index, list, form, save, enable, disable, statusdelete, delete, plus bilingual (bilingual preview, list permission). Keys: list, add, edit, statusdelete, delete, debug. Preview from the contract: contract/contract.templatepreview (generate + scope); loading texts into the form: contract/contract.templatetexts.