drawing_sheets

This table stores the confirmed sheet records extracted from a drawing version. Each row represents one logical drawing sheet/page after OCR and user review.

Domain: Drawings
Scope: Project / Sheet
Status: Proposed
Last Updated: 11 Apr 2026
Mutable: Partly
Primary Owner: Drawings / OCR Review
RLS Applies: Yes
Client Facing: Yes

Purpose

The purpose of this table is to persist the sheet-level output of the drawings pipeline, including the final sheet number, title, page position, and OCR metadata needed for navigation and linking.

What this table does

  • Stores one row per sheet in a drawing version
  • Tracks sheet number and sheet name
  • Supports navigation, search, OCR review, and linking workflows
  • Provides the parent object for callouts, annotations, and measurements

Why this table is defined

Users do not work with the original uploaded PDF as one monolithic object. They work with sheets. This table lets DirtView treat each sheet as a first-class entity for viewer navigation, callout linking, and annotation.

Columns

Column Type Required Description Example
id uuid Yes Primary key for the sheet record dsheet_001
drawing_version_id uuid Yes Version this sheet belongs to dver_003
tenant_id uuid Yes Tenant owning the sheet tenant_001
sheet_number text Yes Final or confirmed sheet number A1.2
sheet_name text No Final or confirmed sheet title Level 1 Floor Plan
discipline text No Discipline grouping if detected or assigned architectural
page_index int Yes Zero- or one-based position in the original upload sequence 12
source_file_id uuid No Original source file for this sheet file_001
preview_file_id uuid No Rendered preview image or thumbnail file file_010
pdf_file_id uuid No Single-sheet PDF file if stored separately file_011
ocr_raw jsonb Yes Raw OCR extraction payload {"title_block_text":"A1.2 Level 1 Floor Plan"}
ocr_confidence numeric(5,2) No Confidence score from extraction pipeline 92.50
review_status text Yes Whether the sheet metadata is pending, confirmed, or corrected confirmed
confirmed_by uuid No User who confirmed or corrected this sheet user_123
confirmed_at timestamptz No Timestamp when the sheet was confirmed 2026-04-11 10:35:00+00
metadata jsonb Yes Flexible sheet metadata {"rotation":0}

Relationships

  • drawing_version_iddrawing_versions.id
  • source_file_id, preview_file_id, pdf_file_idfiles.id
  • id is referenced by callout, annotation, and measurement tables

How it is used

  • Shown in drawings grid/list views
  • Used for sheet search by number or title
  • Acts as the navigable target for callout linking
  • Acts as the canvas parent for annotations and measurements

Access and security

  • Project access and module permissions must apply
  • Sheet confirmation should be limited to authorized users
  • Changes to confirmed sheet metadata may need audit visibility

Example scenarios

Scenario 1: OCR extraction

A sheet is created with OCR-derived number and title before user confirmation.

Scenario 2: User correction

A reviewer edits the sheet number and marks the sheet as corrected.

Scenario 3: Viewer navigation

A user searches for A1.2 and opens the matching sheet record.

Notes and assumptions

  • Sheet number uniqueness should usually be enforced within a version
  • Store raw OCR payloads for traceability and future model improvements
  • This table is foundational for later callout and annotation features