feat(schema): person master-data + security levels + custom field definitions - #60
Merged
Merged
Conversation
) 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.
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ct get person-masterdata→GET /person/masterdata(single object, unpaginated): the person master-data model incl. the security-level enumeration that churchdb permission scopes (cc_securitylevel) reference.ct get data-fields→GET /dbfields(auto-paginated): the unified data-field DEFINITION catalog. Person master-data fields and group custom fields ("Datenfelder") live in one list, discriminated per-row byfieldCategory(table/internCode, e.g.cdb_gruppe= a group field). This one endpoint serves both feat: manage person master-data field definitions + expose security levels (schema, not people) #47 (person fields) and feat: support custom field definitions (group custom fields; person custom fields) #48 (group custom fields).RESOURCE_PATHSpattern:--envaware,getAllpagination where list-shaped. Additive only (new specs), so it rebases cleanly against feat(dx): human-authorable configs — idiomatic adopt output, dynamic sugar, located errors, machine-only state, blueprints by default #52/bug: dynamic ruleset round-trip assumption unverified — CT-recomputed fields would cause perpetual diffs #36.docs/field-definitions.md(boundary + decision + evidence), runbook update (custom fields moved from "out of scope" to read-only supported; only per-record values stay out of scope), api-coverage addendum, README pointer.The brief assumed a committed
src/api/schema.d.tsgenerated from a live instance. That file is git-ignored (.gitignore) and generated on demand bynpm 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-HDHchurchtools-api@ CT 3.104, bensteUEMChurchToolsAPI@ 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:
GET /dbfields,GET /dbfields/{id}. No REST POST/PUT/PATCH/DELETE on any field-definition path.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./dbfields(the spec is self-trimming, so they'd appear silently), promote then. Full rationale:docs/field-definitions.md.Testing
tests/get-command.test.tscover the unpaginatedperson-masterdataread and the auto-paginateddata-fieldsread.npm test→ 448 passed / 4 skipped (pre-existing integration skips);npm run typecheckandnpm run lintclean.Acceptance
ct(person-masterdata+data-fields); writability decision recorded (read-only, with evidence). ✅ct get data-fields(fieldCategory.table == "cdb_gruppe"); runbook updated. ✅ (read-only per the decision; no plan no-op because definitions are not REST-writable.)Closes #47
Closes #48