Files
evig/scripts
Mao NakamotoandClaude Fable 5 de9db2f60d feat(zeiterfassung): Saldo ledger, monthly reminders, one-click submit — SMALL-Time retirement phase 1
The accounting layer the legacy SMALL-Time punch clock had and we lacked:

- migration 136: employment_periods (effective-dated Pensum in weekly
  minutes, seeded from contract_hours), vacation_entitlements (per
  person-year + carryover «Übertrag F»), team_profiles opening balance
  («Übertrag T») + zeiterfassung_reminder_day
- src/config/holidays.ts: Kanton-ZH public holidays SSOT (fixed +
  Easter-derived, deterministic — no yearly maintenance)
- lib/team/saldo.ts: pure Zeitsaldo engine — saldo is DERIVED, never
  typed: opening + Σ(Ist − Soll). Soll from employment periods spread
  over scheduled weekdays; holidays reduce Soll (no manual Feiertag
  rows, double-count guard); paid absences fulfil Soll, unpaid don't.
  10 tests incl. an exact reproduction of the legacy tool's −56h July
  example and a mid-year Pensum change
- lib/services/saldo.ts + GET /api/timecards/saldo (own; ?user_id= for
  approvers) — Feriensaldo defaults to 20 days pro-rated by Pensum when
  HR hasn't set an entitlement (exactly the legacy 60% → 12 Tage rule)
- SaldoStrip on /admin/zeiterfassung + compact variant on the team
  profile tab: Zeitsaldo, Feriensaldo, month Ist/Soll, plus a hint when
  the schedule template disagrees with the Pensum
- monthly reminder: pick a day (ReminderSetting), daily cron
  /api/cron/timecard-reminders nudges in-app+mail if the month is not
  submitted — verified end-to-end (approved cards correctly skipped)
- one-click «Füllen & einreichen» on an empty draft month (also the
  reminder's landing action)
- all new UI strings in 8 locales

Verified in the browser against live data: +27h36 saldo = 90h Ist vs
62h24 Soll-to-date at 24h/week, hand-checked.

Phase 2 (tracked): vacation-flow unification, monthly close snapshot +
PDF (payroll + social-worker report), HR proxy entry, opening-balance
UI, SMALL-Time cutover.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 16:07:57 +02:00
..