ZDDC/zddc/internal/handler/default-project-mdl.table.yaml
ZDDC e3db2f8473 feat(records): simplest default tracking number + folder-bound originator
Two coupled cleanups so the baked-in defaults reflect the actual
convention instead of leaking one project's choices into every
deployment:

- Drop the project-wide phase/area components from the default
  filename_format, form schemas, and table columns. They must be
  all-on or all-off across a project to keep filenames lexically
  consistent, so the simplest default omits them; operators re-enable
  via the commented-out templates + a .zddc filename_format override.
  Teaching comments (incl. a field_codes: example) now ride along in
  defaults.zddc.yaml, which `show-defaults` dumps verbatim.
- Separate suffix from sequence with a template hyphen
  ({sequence}-{suffix?}); stored suffix is now just the part marker
  (A, 01) with no leading dash.
- New records: key `folder_fields: {field: parent-distance}` binds a
  body field to an ancestor folder name. The default mdl/rsk records
  bind originator to the party folder (distance 1) — the folder is the
  sole source of truth. The server overwrites the body value before
  validation + composition (WriteWithHistory and the rollup create
  path), and the form renderer marks the field read-only and pre-fills
  it. Rollup forms drop originator from required (server derives it
  from the selected party).

Tests: folder-binding overwrite + wrong-originator-filename 422, and a
form-render readOnly/prefill assertion; existing record tests realigned
so the party folder name equals the originator.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 14:31:49 -05:00

70 lines
2.1 KiB
YAML

# Default project-rollup Master Deliverables List spec, served by
# zddc-server when no operator-supplied table.yaml exists at
# <project>/mdl/.
#
# This view aggregates every deliverable row from every party under
# <project>/archive/. Each synthetic row is backed by the real file
# at <project>/archive/<party>/mdl/<file>.yaml; the leading `$party`
# column is the server-synthesized source-party identity (path-
# injected on read, not stored in the YAML). The `$` sigil marks it
# as system-managed — tables tool renders read-only and strips it
# before submitting a row write.
#
# + Add row IS enabled here: the form schema's `party` field doubles
# as the routing key — the server reads the submitted `party` field,
# finds the matching <project>/archive/<party>/ folder, and writes
# the row inside its mdl/ subfolder. The party folder must already
# exist (create it via the SSR view).
title: Project Deliverables (all parties)
description: Every deliverable across all parties under archive/. Click a row to edit; + Add row uses the Package column to route the new row to the matching archive/<party>/mdl/ folder.
columns:
- field: $party
title: Package
width: 7em
- field: originator
title: Originator
width: 8em
# - field: phase # project-wide; uncomment with form.yaml + filename_format
# title: Phase
# width: 5em
- field: project
title: Project
width: 8em
# - field: area # project-wide; uncomment with form.yaml + filename_format
# title: Area
# width: 5em
- field: discipline
title: Disc.
width: 5em
- field: type
title: Type
width: 6em
- field: sequence
title: Seq.
width: 5em
- field: suffix
title: Suffix
width: 5em
- field: title
title: Deliverable
- field: plannedRevision
title: Rev.
width: 5em
- field: plannedDate
title: Planned
format: date
width: 8em
- field: status
title: Status
width: 6em
enum: [DFT, IFR, IFA, IFC, AFC, AB]
- field: owner
title: Owner
width: 12em
defaults:
sort:
- { field: $party, dir: asc }
- { field: plannedDate, dir: asc }