Skip to content

document-draft

Document drafts: one editable copy of a PDF document template per object (for example a lease contract). A draft is created from a template or one of its variants with the values for its placeholders, changed with the structured operations of template patch-draft or the editor, and finalized to a stored PDF through the print client; the template stays unchanged. Revise reopens a finalized draft. Body, variables and the last change are personal data of the draft, which is its own crypto-shredding subject.

What this feature needs to run (Requires, top) and the write commands this feature provides (Provides, bottom).

flowchart TB
  n_document_draft["document-draft"]
  subgraph how_reqs["Requires"]
    n_files["files"]
    n_template_resolver["template-resolver"]
    n_user_data_rights["user-data-rights"]
    n_renderer_puppeteer_client["renderer-puppeteer-client"]
  end
  subgraph how_provides["Provides"]
    n_cmd_document_draft_write_create(["create"])
    n_cmd_document_draft_write_discard(["discard"])
    n_cmd_document_draft_write_finalize(["finalize"])
    n_cmd_document_draft_write_patch(["patch"])
    n_cmd_document_draft_write_revise(["revise"])
    n_cmd_document_draft_write_save(["save"])
  end
  n_files --> n_document_draft
  n_template_resolver --> n_document_draft
  n_user_data_rights --> n_document_draft
  n_renderer_puppeteer_client --> n_document_draft
  n_document_draft --> n_cmd_document_draft_write_create
  n_document_draft --> n_cmd_document_draft_write_discard
  n_document_draft --> n_cmd_document_draft_write_finalize
  n_document_draft --> n_cmd_document_draft_write_patch
  n_document_draft --> n_cmd_document_draft_write_revise
  n_document_draft --> n_cmd_document_draft_write_save

Provides — write commands this feature registers (dispatch them through the command bus):

  • Registers extension: userData → documentDraft