Documents
Overview
Documents are managed by Socotra with a system of events, data, rendering, and storage. This guide describes how they are created and managed.
Document Types
There are two main kinds of documents that Socotra handles:
Dynamic documents are rendered on demand based on event data and a trigger.
Static documents are rendered and included in your configuration files, and copies of each one are attached as needed.
Rendering Targets
Dynamic documents can be rendered to either Portable Document Format (PDF), or raw HTML. The specific target is based on the configuration preference, on the type
field.
Templates
Document templates are configured at the policy level in the configuration. Any template that is capable of consuming and using the data for the triggering event can be associated with that event. Each template is stored with a .template.liquid
extension.
For a complete overview of how to author document templates, see the document templates configuration guide.
Triggering events
The following events can trigger a document:
Policy quotation, finalization, and issuance
Endorsement quotation, issuance and acceptance
Renewal quotation, issuance, and acceptance
Invoice issuance
Premium Report issuance
Grace Period start
Policy Cancellation (based on lapse or manual cancellation)
Reinstatement
Document Attachment
Most documents are attached to their parent object at the time of rendering. For endorsements and renewals, documents are rendered and associated with the endorsement or renewal object based on the generatingEvent
, but after the transaction is issued the documents are also attached to the parent policy.
Documents can also be added to a policy, or removed from a policy, with the add document and remove document endpoints.
Configuration
For each event trigger, a document, or for some triggers multiple documents may be specified to render. For each one you can select the following:
Document Type (PDF or HTML)
The document template name
The filename for storing the document
The display name for the documents
Some triggers also support a generatingEvent
property. For example, for documents created with a new policy, you can select whether each one is generated with the quote
, accept
, or issue
events.