Add approval template revision administration

This commit is contained in:
2026-08-04 01:04:39 +02:00
parent 3abbe117e5
commit 7f64247625
15 changed files with 833 additions and 36 deletions
@@ -179,6 +179,13 @@ manifest = ModuleManifest(
label="Approval request workspace",
order=20,
),
ViewSurface(
id="approvals.admin.templates",
module_id=MODULE_ID,
kind="section",
label="Approval templates",
order=30,
),
),
),
capability_factories={CAPABILITY_APPROVAL_REQUESTS: _requests},
@@ -240,6 +247,7 @@ manifest = ModuleManifest(
"help_contexts": [
"approvals.navigation",
"approvals.workspace",
"approvals.admin.templates",
"approvals.state.permission-blocked",
"approvals.state.empty",
],
@@ -292,6 +300,35 @@ manifest = ModuleManifest(
},
},
),
DocumentationTopic(
id="approvals.workflow.administer-templates",
title="Administer approval templates",
summary="Create reusable approval chains, publish immutable revisions, compare history, and escalate steps only after their configured due time.",
body=(
"Approval administrators manage templates under Admin > Tenant > Approval templates. A stable key identifies the template while every edit creates a new draft revision with its own content hash, actor, predecessor, and timestamp. Publishing creates another immutable revision that new requests can bind to exactly; existing requests never follow later template changes. "
"The history dialog compares any two tenant-visible revisions as deterministic JSON-pointer changes without hiding unchanged evidence. Request operators with approval administration permission see Escalate only for pending requests, and the action becomes available after the current step's due time. The backend rechecks the due time and optimistic-concurrency revision before recording the lifecycle transition."
),
layer="configured",
documentation_types=("admin", "user"),
audience=("operator", "module_admin", "product_owner", "auditor"),
links=(
DocumentationLink(label="Approval templates", href="/admin?section=tenant-approval-templates", kind="runtime"),
DocumentationLink(label="Template API", href="/api/v1/approvals/templates", kind="api"),
DocumentationLink(label="Template history API", href="/api/v1/approvals/templates/{template_id}/history", kind="api"),
DocumentationLink(label="Template comparison API", href="/api/v1/approvals/templates/{template_id}/compare", kind="api"),
),
metadata={
"help_contexts": [
"approvals.admin.templates",
"approvals.action.escalate-request",
],
"consequence_classes": {
"revise_template": "Supersedes the current template and creates a new draft revision.",
"publish_template": "Creates an immutable published revision available to new requests.",
"escalate_request": "Records that the current due step entered escalation without deciding it.",
},
},
),
),
architecture=declared_module_architecture(
layer="human_work_procedure",