Agreements
Overview

Agreements

Gordon CRM includes a built-in agreement system for collecting digital signatures on waivers, intakes, and other compliance documents. The system uses tokenized clickwrap signing — each agreement is dispatched as a unique URL that the contact can open, review, and sign without logging in.

Data Model

The agreements system uses three tables:

agreement_templates

Stores the current/live version of each template.

FieldTypeDescription
iduuidPrimary key
workspace_iduuidTenant isolation
titletextTemplate name (e.g. "Standard Liability Waiver")
body_htmltextRich-text body content (HTML)
versionintegerCurrent version number, starting at 1
is_activebooleanWhether the template is active (visible for sending) or archived
created_byuuidFK to user_profiles.id
created_attimestamptzWhen the template was created
updated_attimestamptzWhen the template was last modified

agreement_template_versions

Append-only audit log of previous template body content. A new row is inserted each time the template body is edited.

FieldTypeDescription
iduuidPrimary key
template_iduuidFK to agreement_templates.id (CASCADE delete)
versionintegerThe version number this row represents
body_htmltextThe body content at this version
updated_byuuidFK to user_profiles.id — who made the change
created_attimestamptzWhen this version was archived

contact_agreements

Dispatched agreement instances — one row per contact per agreement sent.

FieldTypeDescription
iduuidPrimary key. Also serves as the signing token used in the public URL.
workspace_iduuidTenant isolation
contact_iduuidFK to contacts.id
template_iduuidFK to agreement_templates.id
statustext'pending' or 'signed' (CHECK constraint)
template_versionintegerThe template version at time of signing (populated on sign)
snapshot_bodytextThe full HTML body captured at time of signing (immutable record)
signed_by_nametextThe name the signer typed to sign
signed_attimestamptzWhen the agreement was signed
ip_addresstextIP address of the signer
sent_byuuidFK to user_profiles.id — who dispatched the agreement (NULL for automated)
created_attimestamptzWhen the agreement was sent

Template Management

Agreement templates are managed at Settings → Agreement Templates (/settings/agreements).

Creating Templates

Click "New Template" to open a dialog with:

  • Title — A descriptive name (e.g. "Standard Liability Waiver", "Client Intake Form")
  • Body — Rich-text editor (tiptap) supporting bold, italic, bullet lists, and other formatting

Editing Templates

Click the pencil icon on any template to open the edit dialog. If the body content changes, the system automatically:

  1. Archives the current body to agreement_template_versions
  2. Increments the version number on the template

Title-only changes do not create a new version.

Version History

Templates with more than one version display a clock icon. Clicking it opens the version history dialog showing all previous versions with timestamps and a "View" button to inspect each version's body content in read-only mode.

Archive / Restore

  • Archive — Marks the template as inactive (is_active = false). Archived templates do not appear in the "Send Agreement" template picker. Existing pending agreements for archived templates remain valid and can still be signed.
  • Restore — Returns the template to active status.

Deleting Templates

Templates can only be deleted if they have no associated agreements (pending or signed). If agreements exist, the system returns an error: "This template has agreements associated with it. Please archive it instead."

RBAC

OperationRequired Role
View templatesAll members
Create / Edit / Archive / Delete templatesOwner or Admin
Send agreements to contactsOwner or Admin
View agreement status on contactsAll members

Related Documentation