Initialize GovOPlaN module seed

This commit is contained in:
2026-07-10 18:39:11 +02:00
commit 86a523ab12
20 changed files with 1109 additions and 0 deletions

View File

@@ -0,0 +1 @@
"""GovOPlaN Records module."""

View File

@@ -0,0 +1 @@
"""Backend integration for the GovOPlaN Records module."""

View File

@@ -0,0 +1,101 @@
from __future__ import annotations
from govoplan_core.core.access import CAPABILITY_AUTH_PERMISSION_EVALUATOR, CAPABILITY_AUTH_PRINCIPAL_RESOLVER
from govoplan_core.core.modules import DocumentationLink, DocumentationTopic, ModuleManifest, PermissionDefinition, RoleTemplate
MODULE_ID = "records"
MODULE_NAME = "Records"
MODULE_VERSION = "0.1.6"
READ_SCOPE = "records:workspace:read"
WRITE_SCOPE = "records:workspace:write"
ADMIN_SCOPE = "records:workspace:admin"
OPTIONAL_DEPENDENCIES = (
"files",
"dms",
"docs",
"policy",
"audit",
"transparency",
)
def _permission(scope: str, label: str, description: str) -> PermissionDefinition:
module_id, resource, action = scope.split(":", 2)
return PermissionDefinition(
scope=scope,
label=label,
description=description,
category="Records",
level="tenant",
module_id=module_id,
resource=resource,
action=action,
)
PERMISSIONS = (
_permission(READ_SCOPE, "View records workspace", "Read records records, configuration, and workflow context."),
_permission(WRITE_SCOPE, "Manage records workspace", "Create and update records records and workflow state."),
_permission(ADMIN_SCOPE, "Administer records workspace", "Configure records policies, templates, and tenant-level administration."),
)
ROLE_TEMPLATES = (
RoleTemplate(
slug="records_manager",
name="Records manager",
description="Manage records records and workflow state.",
permissions=(READ_SCOPE, WRITE_SCOPE),
),
RoleTemplate(
slug="records_viewer",
name="Records viewer",
description="Read records records and workflow context.",
permissions=(READ_SCOPE,),
),
)
DOCUMENTATION = (
DocumentationTopic(
id=f"{MODULE_ID}.module-boundary",
title=f"{MODULE_NAME} module boundary",
summary="Records management for file plans, records classification, retention schedules, disposal holds, and archive handoff.",
body=(
"This repository is currently a platform module seed. It registers the domain boundary, "
"permission surface, role templates, and documentation metadata before runtime APIs, "
"database models, migrations, and WebUI routes are introduced."
),
layer="available",
documentation_types=("admin",),
audience=("operator", "module_admin", "product_owner"),
order=100,
related_modules=OPTIONAL_DEPENDENCIES,
links=(
DocumentationLink(
label="Repository domain boundary",
href="govoplan-records/docs/RECORDS_DOMAIN_BOUNDARY.md",
kind="repository",
),
),
metadata={
"seed": True,
"domain_objects": ['file plans', 'records classification', 'retention schedule application', 'disposal holds', 'archive handoff state', 'legal record identity'],
"first_slice": "Define record class, file plan node, retention schedule, disposal hold, archive transfer, and source document links.",
},
),
)
manifest = ModuleManifest(
id=MODULE_ID,
name=MODULE_NAME,
version=MODULE_VERSION,
dependencies=("access",),
optional_dependencies=OPTIONAL_DEPENDENCIES,
required_capabilities=(CAPABILITY_AUTH_PRINCIPAL_RESOLVER, CAPABILITY_AUTH_PERMISSION_EVALUATOR),
permissions=PERMISSIONS,
role_templates=ROLE_TEMPLATES,
documentation=DOCUMENTATION,
)
def get_manifest() -> ModuleManifest:
return manifest

View File