Skip to content

feat(schema): person master-data + security levels + custom field definitions - #60

Merged
2000game merged 2 commits into
mainfrom
feat/field-definitions-47-48
Jul 9, 2026
Merged

2000game merged 2 commits into
mainfrom
feat/field-definitions-47-48

Conversation

@2000game

@2000game 2000game commented Jul 9, 2026

Copy link
Copy Markdown
Member

Adds the field-definition schema read surface for persons and groups, and records a writability decision. Schema/definitions only — the tool never reads or writes person records or per-record field values (the permanent people boundary, assertNotPeople).

What this adds

⚠️ Finding: no committed OpenAPI schema

The brief assumed a committed src/api/schema.d.ts generated from a live instance. That file is git-ignored (.gitignore) and generated on demand by npm run generate:client — it is not in the repo, so endpoint methods could not be verified against this repo's schema, and hitting a live instance is forbidden. Paths/methods below were instead verified against ChurchTools' public API-client libraries (5pm-HDH churchtools-api @ CT 3.104, bensteUEM ChurchToolsAPI @ CT 3.101) and CT Academy docs. Re-verify per the runbook's re-audit procedure once a schema is generated.

Writability decision — READ-ONLY (both #47 and #48). No fake writability.

Field definitions are read-only; no registry resource / DSL is added. Evidence:

  1. Every public CT REST client exposes data fields as GET-only — GET /dbfields, GET /dbfields/{id}. No REST POST/PUT/PATCH/DELETE on any field-definition path.
  2. Mutation exists only via the legacy churchdb admin AJAX (CTChurchDBModule: db_insertfields/db_updatefields/db_deletefields) — the same non-REST legacy surface as the permission catalog, which this tool already treats as read-reference-only and never writes.
  3. A declarative reconciler needs a clean REST create + item PUT/PATCH/DELETE; none exists, so promoting to a managed resource would mean faking writability through legacy admin AJAX — out of bounds. If CT later adds REST writes on /dbfields (the spec is self-trimming, so they'd appear silently), promote then. Full rationale: docs/field-definitions.md.

Testing

  • Mocked-client only — never hits a live instance. New tests in tests/get-command.test.ts cover the unpaginated person-masterdata read and the auto-paginated data-fields read.
  • npm test → 448 passed / 4 skipped (pre-existing integration skips); npm run typecheck and npm run lint clean.

Acceptance

Closes #47
Closes #48

2000game added 2 commits July 9, 2026 14:33
)

Add read-only `ct get person-masterdata` (GET /person/masterdata, the person
master-data model incl. the security-level enumeration) and `ct get data-fields`
(GET /dbfields, the unified person + group data-field DEFINITIONS, discriminated
per-row by fieldCategory). Schema/definitions only — never person records or
per-record field VALUES. Endpoints follow the existing RESOURCE_PATHS pattern
(auto-paginated where list-shaped, --env aware). Mocked-client tests only.
…ion (#47, #48)

Add docs/field-definitions.md: schema/definitions in scope, per-record values
never; the read commands; and the writability decision (READ-ONLY) with evidence
— DBFields are GET-only in every public CT REST client, mutation is legacy
churchdb AJAX (db_insert/update/deletefields), same non-REST surface as the
permission catalog; and the finding that this repo's OpenAPI schema is
git-ignored/ungenerated so paths were verified against public CT client libs.
Move custom fields from 'out of tool scope' to read-only supported in the
runbook (only per-record values stay out of scope); add an api-coverage addendum
and README pointer.
@2000game
2000game merged commit 5cc8815 into main Jul 9, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant