Lege Einstellungen je Konto mit Erbung vom Hauptnutzer an und biete die Prüfstufe für doppelte Dokumente in Mein Konto an.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
StommerandClaude Sonnet 5.5 committed 2026-10-25 09:18:17 +01:00
1 parent bee48bf4a5
commit a6dc24d8fe
11 files changed
+339 -1

No files matched your search

@@ -0,0 +1,15 @@
-- Einstellungen je Konto. Ein Mitarbeiter erbt den Wert seines Hauptnutzers und kann ihn ändern,
-- solange der Hauptnutzer die Einstellung nicht für das Team verbindlich gesetzt hat (team_mode).
-- Erlaubte Werte, Standard und Verbindlichkeit je Schlüssel stehen im Code (app/preferences.py).
-- value NULL: kein eigener Wert, es gilt die Erbung bzw. der Standard.
CREATE TABLE account_preferences (
account_id uuid NOT NULL REFERENCES auth_accounts (id) ON DELETE CASCADE,
key text NOT NULL,
value jsonb,
team_mode text NOT NULL DEFAULT 'free',
updated_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (account_id, key),
CONSTRAINT account_preferences_key_len CHECK (char_length(key) BETWEEN 1 AND 60),
CONSTRAINT account_preferences_team_mode CHECK (team_mode IN ('free', 'locked'))
);