archivist: enum values on the official lists in routes and pipeline

- the config metadata route now serves the official enum vocabularies
  read from the documents collection schema (placeholder excluded)
  instead of the rule-derived vocabularies (US-31, US-37)
- new superuser-only route POST /api/archivist/fields/{field}/values
  registers a value on an enum field's select list, the action behind
  the dashboard's add-a-value entry; the template field is refused
- the pipeline and the full correction register new enum values before
  the record save validates them
This commit is contained in:
2026-11-12 09:42:38 +01:00
parent 2c0fb89144
commit 900c799f82
2 changed files with 80 additions and 43 deletions
+6
View File
@@ -89,6 +89,12 @@ func processOne(app core.App, cfg *config.Config, s3 *storage.Client, ctx contex
}
valid := len(errs) == 0 && rendered != ""
// US-37: new enum values join the official select lists before the
// record save validates them.
if err := pbapp.EnsureEnumValues(app, cfg, fields); err != nil {
return fmt.Errorf("enum values: %w", err)
}
// US-16: the record is created before any physical move.
coll, err := app.FindCollectionByNameOrId("documents")
if err != nil {