Files

1.6 KiB

paths
paths
crates/core/src/domain/sheet/**
docs/development/ANATOMICAL_SHEET_MODEL.md
supabase/seed/anatomical-sheets/**
crates/core/src/bin/upload_sheet_assets/**

Anatomical sheet model (crates/core/src/domain/sheet + migration 20261008110000)

  • docs/development/ANATOMICAL_SHEET_MODEL.md is the source of truth: document shape, issue codes, tables, RPCs.
  • Ids are stable slugs never derived from labels; labels are { fr, en } objects. Annotation → findings is the explicit finding_zone_id; vertebral regions are ordered data with free codes. No label matching at runtime.
  • A published version is immutable (trigger, every role). Change = new draft (create_sheet_draft) then publish_sheet_version. Integrity rule codes are shared by validate_sheet_document (Rust core) and private.sheet_document_issues (SQL); add a rule on both sides and in the spec table.
  • Document schema change → bump SHEET_DOCUMENT_SCHEMA_VERSION, extend the SQL CHECK on document_schema_version.
  • Official equine sheet = generated seed draft/ (pnpm import:equine --out into an empty folder, then reviewed and copied; never edit legacy-import/ or draft/ by hand; curation_draft / curation_review fail on drift, pnpm import:equine --check lists it). Every content change goes through curation/changes.json (traced in CHANGELOG.md). It is a DRAFT until a platform admin publishes it after business review of REVIEW-REPORT.md.
  • Sheet SVG bytes live in Storage bucket anatomical-sheet-assets as <sha256>.svg; uploads are an operator task (pnpm assets:upload <seed dir> with the service key in env), never from the browser.