- Aufgabe.erstellt_am für implizite 7-Tage-Fälligkeit - frist_effektiv property; ist_ueberfaellig nutzt sie - AufgabenVerknuepfung (GenericForeignKey) mit HTMX-Panel - ExternalIssue (OneToOne) mit IssueAdapter-ABC und HTMX-Panel - link_registry.py und issue_facade.py als zentrale Registries - 8 neue Tests, 76 gesamt grün Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 lines
922 B
Python
28 lines
922 B
Python
from abc import ABC, abstractmethod
|
|
|
|
|
|
class IssueAdapter(ABC):
|
|
"""
|
|
Adapter-Basisklasse. Jeder externe Issue-Tracker implementiert diese
|
|
Schnittstelle. Registrierung via ISSUE_ADAPTERS-Dict in settings.
|
|
"""
|
|
|
|
@abstractmethod
|
|
def create_issue(self, aufgabe) -> dict:
|
|
"""Legt ein Issue im externen System an. Gibt {'url', 'key'} zurück."""
|
|
|
|
@abstractmethod
|
|
def fetch_status(self, external_issue) -> str:
|
|
"""Liest den aktuellen Status aus dem externen System."""
|
|
|
|
@abstractmethod
|
|
def close_issue(self, external_issue) -> None:
|
|
"""Schließt das Issue im externen System."""
|
|
|
|
|
|
def get_adapter(system: str) -> 'IssueAdapter | None':
|
|
"""Gibt den registrierten Adapter für `system` zurück, oder None."""
|
|
from django.conf import settings
|
|
adapters = getattr(settings, 'ISSUE_ADAPTERS', {})
|
|
cls = adapters.get(system)
|
|
return cls() if cls else None
|