Eine Person kann mehrere Onboarding- und Offboarding-Listen haben (Tabelle
checklisten), jede mit Anlass: Eintritt, Rueckkehr, Wiedereintritt,
Austritt. Bearbeitet wird die juengste; fruehere bleiben mit ihren Haken
lesbar.
- Nach einer Rueckkehr aus einer Langzeitabwesenheit laesst sich eine neue
Onboarding-Liste anlegen.
- Wiedereintritt und jeder Austritt legen eine neue Liste an statt die alte
zu ergaenzen.
- "Checkliste abschliessen" sperrt die Liste und haelt Datum und Namen
fest; "Wieder oeffnen" hebt das auf. Beides steht im Protokoll.
- Austritt zuruecknehmen loescht nur die Liste dieses Austritts.
- Der Ausdruck zeigt die juengste Liste.
Bestand: je Person und Art wird aus den vorhandenen Punkten eine Liste.
Rauchtest: Schritt 22.
Geprueft: lint, tsc, types:check, 928 Tests, Uebergabe-Waechter
- Notfallkontakte: eigene Tabelle employee_emergency_contacts (Migration
20261019160000), beliebig viele je Person, angelegt, geaendert und
entfernt wie Angehoerige (add_/update_/delete_emergency_contact, mit
Historie und Protokoll). Bestand uebernommen. Verhaeltnis-Liste wie bei
den Angehoerigen (Ehepartner, Lebenspartner, Kind, Sonstige mit Freitext).
Neueinstellung, Wiedereintritt, Import und Mitarbeiterexport schreiben
und lesen die Tabelle.
- Planstelle beginnt nicht vor und nicht nach dem Bestehen ihrer
Organisationseinheit: Ausloeser an om_positions (Migration
20261019150000), gilt fuer Anlegen, Aendern und Klonen.
- Anstehend auf der Uebersicht: Klick oeffnet die Akte im Reiter Historie,
bei einer Wiedervorlage im Reiter HR-Notizen (?tab=).
- Uebernahme: Vertrag zeigt Besetzungsart und "Uebernahme Ja/Nein" aus der
Historie; die Kachel Eintritte (YTD) zaehlt Uebernahmen mit.
- Glocke: "Meine Notizen" schaltet bei hinzugewaehlten Kollegen auf nur
die eigenen Notizen um.
Rauchtest Schritt 18.
Geprueft: lint, tsc, types:check, 921 Tests, 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
Eine Vormerkung, an der der naechtliche Lauf scheitert (etwa weil die
Zielplanstelle entfernt wurde), liess sich nach ihrem Stichtag nicht mehr
abbrechen: sie galt nach dem Datum als wirksam, obwohl sie es nie wurde.
Migration 20261019110000 (Anker aus dem Katalog):
- app_vormerkung_offen(); delete_history_entry behandelt eine offene
Vormerkung als geplant, gleich wie alt ihr Stichtag ist - abbrechen,
nichts an den Stammdaten zuruecksetzen.
- update_history_entry weist das Berichtigen einer nie durchgefuehrten
Aenderung ab.
- Der Lauf schreibt einen Fehlschlag einmal ins Protokoll und erneut nur,
wenn sich der Grund aendert.
- transfer_employee weist eine zweite Versetzung derselben Person zum
selben Tag ab.
Oberflaeche: Historie zeigt "nicht durchgefuehrt - Vormerkung offen" mit
Papierkorb; /audit/geplant hat beim Ueberfaelligen einen Knopf zum
Abbrechen; entfernte oder besetzte Zielplanstelle steht dort und im
Protokoll in Worten. Rauchtest Schritt 13.
Geprueft: lint, tsc, types:check, 891 Tests, Waechter
Kommentare beschreiben den heutigen Stand und warum er so ist, nicht mehr
die Entwicklungsgeschichte: keine Datumsangaben zu Ereignissen, keine
Vorfaelle an Testpersonen, keine Lieferantensicht, keine internen Namen
oder Plattformen. In Migrationen nur Kommentare ausserhalb von
Dollar-Quoting; Kommentare in Funktionskoerpern nur dort, wo ihr Text in
keiner anderen Migration als Anker vorkommt.
- Andreis Anpassungen aus windows-uebergabe nach master uebernommen.
- LOLYO-Startpasswort kommt aus LOLYO_STARTPASSWORT statt aus dem Code;
ohne Wert lehnt der Export mit Hinweis ab.
- Beispiel- und erzeugte E-Mail-Adressen ohne Kundendomain.
- Content-Security-Policy wird durchgesetzt; form-action fest mit
login.microsoftonline.com, weil das Paket ohne Umgebungswerte gebaut
wird. Geprueft im Browser: alle Seiten ohne Verstoss, Weiterleitung zu
Microsoft geht durch.
- migrate.mjs: einmalige Uebernahme der alten Buchfuehrung entfernt (seit
20260907100000 ohne Wirkung).
- freischalten.ps1 vergibt und entzieht den HR-Zugang (-Entziehen) und
protokolliert beides im Audit-Log.
- docs/security-review.md -> docs/sicherheitskonzept.md: beschreibt den
heutigen Stand ohne offene Punkte. README, entra-sso.md und
deploy/windows/README.md ohne Widersprueche (Leserolle der IT,
Freischaltung, Konto des Nachtlaufs), Abnahme-Checkliste statt
"noch offen".
Geprueft: lint, tsc, types:check, 823 Unit-Tests, Waechter (412 Dateien,
keine Funde), alle 114 Migrationen auf leerem PostgreSQL 18 (zweiter Lauf
leer), rauchtest.sql und vertragsangaben.sql bestanden.
Die Akte oeffnet jetzt in rund 100 ms statt in 1,5 s:
vorher person 4ms, hauptabfrage 1554ms, nachschlag 11ms, gesamt 1569ms
nachher person 2ms, hauptabfrage 79ms, nachschlag 7ms, gesamt 87ms
Gefunden hat das der vorlaeufige console.info in dieser Datei, nicht das
Nachdenken darueber. Behoben haben es zwei Migrationen: die Policies
pruefen die Rechte einmal je Abfrage (20260924200000), und
om_reporting_lines laeuft als security definer mit require_hr_admin in
der ersten Zeile (20260924220000).
Nebenbei die Behauptung im Kopf der Datei richtiggestellt: dort standen
"rund 36 ms Umlaufzeit" als Begruendung dafuer, die Zahl der Rundreisen
zu druecken. Nachgemessen sind es 0,5 ms. Die Rundreisen waren nie das
Problem.
Die Akte braucht beim Oeffnen rund 1,5 s. Die Datenbank ist es dem
Anschein nach nicht: eine Rundreise kostet 0,5 ms (nicht 36, wie der
Kommentar hier behauptete), und om_reporting_lines misst 60 ms. Damit
laegen unter zehn Prozent der Zeit in den Abfragen.
Statt weiter zu raten -- heute schon zweimal danebengelegen -- schreibt
loadEmployeeDetail eine Zeile ins Protokoll des Containers: Zeit fuer die
Person, fuer die Hauptabfrage, fuer die Nachschlaege, insgesamt, und wie
viele Berichtslinien uebertragen wurden.
Wieder entfernen, sobald die Ursache feststeht.
Die Akte holte Vorgesetzte und direkte Berichte in zwei Teilabfragen, je
eine mit eigenem Filter -- in der Annahme, der Filter schraenke die
Funktion ein. Tut er nicht. om_reporting_lines traegt ein `with
recursive` im Koerper und laesst sich deshalb nicht einbetten; sie rechnet
jedes Mal alle Zeilen aus, und der Filter wirft sie danach weg.
Auf dem Server gemessen:
explain analyze select * from om_reporting_lines(current_date)
where employee_id = ...;
-> Rows Removed by Filter: 783, Execution Time: 69 ms
Und ohne Filter dieselben 60 ms. Zwei Filter hiessen also zweimal
dieselbe Rechnung, rund 120 ms je Aufruf der Akte -- der groesste
Einzelposten der Seite.
Jetzt ein Aufruf, und die Auswahl trifft der Aufrufer. Dafuer wandern
einmal alle Zeilen herueber statt neun; ueber eine Verbindung im selben
Netz kostet das den Bruchteil dessen, was die zweite Rechnung kostete.
Der Kommentar, der das Gegenteil behauptete, ist durch die Messung
ersetzt.
The offboarding list was a checkbox fieldset inside the exit panel — four
items, never sent anywhere. Nothing in terminateEmployee's payload
carried them; ticking a box there recorded exactly nothing.
It's replaced with the same kind of list the entries got: its own tab,
appearing the moment an exit is recorded, with one item per row, a
comment on each, and — unlike the fieldset — a record of who touched it
and when.
The eleven items come from the same printed sheet as the entry list.
Nine are plain checkboxes. Two are text fields under "Vermerke":
remaining vacation and the balance transferred for payout — the sheet
names "Überleitung Salden für Auszahlung" twice, once as a task to do
and once as the actual figure, and those are genuinely two different
questions, kept as two items. Where the sheet still says "GKK" rather
than today's "ÖGK", it's left as written — that's the name the process
runs under internally, not a typo.
No Show gets no list. Never having worked a single day, there's no IT
access to revoke, no GKK registration to undo, no Dienstzettel to
collect — an empty checklist there would be a label with nothing behind
it. Both the tab and the auto-creation on exit check for this
specifically, not just the "Ausgetreten" status that No Show shares with
a real exit. Rehiring the same person hides the tab again — the data
stays, since it happened, but a checklist for someone currently working
has nothing to point at.
The engine (what counts as done, how progress is computed) moved into
lib/checklist.ts so onboarding and offboarding can't drift into two
different ideas of "done" the way two independent copies eventually do;
lib/onboarding.ts and lib/offboarding.ts bind it to their own item list,
and the tab UI is a single ChecklistPanel bound the same way.
Checked against the real database: a real exit creates all eleven items
in the same transaction as the exit itself; a No Show creates none;
rehiring flips the tab off while the old answers stay queryable. One
false alarm during that check turned out to be the user's own clicks on
a real employee's onboarding list, made in the browser while trying the
earlier feature — left untouched, not test debris.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The list existed on paper: one printed sheet per entry, twenty-five
boxes. What is on it is known only to whoever holds the sheet — it
cannot be searched, cannot be covered for while someone is away, and
says nothing about who ticked what.
Not every box on the sheet is a checkbox, and the differences carry
meaning, so the field kind is derived from the thing rather than
flattened:
Haken — the normal case. The Meldezettel is there or it is not.
Ja/Nein — Prämienanspruch had *two* boxes on the sheet, and that is
not decoration: "nein" is a finding, "not asked yet" is not.
One checkbox cannot say both.
Text — shoe, shirt and trouser size. The value is the point;
ticked off it would be worthless.
Every item takes a comment, and every item records who last touched it
and when — the part the sheet could never do.
Saved on click, not on submit. A checklist is worked through over days,
between other things; a save button at the end is where half a morning
goes missing.
The items live in lib/onboarding.ts, not in a table: a checklist is a
company process, not a master record. Stored per person is only the
answer, under the item's key — so an item dropped later leaves its old
answers standing instead of taking them along, and a file from back then
stays readable.
A list is created by hire and rehire, in the same transaction as the
hire itself: a hire without a checklist would be a half-recorded hire.
Rehire only adds what is missing and never clears an old tick — what
genuinely has to be redone is HR's call, and a program deciding it would
be guessing. People hired before this feature have no list and get a
button to start one.
Checked against the real database end to end: hire creates 25 open
items; checkbox, ja/nein, size and comment all land; a comment-only edit
leaves the tick alone; rehire tops the list up and keeps what was done.
The probe employee was removed afterwards — audit rows first, since the
log has no delete policy.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was none anywhere in the model, so no personnel-cost figure could
be produced at all, and an open position could not say whose budget it
would charge — which is the first question asked about a vacancy.
It hangs on the position, not on the person: the seat costs money even
when nobody sits on it. That is exactly the vacancy case. And not on the
org unit either, although it usually follows from one — a single seat
can be charged elsewhere (project, shared function) without the unit
moving.
As its own dated assignment table rather than a column, because
reassigning is an event with a date. Last year's costs have to stay
where they were incurred; as a column, every change would silently
rewrite every past report. Half-open [valid_from, valid_to), like
position_assignments and om_positions — in SAP OM this is A011.
25 cost centres seeded from the org tree: one per company, division and
department, with teams charging to their department, because a team is a
span of control and not a budget. All 823 positions were assigned from
their own start date, none left over. The number is the first five digits
of the org number, so it can be traced rather than looked up.
Reassignment refuses three things, each checked: the same cost centre
again, a switch on the day the current one started (that period would
never have been in force, and the range constraint says so), and a date
before the position exists.
Verified against the real data, which turned up a defect worth keeping:
a position that starts in the future is charged only from its start, so
asked about today it had no cost centre — and future positions are
exactly what the vacancy list is for. It is now read at the position's
own start date.
Two audit entries from the probe could not be deleted through the
application (the log has no delete policy — correctly), so I removed
them with the admin connection.
Still open, and the reason this is only the first of the three fields I
proposed: location and planned FTE.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The app got slower as pages grew, and the reason was not the queries. It
was their number.
A transaction is pinned to one connection, and a connection runs queries
one after another. Every Promise.all in a withUser block looked like
concurrency and was a queue. Measured against the real database: the
round trip is ~36 ms, ten trivial `select 1` over one connection take
343 ms, over ten connections 39 ms. Nothing here is slow — the whole
dashboard payload is under 200 kB, and every table is around a thousand
rows.
More connections is the wrong answer: the RLS session context is per
transaction, so parallel reads mean parallel transactions, and those
multiply the connections the database will grant. Fewer round trips
instead. Postgres will return each sub-select as its own JSON column of
one result.
Per page view, counting the transaction frame:
shell (paid by every page) 10 → 4
overview 14 → 5
employee file 14 → 7
employee list 8 → 6
The overview plus its shell went from 24 round trips to 9 — about 860 ms
of pure waiting down to about 320 ms.
The one trap is documented where it bites: inside json_agg, Postgres
formats values itself and the driver's parsers (lib/db/pool.ts) never
see them. Dates, numerics and uuids come out identical; timestamptz does
not — "+00:00" where the driver gives "…Z". Timestamps are compared as
strings in lib/history.ts to decide what happened later, and those two
forms sort against each other wrongly. Every timestamptz in a bundled
query therefore goes through zeitstempel(), which was checked
character-for-character against the driver.
Four loaders moved out of their pages into lib/ so the number of round
trips can be measured without building a React tree, and so the new path
could be held against the old one field by field: same rows, same order,
same strings, for the overview and for four employee files chosen to
differ (with history, a chief, a planned entry, one with dependents).
withUser now counts the queries in each transaction and says so in
development past a threshold. Without that, this grows back: each new
tile brings its own query, and nobody notices until everybody does.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>