Migrate Tenancy interface patterns

This commit is contained in:
2026-08-03 11:42:34 +02:00
parent 2ab89eb809
commit e76fe16870
11 changed files with 453 additions and 92 deletions
+48 -3
View File
@@ -6,7 +6,7 @@ from govoplan_core.core.access import (
CAPABILITY_AUTH_TENANT_CONTEXT_SWITCHER,
CAPABILITY_TENANCY_TENANT_RESOLVER,
)
from govoplan_core.core.modules import DocumentationTopic, FrontendModule, ModuleContext, ModuleManifest
from govoplan_core.core.modules import DocumentationLink, DocumentationTopic, FrontendModule, ModuleContext, ModuleManifest
from govoplan_core.core.provider_governance import declared_module_architecture
from govoplan_core.core.views import ViewSurface
@@ -51,7 +51,10 @@ manifest = ModuleManifest(
documentation_types=("user",),
audience=("user", "tenant_admin"),
related_modules=("access",),
metadata={"kind": "reference"},
metadata={
"kind": "reference",
"help_contexts": ["tenancy.current-context", "tenancy.selector"],
},
),
DocumentationTopic(
id="tenancy.lifecycle-and-settings",
@@ -61,7 +64,49 @@ manifest = ModuleManifest(
documentation_types=("admin",),
audience=("system_admin", "tenant_admin", "operator"),
related_modules=("access", "admin", "audit"),
metadata={"kind": "reference"},
links=(
DocumentationLink(label="Tenant administration", href="/admin", kind="runtime"),
DocumentationLink(label="Tenant registry API", href="/api/v1/admin/tenants", kind="api"),
DocumentationLink(label="Tenant settings API", href="/api/v1/admin/tenant/settings", kind="api"),
),
metadata={
"kind": "reference",
"help_contexts": [
"tenancy.admin.system-tenants",
"tenancy.admin.tenant-settings",
"tenancy.admin.lifecycle",
"tenancy.admin.blocked",
],
},
),
DocumentationTopic(
id="tenancy.reference.admin-fields",
title="Tenant administration fields and consequences",
summary="Tenant identity, ownership, locale, governance overrides, and lifecycle state have different mutation and recovery consequences.",
body="A tenant slug is immutable after creation and identifies the administrative boundary. The initial owner receives the protected tenant-owner role. Locale and enabled languages are bounded by system language packages. Governance overrides may narrow a system allowance but cannot loosen a system denial. Suspension keeps tenant-owned data and audit evidence while preventing normal use; an operator must switch away from the active tenant before suspending it.",
documentation_types=("admin",),
audience=("system_admin", "tenant_admin", "operator"),
related_modules=("access", "admin", "audit"),
links=(
DocumentationLink(label="Tenant administration", href="/admin", kind="runtime"),
DocumentationLink(label="Tenant registry API", href="/api/v1/admin/tenants", kind="api"),
),
metadata={
"kind": "reference",
"help_contexts": [
"tenancy.field.slug",
"tenancy.field.initial-owner",
"tenancy.field.locale",
"tenancy.field.languages",
"tenancy.field.governance",
"tenancy.action.suspend",
],
"consequence_classes": {
"create": "Creates a new tenant boundary and provisions its protected initial owner.",
"update": "Changes tenant-local identity, locale, or governance configuration.",
"suspend": "Blocks normal tenant use while retaining data and audit evidence.",
},
},
),
),
frontend=FrontendModule(