Version history for the documents behind a contract

A generic version spine that snapshots a document whenever its content actually changes, numbers the versions per job, and records which one the customer is allowed to see.

What it is

Document_version stores a snapshot with a version number, a source ('smartbuild' raw sync or 'send' customer-facing), a creator, a quoted price, a label and a customer_visible flag. A deterministic key-order-independent stringify feeds a short hash signature so an unchanged document never creates a new version. document_version_selection records a pinned version.

Also called: estimate versions · version history · what was in the last one · revision history

See it
Version history for the documents behind a contract
Prepared for
Sutter Kline
1140 Ridge Line Rd · Fair Play
Shell package$33,034
Concrete & site$9,590
Doors & windows$6,394
Trim & finish$4,262
Total
$53,280
Signature
The Versions modal: a numbered list with created-by and totals, one row expanded to show section subtotals. VersionsModal.tsx. Sample data — no customer information appears here.
How it works
  1. 1snapshotEstimateVersion() computes a stable signature of the content and compares it to the latest stored version.
  2. 2Identical signature → no-op; different → insert at version_no + 1.
  3. 3Only 'send' versions can be made customer-visible.
  4. 4A concurrent-sync race that loses the unique insert is tolerated deliberately, because the other sync captured the same content.
  5. 5The contract's pull-to-live feature reads the customer-visible version through this spine.
Why we built it

The signature function exists so version history is content-based rather than event-based: 'Deterministic (key-order-independent) stringify so the change-detect signature is stable regardless of how SmartBuild serialized the JSON', and snapshots are taken only 'when the content changed.' Without that, a sync loop would manufacture hundreds of identical versions.

The problem
  • No history of what a document said at each revision
  • Version noise from syncs that changed nothing
  • No way to answer 'what was in the previous one' mid-call
Sound familiar?
What you get
A numbered, content-based history per job
Only real changes create a version
The contract can reconcile against the version the customer can see
What's inside

See it on your own jobs

Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.

or keep browsing features →