Document generation and handling
Sofar DOCS
Generates the documents Sofar sends out — contract templates, automated proposal builder, RMA letters, certificates of conformity, signed PDFs straight from a service case. Where Sofar Knowledge is reference material, DOCS is output: every artefact a CSP agent, TMS engineer or sales lead would otherwise hand-craft in Word.
In build
What this module handles
- Contract templates — installer agreements, distributor MSAs, NDAs — versioned and locale-aware (DE, PL, EN, ZH).
- Automated proposal builder — pulls product, pricing and warranty terms from Sofar Products + Sofar Warranty, renders a branded proposal PDF in one click.
- RMA letters — generated from a CSP case so the customer gets a signed return-authorisation with shipping address and reference number.
- Certificates of conformity — CE, UKCA, country-specific compliance certs cross-stamped against the right product family + firmware revision.
- Signed PDF output — server-side digital signing with timestamp + audit trail, no DocuSign round-trip for routine letters.
- Template lifecycle — Legal owns the master, regional ops can fork; every published template has a reviewer + an effective-from date.
Data model
- Document
- orgId, templateId, kind (CONTRACT / PROPOSAL / RMA_LETTER / CERT_OF_CONFORMITY / OTHER), subjectRefs JSON (caseId? quoteId? warrantyId?), locale, status (DRAFT / ISSUED / SIGNED / VOID), generatedAt, generatedById, fileKey
- DocumentTemplate
- name, kind, locale, version, body (markdown + handlebars), variables JSON, ownerTeam, reviewerId, effectiveFrom, supersededBy?
- DocumentSignature
- documentId, signerName, signerEmail, signerRole, signedAt, signatureMethod (CLICKWRAP / SERVER_PKCS7 / EXTERNAL_DOCUSIGN), evidenceFileKey
- DocumentAuditTrail
- documentId, actorId, event (CREATED / RENDERED / SENT / VIEWED / SIGNED / VOIDED), at, ip, userAgent, detail JSON
API surface
GET /api/docs/templatesPOST /api/docs/templatesPATCH /api/docs/templates/:idPOST /api/docs/renderGET /api/docs/:idPOST /api/docs/:id/signPOST /api/docs/:id/void
Workflow
- Render-from-context — a CSP case, a TMS task or a Sofar Customers record carries enough state to fill 80% of the template variables; the operator only edits what's outside the boilerplate.
- Two-eyes on contracts — any document of kind CONTRACT requires a co-reviewer before status flips from DRAFT to ISSUED.
- Server-side signing — RMA letters and certs use the in-house PKCS#7 signer; commercial contracts still relay to DocuSign for legal-grade evidence.
- Audit-on-every-event — render, send, view, sign, void each emit a row; the trail is queryable per-document and per-customer.
Integrates with
- Sofar CSP — render RMA letters and case-closure summaries directly from a case.
- Sofar Customers — pull customer-of-record, billing address, contact for the cover letter.
- Sofar Products — quote pricing, datasheet references, compliance scope.
- Sofar Warranty — embed warranty terms + extended-cover annex into proposals and letters.
- Sofar DISK — finalised PDFs land in the customer's archive folder for retrieval.
- Landray OA — corporate-side contract approvals and counter-signature routing.
Integrates with
Sofar CSPSofar CustomersSofar ProductsSofar WarrantySofar DISKLandray OA

