Add "truly done" ticket archiving with auto-unhide
- Let the user mark closed tickets as really done and hide them, so tickets closed prematurely by an agent stay visible until confirmed - User-side "archived" flag stored in the DB (independent of Zammad), added via a schema migration on existing databases - Hide archived tickets from the overview by default with an "erledigte einblenden" toggle; archive/unarchive from the ticket detail page and via a per-row quick action - Poller automatically un-hides an archived ticket when new activity is detected, so nothing is missed Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,8 @@ CREATE TABLE IF NOT EXISTS tickets (
|
||||
last_close_at TEXT,
|
||||
raw_json TEXT,
|
||||
first_seen_at TEXT,
|
||||
last_synced_at TEXT
|
||||
last_synced_at TEXT,
|
||||
archived INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS changes (
|
||||
@@ -103,3 +104,11 @@ def get_conn():
|
||||
def init_db() -> None:
|
||||
with get_conn() as conn:
|
||||
conn.executescript(SCHEMA)
|
||||
_migrate(conn)
|
||||
|
||||
|
||||
def _migrate(conn) -> None:
|
||||
"""Nachträgliche Schema-Anpassungen für bestehende Datenbanken."""
|
||||
cols = {r["name"] for r in conn.execute("PRAGMA table_info(tickets)")}
|
||||
if "archived" not in cols:
|
||||
conn.execute("ALTER TABLE tickets ADD COLUMN archived INTEGER NOT NULL DEFAULT 0")
|
||||
|
||||
Reference in New Issue
Block a user