feat: scaffold native projects module
This commit is contained in:
1
src/govoplan_projects/__init__.py
Normal file
1
src/govoplan_projects/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""GovOPlaN Projects module."""
|
||||
1
src/govoplan_projects/backend/__init__.py
Normal file
1
src/govoplan_projects/backend/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""Backend integration for the GovOPlaN Projects module."""
|
||||
134
src/govoplan_projects/backend/manifest.py
Normal file
134
src/govoplan_projects/backend/manifest.py
Normal file
@@ -0,0 +1,134 @@
|
||||
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 = "projects"
|
||||
MODULE_NAME = "Projects"
|
||||
MODULE_VERSION = "0.1.14"
|
||||
READ_SCOPE = "projects:project:read"
|
||||
WRITE_SCOPE = "projects:project:write"
|
||||
ADMIN_SCOPE = "projects:project:admin"
|
||||
OPTIONAL_DEPENDENCIES = (
|
||||
"tasks",
|
||||
"tickets",
|
||||
"cases",
|
||||
"wiki",
|
||||
"calendar",
|
||||
"files",
|
||||
"workflow",
|
||||
"connectors",
|
||||
"search",
|
||||
"notifications",
|
||||
)
|
||||
|
||||
|
||||
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=MODULE_NAME,
|
||||
level="tenant",
|
||||
module_id=module_id,
|
||||
resource=resource,
|
||||
action=action,
|
||||
)
|
||||
|
||||
|
||||
PERMISSIONS = (
|
||||
_permission(READ_SCOPE, "View projects", "Read accessible projects and portfolios."),
|
||||
_permission(WRITE_SCOPE, "Manage projects", "Create and update projects and milestones."),
|
||||
_permission(ADMIN_SCOPE, "Administer projects", "Configure project types and policies."),
|
||||
)
|
||||
|
||||
ROLE_TEMPLATES = (
|
||||
RoleTemplate(
|
||||
slug="projects_manager",
|
||||
name="Projects manager",
|
||||
description="Create and manage projects and milestones.",
|
||||
permissions=(READ_SCOPE, WRITE_SCOPE),
|
||||
),
|
||||
RoleTemplate(
|
||||
slug="projects_viewer",
|
||||
name="Projects viewer",
|
||||
description="Read accessible projects.",
|
||||
permissions=(READ_SCOPE,),
|
||||
),
|
||||
)
|
||||
|
||||
DOCUMENTATION = (
|
||||
DocumentationTopic(
|
||||
id="projects.module-boundary",
|
||||
title="Projects module boundary",
|
||||
summary=(
|
||||
"Portfolios, projects, goals, milestones, participants, status, "
|
||||
"work structure, and project-level references."
|
||||
),
|
||||
body=(
|
||||
"Projects owns native project context. Tasks and Tickets own "
|
||||
"actionable work, Cases owns formal procedures, and Connectors "
|
||||
"owns OpenProject synchronization."
|
||||
),
|
||||
layer="available",
|
||||
documentation_types=("admin",),
|
||||
audience=("operator", "module_admin", "product_owner"),
|
||||
related_modules=OPTIONAL_DEPENDENCIES,
|
||||
links=(
|
||||
DocumentationLink(
|
||||
label="Repository domain boundary",
|
||||
href="govoplan-projects/docs/PROJECTS_DOMAIN_BOUNDARY.md",
|
||||
kind="repository",
|
||||
),
|
||||
),
|
||||
metadata={
|
||||
"seed": True,
|
||||
"domain_objects": [
|
||||
"portfolio",
|
||||
"project",
|
||||
"milestone",
|
||||
"project participant",
|
||||
"project resource link",
|
||||
"external project reference",
|
||||
],
|
||||
"first_slice": (
|
||||
"Implement project identity, status, milestones, participants, "
|
||||
"resource links, and OpenProject reference mapping."
|
||||
),
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
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
|
||||
1
src/govoplan_projects/py.typed
Normal file
1
src/govoplan_projects/py.typed
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user