AP1.10a: Initiative-Standardfelder vision, Zielzustand und Archetyp-Schlüssel.
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 1m51s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 1m51s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
Migration 016, Archetyp-Registry-API, erweitertes Profil-Modal und Plan-Profil-Ansicht. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
495993cad6
commit
408050bcb8
14 files changed
+342
-40
No files matched your search
@@ -0,0 +1,13 @@
|
||||
from entity_archetypes.registry import (
|
||||
INITIATIVE_ARCHETYPES,
|
||||
archetype_label,
|
||||
list_archetypes,
|
||||
validate_archetype_key,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"INITIATIVE_ARCHETYPES",
|
||||
"archetype_label",
|
||||
"list_archetypes",
|
||||
"validate_archetype_key",
|
||||
]
|
||||
@@ -0,0 +1,49 @@
|
||||
"""System-Archetypen (AP1.10a) — Seed-Daten bis EFS-Tabellen (10b)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
INITIATIVE_ARCHETYPES: tuple[dict[str, Any], ...] = (
|
||||
{
|
||||
"key": "initiative.generic",
|
||||
"entity_type": "initiative",
|
||||
"label": "Allgemeines Vorhaben",
|
||||
"description": "Standard-Vorhaben ohne spezielle Vorlage.",
|
||||
"is_system": True,
|
||||
},
|
||||
{
|
||||
"key": "initiative.program",
|
||||
"entity_type": "initiative",
|
||||
"label": "Programm / Mega-Vorhaben",
|
||||
"description": "Mehrere Stränge, Zielzustand und Vision zentral.",
|
||||
"is_system": True,
|
||||
},
|
||||
{
|
||||
"key": "initiative.product",
|
||||
"entity_type": "initiative",
|
||||
"label": "Produkt / Release",
|
||||
"description": "Produkt- oder Release-orientiertes Vorhaben.",
|
||||
"is_system": True,
|
||||
},
|
||||
)
|
||||
|
||||
_ARCHETYPE_INDEX = {
|
||||
(item["entity_type"], item["key"]): item for item in INITIATIVE_ARCHETYPES
|
||||
}
|
||||
|
||||
|
||||
def list_archetypes(*, entity_type: Optional[str] = None) -> list[dict[str, Any]]:
|
||||
if entity_type is None:
|
||||
return [dict(item) for item in INITIATIVE_ARCHETYPES]
|
||||
return [dict(item) for item in INITIATIVE_ARCHETYPES if item["entity_type"] == entity_type]
|
||||
|
||||
|
||||
def validate_archetype_key(*, entity_type: str, archetype_key: str) -> None:
|
||||
if (entity_type, archetype_key) not in _ARCHETYPE_INDEX:
|
||||
raise ValueError(f"Unbekannter Archetyp: {archetype_key}")
|
||||
|
||||
|
||||
def archetype_label(*, entity_type: str, archetype_key: str) -> Optional[str]:
|
||||
item = _ARCHETYPE_INDEX.get((entity_type, archetype_key))
|
||||
return item["label"] if item else None
|
||||
Reference in new issue
Block a user