144 lines
4.5 KiB
Python
144 lines
4.5 KiB
Python
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
|
|
from govoplan_core.core.provider_governance import declared_module_architecture
|
|
|
|
MODULE_ID = "tickets"
|
|
MODULE_NAME = "Tickets"
|
|
MODULE_VERSION = "0.1.16"
|
|
READ_SCOPE = "tickets:ticket:read"
|
|
WRITE_SCOPE = "tickets:ticket:write"
|
|
ADMIN_SCOPE = "tickets:ticket:admin"
|
|
OPTIONAL_DEPENDENCIES = (
|
|
"cases",
|
|
"projects",
|
|
"wiki",
|
|
"assets",
|
|
"facilities",
|
|
"forms_runtime",
|
|
"portal",
|
|
"files",
|
|
"workflow_engine",
|
|
"tasks",
|
|
"mail",
|
|
"notifications",
|
|
"search",
|
|
)
|
|
|
|
|
|
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="Tickets",
|
|
level="tenant",
|
|
module_id=module_id,
|
|
resource=resource,
|
|
action=action,
|
|
)
|
|
|
|
|
|
PERMISSIONS = (
|
|
_permission(
|
|
READ_SCOPE,
|
|
"View tickets",
|
|
"Read discoverable tickets, queue state, and resolution context.",
|
|
),
|
|
_permission(
|
|
WRITE_SCOPE,
|
|
"Manage tickets",
|
|
"Create, triage, assign, update, resolve, and link tickets.",
|
|
),
|
|
_permission(
|
|
ADMIN_SCOPE,
|
|
"Administer tickets",
|
|
"Configure ticket types, queues, service policies, and intake profiles.",
|
|
),
|
|
)
|
|
|
|
ROLE_TEMPLATES = (
|
|
RoleTemplate(
|
|
slug="tickets_manager",
|
|
name="Tickets manager",
|
|
description="Triage, assign, update, and resolve tickets.",
|
|
permissions=(READ_SCOPE, WRITE_SCOPE),
|
|
),
|
|
RoleTemplate(
|
|
slug="tickets_viewer",
|
|
name="Tickets viewer",
|
|
description="Read discoverable tickets and their resolution context.",
|
|
permissions=(READ_SCOPE,),
|
|
),
|
|
)
|
|
|
|
DOCUMENTATION = (
|
|
DocumentationTopic(
|
|
id=f"{MODULE_ID}.module-boundary",
|
|
title=f"{MODULE_NAME} module boundary",
|
|
summary=(
|
|
"Queue-oriented reports, requests, incidents, problems, triage, "
|
|
"routing, service work, and auditable resolution."
|
|
),
|
|
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", "user"),
|
|
audience=("user", "operator", "module_admin", "product_owner"),
|
|
order=100,
|
|
related_modules=OPTIONAL_DEPENDENCIES,
|
|
links=(
|
|
DocumentationLink(
|
|
label="Repository domain boundary",
|
|
href="govoplan-tickets/docs/TICKETS_DOMAIN_BOUNDARY.md",
|
|
kind="repository",
|
|
),
|
|
),
|
|
metadata={
|
|
"seed": True,
|
|
"domain_objects": [
|
|
"ticket",
|
|
"ticket type and queue",
|
|
"triage and routing facts",
|
|
"reporter and requester references",
|
|
"assignment and service-level state",
|
|
"resolution and escalation links",
|
|
],
|
|
"first_slice": (
|
|
"Define ticket identity, intake profiles, queues, triage, "
|
|
"assignment, resolution, and stable escalation links to cases."
|
|
),
|
|
},
|
|
),
|
|
)
|
|
|
|
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,
|
|
architecture=declared_module_architecture(
|
|
layer="human_work_procedure",
|
|
kind="domain",
|
|
maturity="scaffold",
|
|
documentation_ref="docs/TICKETS_DOMAIN_BOUNDARY.md",
|
|
known_limits=("Ticket persistence, queues, SLA, and external service-desk adapters are not implemented yet.",),
|
|
owned_concepts=("ticket", "ticket queue", "ticket transition"),
|
|
non_owned_concepts=("case", "project", "external service-desk record"),
|
|
),
|
|
)
|
|
|
|
|
|
def get_manifest() -> ModuleManifest:
|
|
return manifest
|