Versioned templates
Per-tenant DOCX templates with effective ranges. Old documents render with their template version.
Carbone renders DOCX from JSON; Gotenberg converts to PDF; MinIO stores by content hash; DocuSeal collects signatures. Every step is jurisdiction-aware and locale-aware.
The documents context owns three aggregates: DocumentTemplate, GeneratedDocument, and SignatureRequest. Templates are versioned DOCX files with Carbone’s tag syntax. Generation is a single API call: pass a template id and a context object; the API runs Carbone (DOCX → DOCX), then Gotenberg (DOCX → PDF), computes the SHA-256 of the PDF, and stores it in MinIO at documents/{tenantId}/{sha256}. The audit chain references the SHA — not the bytes — so changing a generated document is structurally impossible.
Locale and calendar formatters are injected into the Carbone context: {date | format:$locale.calendar.long}, {amount | format:$locale.currency}, {name | dir:auto}. The same template renders correctly for an English-speaking US client (Gregorian, USD) and an Arabic-speaking Saudi client (Hijri, SAR, RTL paragraphs). Templates that try to embed locale-specific strings inline are rejected at upload time; CI checks for parity with the i18n catalog.
Signatures use DocuSeal. The API creates an envelope, attaches the generated document, and configures signers and roles. DocuSeal handles email or SMS delivery, the signing UI, and the X.509 certificate of completion. Webhooks back signal the documentSignatureWorkflow in Temporal, which writes audit events at every step (sent, viewed, signed, completed, voided).
Jurisdiction-specific templates ship in the box: SAMA-aligned account agreements, FCA-aligned suitability summaries, SEC-aligned Form CRS, CBI-aligned KYC packages. Customers add their own; the platform never assumes its templates are the only ones.
Carbone consumes the template and the context object; produces a locale-correct DOCX.
Gotenberg runs LibreOffice to convert the DOCX to a PDF (PDF/A optional).
SHA-256 of the PDF computed and stored as contentHash on the GeneratedDocument record.
PDF written to MinIO at documents/{tenantId}/{sha256}; bucket has versioning and per-tenant policies.
(optional) DocuSeal envelope created; webhooks signal Temporal for state progression and audit.
Per-tenant DOCX templates with effective ranges. Old documents render with their template version.
Calendar, number, currency, direction, units — all available as Carbone filters.
SHA-256 of the PDF. Identical inputs produce identical outputs; the chain references hashes.
MinIO compliance-mode object lock on the evidence bucket; documents cannot be deleted or overwritten.
DocuSeal integration. Multi-party signing, decline reason capture, certificate of completion.
24-hour pre-signed URLs for client downloads. Watermarked when delivered through the client portal.
Account agreements, suitability disclosures, KYC packages — all generated through this pipeline.
FeatureDocuments are referenced by content hash. The chain proves a document existed at a point in time.
FeatureCalendar and number formatters are shared with the rest of the platform.
We will port it to Carbone, render in three locales, route through DocuSeal, and show you the audit chain referencing the content hash.