Staatsbuergerschaft: die Spalte war Pflicht mit Vorgabe "Oesterreich",
hire_employee setzte sie ohne Angabe ein. Ein leeres Feld stand damit als
Angabe in der Akte. 20261105130000 macht sie freiwillig ohne Vorgabe;
hire, rehire, change_employee_data und der naechtliche Lauf nehmen die
leere Zeichenkette als null (case when ? then nullif). Bestehende Zeilen
bleiben. Die Uebernahme schickt das Feld auch leer und raeumt so die
Vorgabe der externen Person weg.
Neueinstellung: Geschlecht und Staatsbuergerschaft stehen leer,
Geschlecht ist Pflicht mit "Bitte waehlen".
Geburtsdatum in der Zukunft: auch bei Angehoerigen (Assistent und Akte)
und in "Eintrag berichtigen" abgewiesen.
"Uebernahme Leiharbeitskraft": nur noch im Assistenten "Uebernahme". Aus
Neueinstellung und Wiedereintritt entfernt; in "Daten aendern" nur bei
Personen, die das Kennzeichen tragen, zum Berichtigen.
Geprueft: lint, tsc, types:check, npm test (1075), waechter; alle
Migrationen auf leerer Datenbank, zweiter Lauf "Nichts anzuwenden";
rauchtest.sql und vertragsangaben.sql bestanden. Nicht im Browser geprueft.
Angehoerige lassen sich ohne Geburtsdatum erfassen; es wird nachgetragen,
sobald es vorliegt. Die Spalte ist nicht mehr NOT NULL. Anlegen, Berichtigen
und das vorgemerkte Anlegen im Nachtlauf wandeln ein leeres Feld in null
statt in ein Datum, Berichtigen kann ein erfasstes Datum wieder leeren.
Einstellungsassistent, Akte und Import verlangen das Feld nicht mehr.
Geprueft: lint, tsc, types:check, 946 Tests, Waechter; alle Migrationen auf
leerer Datenbank, zweiter Lauf ohne Befund; Rauchtest; Anlegen, Leeren und
Nachtlauf ohne Geburtsdatum als alpenwerk_app.
- Uebersicht/Anstehend: die Arten lassen sich mehrfach waehlen; ein Klick
auf eine gewaehlte nimmt sie heraus, keine oder alle heisst alle.
- Angehoerige: unter "Sonstige" ein Freifeld wie beim Notfallkontakt
(VerhaeltnisField). Die Bedingung mit vier festen Werten entfaellt.
- Eintrag berichtigen: Ja/Nein-Felder und Aufzaehlungen (Dienstwagen,
Geschlecht, Beschaeftigungsausmass, Vertragsart, Besetzungsart,
Beschaeftigtengruppe, Antrieb, Teilzeitvariante) als Auswahl mit dem
gespeicherten Wert; Datumsfelder als Datumsfeld.
- Eine noch nicht wirksame Langzeitabwesenheit und ihre geplante Rueckkehr
lassen sich berichtigen (Beginn, Art, Rueckkehr, Geburtstermine). Bisher
verwies die Meldung auf einen Weg, den es nicht gab.
Rauchtest: Schritt 24.
Geprueft: lint, tsc, types:check, 935 Tests, Uebergabe-Waechter
- Statuschip: bei Ausgetretenen das Austrittsdatum in Klammern (Liste und
Akte).
- "Beguenstigt behindert" steht auf derselben Ebene wie der besondere
Kuendigungsschutz und gilt auch ohne ihn; nennt der Personenkreis die
Beguenstigung, ist das Kaestchen angehakt und gesperrt.
- Personenkreis "Schwangerschaft" heisst in Anzeige und Export
"Mutterschutz"; gespeichert bleibt der Wert. lib/ohne-gendern.ts wird
dafuer zu lib/anzeige.ts (anzeige, anzeigeAuswahl).
- Geplante Versetzung und Befoerderung lassen sich aendern: Stift in der
Historie oeffnet Versetzen bzw. Befoerdern vorbelegt (Datum, Planstelle,
Bezeichnung, Hay-Grade). Gespeichert wird als Abbrechen und neu Erfassen
in einer Transaktion (geplantenVorgangErsetzen), damit dieselben
Pruefungen gelten wie bei einer neuen; scheitert eine, bleibt die alte
Vormerkung stehen. Ohne Migration.
Geprueft: lint, tsc, types:check, 904 Tests, Waechter
Fachlich vorgegeben: nicht gendern, auch in den Exporten. Gespeichert
bleibt der Wert der Datenbank ("Angestellte:r", "Arbeiter:in",
"Praktikant:in", "Ehepartner:in", "Lebenspartner:in") - er steht in
Aufzaehlungstypen, Pruefbedingungen, der Historie und der Sicht fuer die
IT. Uebersetzt wird nur die Anzeige.
lib/ohne-gendern.ts: eine Regel ueber den Text (":innen", ":in", "e:r",
"e:n"), damit auch Texte aus der Datenbank wie "Angehoerige:r
hinzugefuegt" und Feldnamen der Historie ohne Gendern erscheinen.
Auswahllisten senden weiter den gespeicherten Wert.
Angewendet in Formularen, Historie, Protokoll, Berichten und Filtern,
Mitarbeiter- und Ereignisexport, Importvorlage; der Import nimmt beide
Schreibweisen an. Feste Texte (Menue, Liste, Notizen, Anmeldung)
direkt umformuliert.
Geprueft: lint, tsc, types:check, 885 Tests, Waechter
Die Nummer wird einmal vergeben und nicht umgeschrieben, wenn das
Geburtsdatum spaeter berichtigt wird. Personen, deren Nummer ein anderes
Datum traegt als der Stammsatz, muessen sich erfassen lassen.
- lib/svnr.ts: svnrHaeltAuf trennt die Eigenschaften der Nummer (Laenge,
laufende Nummer, Datum, Pruefziffer) von der Uebereinstimmung mit dem
Stammsatz; svnrErfassbar sperrt "Weiter"/"Speichern" nur noch bei den
ersten. begrenzeSvnr laesst hoechstens zehn Ziffern zu.
- SvNummerField: die Abweichung steht als Hinweis unter dem Feld, eine
elfte Ziffer wird verworfen. Bei Einstellung und Wiedereintritt ein
Haken "Nicht verfuegbar": leert und sperrt das Feld, steht nur im
Entwurf.
- Angehoerige im Assistenten und im Dialog der Akte: dieselbe Regel,
dieselbe Begrenzung.
- Migration 20261015100000: fn_validate_employee_svnr prueft nur noch die
Nummer (is_valid_svnr ohne Geburtsdatum). Ohne sie haette die Datenbank
abgewiesen, was das Formular zulaesst. Selbstpruefung: kein Vergleich
mit new.birth_date, Pruefziffer wird weiter geprueft, Trigger vorhanden.
Geprueft: lint, tsc, types:check, 850 Tests (neu: SvNummerField,
svnrHaeltAuf, begrenzeSvnr), Waechter. Die Migration laeuft in der CI auf
leerer Datenbank.
Ein <input type="date"> ohne max nimmt Jahreszahlen bis 275760 an. Jedes
Datumsfeld laeuft jetzt ueber DateField:
- min 1900-01-01 und max 2099-12-31 als Vorgabe; mit vierstelligem max
begrenzt der Browser das Jahressegment schon beim Tippen. Eigene
Schranken des Aufrufers gehen vor.
- Eine Jahreszahl mit mehr als vier Stellen wird nie gemeldet: das
Formular behaelt seinen letzten gueltigen Stand, das Feld zeigt
"Die Jahreszahl hat vier Stellen." Der Tippstand bleibt im Bauteil,
sonst zeigte das Feld etwas anderes, als das Formular enthaelt.
- 34 Aufrufstellen von TextField type="date" auf DateField umgestellt;
der Stichtag im Organigramm (ein blankes input) bekommt dieselben
Schranken.
Geprueft: lint, tsc, types:check, 825 Tests (zwei neue fuer DateField),
Waechter.
Angehoerige liessen sich bisher nur anlegen und entfernen. Ein Tippfehler
im Namen war nur zu beheben, indem man die Person loeschte und neu
anlegte -- zwei Eintraege in der Akte fuer eine Korrektur, und der erste
sagte "entfernt", was nicht stimmte. Jetzt steht in jeder Zeile ein Stift,
wie beim Notfallkontakt.
update_employee_dependent kommt bewusst **ohne** Stichtag. Hinzufuegen und
Entfernen tragen einen, dort passiert etwas zu einem Zeitpunkt. Eine
Berichtigung nicht: der Wert war schon vorher falsch, und ein "wirksam ab"
hiesse, die Person habe bis dahin anders geheissen. Der Eintrag in der
Akte nennt deshalb Vorher und Nachher statt eines Datums.
In "Daten aendern" standen fuer den Notfallkontakt drei Eingabefelder,
waehrend die Angehoerigen darueber als Tabelle mit Knoepfen erscheinen --
zwei Bauformen fuer denselben Zweck, direkt untereinander. Dort steht
jetzt derselbe Abschnitt wie im Reiter "Stammdaten"; beide laufen ueber
das "Wirksam ab" des Formulars, wie die Angehoerigen es schon taten.
Damit schreibt auch nur noch eine Stelle diese drei Spalten. Vorher
schickte das Formular sie zusaetzlich im eigenen Aufruf mit.
The database moved to a container of our own; the platform is gone.
This takes out what was left of it — and, where the leftovers were load
bearing, moves rather than deletes.
Moved, not deleted:
supabase/migrations/ -> db/migrations/ the schema's source of truth
supabase/build-org.ts -> scripts/build-org.ts
lib/supabase/types.ts -> lib/types.ts 52 import sites repointed
The bookkeeping needed care. It lived in `supabase_migrations.schema_migrations`,
and simply renaming the schema would have left the runner facing an empty
table: it would have called all 67 migrations pending and replayed them
against a database that is long since current. So the runner now creates
`migrationen.schema_migrations` and, once, copies the old rows across —
guarded so a second run does nothing and a fresh database skips it entirely.
Only then does migration 20260907100000 drop the old schema.
Deleted: the CLI config, the seed, the historical schema/function dumps
(nothing read them), scripts/umzug-von-supabase.sh (the move is done), and
both Supabase packages plus the CLI. Nothing in the application imported
them — the build now succeeds with no environment variables at all, which
is the proof.
Integration tests: six of them signed in through Supabase Auth and asserted
against the anon key and the service role. That model is gone, so the tests
were not portable — they are deleted. session-context and
employee-status-filter already ran on pg and are untouched; om-reporting is
ported to a direct connection because it guards a real risk (the reporting
line rule exists twice, once in SQL and once in TypeScript).
CI: the integration job started a Supabase stack. It now runs a postgres
service, applies deploy/db-init and every migration to an empty database —
that was the valuable part, and it still holds — then checks that a second
run is a no-op, which is what proves the bookkeeping works.
Docs: security-review.md audited a service-role key, a cookie adapter and
auth.users, none of which exist. Restating findings about removed components
would suggest today's system had been reviewed; it has not. It now records
what was removed and says a fresh review is due. data-model.md was already
marked obsolete and described the pre-OM schema; azure-migration.md was a
plan for a route not taken. Both deleted.
Verified: npm ci, typecheck, lint, 445 tests, build — all clean without the
packages. Integration tests skip cleanly with no database. Migration SQL and
the runner are reviewed but NOT executed: no Docker here, and the old
instance no longer resolves.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Accessibility work on the UI layer, all of it rooted in one structural gap:
there were no form primitives, so every field was hand-assembled and every
field got the same details wrong.
Form primitives
- components/ui/Field.tsx (Field/TextField/SelectField/TextareaField) and
Button.tsx. Field generates the control id with useId and derives htmlFor
from it, which is what makes the association impossible to omit rather
than merely conventional.
- 92 labels existed, 4 used htmlFor, and no input carried an id at all: a
screen reader announced an unnamed edit box and clicking a label focused
nothing. Now every label resolves to its control (0 unassociated), and the
input class chain that appeared verbatim 85 times appears zero times.
- Field also takes a render prop, so Lookup, CountryPicker and Picklist get
the same wiring instead of a second, partial solution.
- SearchInput replaces three hand-rolled copies of the icon-in-a-box search
whose input had only a placeholder — not a label — and killed its own
focus ring with outline-none and nothing in its place.
- Toggle groups (workdays, reorg change type) became fieldsets with
aria-pressed; colour alone was carrying the selected state.
Comboboxes
- Lookup and CountryPicker were text inputs with a div of clickable buttons
underneath: typeable, but no keyboard path to a result and nothing telling
a screen reader a list had appeared. Both now carry role=combobox,
aria-expanded/controls/activedescendant and listbox semantics, with arrow
keys, Enter and Escape. Escape stops propagation, or it would close the
surrounding dialog along with the dropdown.
Dialogs
- useDialogFocus centralises what Modal and SlideOver each owed the
keyboard and neither provided beyond Escape: focus into the dialog on
open, Tab and Shift+Tab cycling within it, focus restored to the trigger
on close.
- SlideOver stays mounted for its transition, and aria-hidden does not
remove anything from the tab order — so every closed panel was leaving
invisible tab stops at the end of the page. `inert` fixes that.
Route states
- loading.tsx, error.tsx, not-found.tsx and global-error.tsx. Every page in
the (app) group is server-rendered per request, so without loading.tsx a
navigation showed nothing at all until the server answered, and a render
error dropped the user on Next's own screen with no way back.
Tests
- 22 component tests (vitest jsdom project). Two of them found limits of the
environment rather than of the code: jsdom implements neither `inert` nor
scrollIntoView, so the inert test asserts the attribute and the missing
scrollIntoView — which was taking the whole render down from inside an
effect — is stubbed in the setup file.
Data model
- employee_assignments records org placement over time (valid_from/valid_to),
written by a trigger on `employees` rather than inside each RPC: ~70
`update employees` statements spread over fifteen migrations mean per-call
bookkeeping would miss paths today and again with every future RPC. A
partial unique index enforces the one-open-interval invariant the trigger
relies on when closing the current row.
- The Organigramm gains a Stichtag (default today). Membership comes from
entry/exit/karenz, past placement from the new history, future placement
projected from pending_org_changes. Placements predating the migration are
backfilled with today's values and flagged as such in the UI, since
employee_history only ever stored free text and cannot be reconstructed.
Correctness
- Reports and exports silently truncated at PostgREST's 1000-row cap
(db.max_rows); employee_history is already past it at ~800 staff. Every
whole-table read now pages explicitly.
- XLSX date cells were a day early: ExcelJS converts a Date to an Excel
serial straight off getTime(), so a Date built at local midnight lands on
the previous day's serial in any positive-offset zone.
- Date handling is pinned to Europe/Vienna throughout, and date-only strings
are formatted without a Date round-trip. The dashboard's YTD window was
built by round-tripping a local Date through toISOString(), which shifted
it a day early and dropped 31 December entirely.
- Export routes parsed measure/group/split/eventType with unchecked `as`
casts, so an unknown value reached column headers as `undefined` and the
Content-Disposition filename. Parsed against the label maps now, with the
filename slugged as a backstop.
- toXlsx keyed columns by header text, silently dropping the second of any
two columns sharing a name — split columns take their header from data.
- The org chart tree walks had no cycle guard; nothing in the schema forbids
a manager_id cycle, and one would hang the tab rather than misreport.
- The login page reflected ?error= verbatim, letting anyone put arbitrary
text on the real sign-in screen; messages are looked up by code now.
- React Flow needs elementsSelectable on, or it sets pointer-events:none on
the whole node and the expand control stops responding.
UI
- Mobile: the shell was unusable below lg — a fixed 236px margin pushed
content off-screen with no mobile navigation at all. The sidebar is now a
drawer, dvh replaces vh, safe-area insets are honoured, inputs are 16px so
iOS stops zooming on focus, and form grids stack.
- Org chart nodes redesigned: per-kind accent stripes and icons, vacant
roles called out, expand control moved to the bottom edge carrying the
child count.
- Pagination is windowed; it previously rendered one link per page (54 for
the employee list, unbounded for the audit log).
- Positions page reduced to open positions with a single "Besetzen" action.
- The employee Organisation tab links into the org chart focused on that
person, reusing the chart's existing search-match highlighting.
Also included, uncommitted until now
- Dependants, HR notes, academic titles, split address fields, position
validity and role/employment fields, with their migrations and UI.
- Docker/compose deployment setup, data-model and security-review docs.