- Drop the Praxisgruppe field from the onboarding form. Every Paliad user is in patent practice, so the field carried no signal. The DB column is retained for future use (set to NULL on insert). - Switch role from a 4-value enum (partner/associate/pa/admin) to free text with a <datalist> of suggestions (Partner, Associate, PA, Of Counsel, Referendar/in, Trainee, wiss. Mitarbeiter/in, Sekretariat). German firms have many roles beyond the original four. - Add an optional Dezernat field — the team led by a specific partner. Free text, no FK (the partner may not be registered yet). Backend: - Migration 015: drop the role enum CHECK, replace with non-empty CHECK; ADD COLUMN dezernat text. - UserService.Create: drop validRoles map, require non-empty role string, trim and persist Dezernat. Admin bootstrap gate unchanged. - models.User gains Dezernat *string; userColumns SELECT updated so /api/me returns it. Frontend: - onboarding.tsx: replace role <select> with <input list=...>; add dezernat input; remove practice_group. - onboarding.ts: send dezernat (if non-empty), require role. - i18n: add onboarding.role.placeholder, onboarding.dezernat[.placeholder], onboarding.error.role; remove the role.* enum and practice_group keys.
21 lines
815 B
SQL
21 lines
815 B
SQL
-- Phase L: open up paliad.users.role from a fixed enum to free-text and add
|
|
-- the dezernat (partner team) column.
|
|
--
|
|
-- Rationale (m, 2026-04-18): German law firms have many roles beyond the
|
|
-- four originally enumerated (Of Counsel, Referendar/in, Trainee, wiss.
|
|
-- Mitarbeiter/in, Sekretariat, ...). The CHECK constraint is replaced by a
|
|
-- non-empty guard; the bootstrap admin gate stays in the service layer.
|
|
--
|
|
-- "Dezernat" is the team led by a specific partner. It is intentionally
|
|
-- free text — we cannot FK to paliad.users because the partner may not
|
|
-- have registered yet.
|
|
|
|
ALTER TABLE paliad.users
|
|
DROP CONSTRAINT IF EXISTS users_role_check;
|
|
|
|
ALTER TABLE paliad.users
|
|
ADD CONSTRAINT users_role_check CHECK (role <> '');
|
|
|
|
ALTER TABLE paliad.users
|
|
ADD COLUMN IF NOT EXISTS dezernat text;
|