feat(tickets): deliver canonical operational lifecycle

This commit is contained in:
2026-08-22 11:41:45 +02:00
parent b4bb52d8b8
commit 7cbf3bed96
25 changed files with 4742 additions and 106 deletions
+56 -19
View File
@@ -2,39 +2,76 @@ from __future__ import annotations
import unittest
from govoplan_core.core.tickets import (
CAPABILITY_TICKET_CASE_ESCALATION,
CAPABILITY_TICKET_ROUTING,
)
from govoplan_tickets.backend.dsar_provider import TICKETS_DSAR_CAPABILITY
from govoplan_tickets.backend.manifest import (
ADMIN_SCOPE,
ASSIGN_SCOPE,
READ_SCOPE,
REPORT_SCOPE,
RESOLVE_SCOPE,
TRIAGE_SCOPE,
WRITE_SCOPE,
get_manifest,
)
from govoplan_tickets.backend.service import CAPABILITY_TICKETS_REGISTRY
class ManifestSeedTests(unittest.TestCase):
def test_manifest_registers_seed_contract(self) -> None:
class ManifestTests(unittest.TestCase):
def test_manifest_registers_the_vertical_slice(self) -> None:
manifest = get_manifest()
self.assertEqual(manifest.id, "tickets")
self.assertEqual(manifest.name, "Tickets")
self.assertEqual(manifest.dependencies, ("access",))
self.assertEqual({permission.scope for permission in manifest.permissions}, {READ_SCOPE, WRITE_SCOPE, ADMIN_SCOPE})
self.assertEqual("tickets", manifest.id)
self.assertEqual("0.1.20", manifest.version)
self.assertEqual(("access",), manifest.dependencies)
self.assertEqual(
{
READ_SCOPE,
REPORT_SCOPE,
TRIAGE_SCOPE,
ASSIGN_SCOPE,
RESOLVE_SCOPE,
ADMIN_SCOPE,
WRITE_SCOPE,
},
{permission.scope for permission in manifest.permissions},
)
self.assertEqual(
{
"tickets_reporter",
"tickets_manager",
"tickets_viewer",
"tickets_administrator",
},
{role.slug for role in manifest.role_templates},
{"tickets_manager", "tickets_viewer"},
)
self.assertTrue(manifest.documentation)
topic = manifest.documentation[0]
self.assertEqual("reference", topic.metadata["kind"])
self.assertIn("seed_boundary", topic.metadata["consequence_classes"])
self.assertTrue(
all(
topic.translations.get("de", {}).get(field)
for field in ("title", "summary", "body")
self.assertIsNotNone(manifest.route_factory)
self.assertIsNotNone(manifest.migration_spec)
self.assertIsNotNone(manifest.frontend)
self.assertEqual(1, len(manifest.search_sources))
self.assertIn(CAPABILITY_TICKETS_REGISTRY, manifest.capability_factories)
self.assertIn(TICKETS_DSAR_CAPABILITY, manifest.capability_factories)
self.assertEqual(
{CAPABILITY_TICKET_ROUTING, CAPABILITY_TICKET_CASE_ESCALATION},
set(manifest.optional_capabilities),
)
self.assertEqual("vertical_slice", manifest.architecture.maturity)
def test_documentation_has_static_and_workflow_baselines_in_german(self) -> None:
topics = get_manifest().documentation
self.assertTrue(any(topic.layer == "available" for topic in topics))
self.assertTrue(any(topic.metadata.get("kind") == "workflow" for topic in topics))
for topic in topics:
self.assertTrue(
all(topic.translations.get("de", {}).get(field) for field in ("title", "summary", "body")),
topic.id,
)
)
self.assertIsNone(manifest.route_factory)
self.assertIsNone(manifest.migration_spec)
self.assertIsNone(manifest.frontend)
optional = next(topic for topic in topics if topic.id == "tickets.optional-integrations")
self.assertIn("Helpdesk", optional.body)
self.assertIn("Search", optional.body)
if __name__ == "__main__":