La Oficina Nítida’s document engine lets each organization maintain its own library of reusable templates. A template is a plain-text document withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Glemynart/SaaS/llms.txt
Use this file to discover all available pages before exploring further.
{{VARIABLE}} placeholders that are replaced at generation time with real employee and tenant data. The result is a pixel-perfect, tenant-branded PDF that lands directly in the employee’s digital file. Templates are per-tenant — every organization manages its own library independently.
Template Types
Thetipo field classifies a template according to its intended use. This classification controls how generated PDFs are categorized in the employee’s expediente.
| Value | Purpose |
|---|---|
CONTRACT | Employment or services contract documents |
CERTIFICATION | Employment certificates and letters |
LETTER | General correspondence and formal notices |
MEMO | Internal memoranda |
The Prisma schema also defines a
Plantilla model with a separate
PlantillaTipo enum (CONTRATO, PREAVISO, TERMINACION, CERTIFICADO,
OTRO). The DocumentTemplate model described on this page is the current
active model for the document generation engine. New development should use
DocumentTemplate exclusively.How Templates Work
A template’s body is stored in thecontenido field as a text string containing {{VARIABLE}} placeholders. At generation time the engine scans the content, resolves each placeholder from the employee and tenant data, and writes the final document.
Available variables
| Placeholder | Source |
|---|---|
{{NOMBRE_COMPLETO}} | Full name built via formatNombreCompleto() from all four name fields |
{{DOCUMENTO}} | Combined document type and number, e.g. CC 1020304050 |
{{CARGO}} | employee.cargo — the employee’s current job title |
{{SALARIO}} | employee.salario — formatted as Colombian pesos (e.g. $1.800.000) |
{{TIPO_CONTRATO}} | employee.tipoContrato — human-readable label (e.g. Término Fijo) |
{{FECHA_INGRESO}} | employee.fechaIngreso — formatted in long es-CO locale |
{{SEDE}} | employee.sedeRef?.nombre — resolved from the formal Sede relationship |
{{EMPRESA}} | tenant.razonSocial or tenant.nombre |
{{NIT}} | tenant.nit |
{{REPRESENTANTE_LEGAL}} | tenant.representanteLegal |
{{LOGO_EMPRESA}} | Inline <img> tag for the tenant logo stored in R2 |
{{FIRMA_REPRESENTANTE}} | Inline <img> tag for the representative’s signature stored in R2 |
contenidoFinal stored on the resulting GeneratedDocument record is an immutable snapshot of the rendered content — even if the employee’s cargo or salary changes later, the generated document preserves the values at generation time.
Example template body
Template Management Endpoints
All endpoints requireADMIN or OPERADOR role, with write operations (POST, PATCH, DELETE) restricted to ADMIN.
Seed default templates
ADMIN role.
Create a template
CreateDocumentTemplateDto fields:
| Field | Required | Description |
|---|---|---|
nombre | ✅ | Display name for the template |
descripcion | — | Optional description |
tipo | ✅ | CONTRACT, CERTIFICATION, LETTER, or MEMO |
contenido | ✅ | Template body with {{VARIABLE}} placeholders |
List templates
DocumentTemplateQueryDto query parameters.
Get a single template
Update a template
Delete a template
deletedAt is set). Existing GeneratedDocument records that reference this template are not affected.
Toggle active status
activo flag between true and false. Inactive templates do not appear in the default list view.
Duplicate a template
tipo and contenido as the source, under the specified new name. Useful for creating year-over-year variants without starting from scratch.
PDF Generation Workflow
Individual document generation
Generate a PDF for a specific contract using a chosen template:generated-documents module (not tied to a specific contract):
Batch generation (lotes)
For generating contracts across an entire branch or employee group simultaneously, use theLoteContrato workflow. A batch job is enqueued, processed by BullMQ, and the resulting PDFs are packaged into a ZIP archive available for download when the lote reaches COMPLETADO status.
Templates are per-tenant — each organization has its own isolated library.
A template created by one tenant is never visible to another. When onboarding
a new tenant, use
POST /document-templates/seed to provision the default set
before any contract generation begins.