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
- 1snapshotEstimateVersion() computes a stable signature of the content and compares it to the latest stored version.
- 2Identical signature → no-op; different → insert at version_no + 1.
- 3Only 'send' versions can be made customer-visible.
- 4A concurrent-sync race that loses the unique insert is tolerated deliberately, because the other sync captured the same content.
- 5The contract's pull-to-live feature reads the customer-visible version through this spine.
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.
- 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
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 →