Übergabestand 2026-11-11

Alpenwerk HR 0.2.1

- Verwalterpasswort der Datenbank liegt verschlüsselt (DPAPI) statt im Klartext; neues Skript verwalterpasswort.ps1
- Installations- und Betriebsanleitung: Paket aus dem Release, vollständige Pfade je Ort, Verwalterpasswort Schritt für Schritt
- SV-Nummer: Ersatznummern mit Monat 13 sind gültig
- Die Gesellschaft gilt ab 01.01.1900: Einheiten und Planstellen, die schon länger bestehen, lassen sich mit ihrem tatsächlichen Beginn anlegen
This commit is contained in:
2026-11-11 14:10:03 +01:00
parent 3b72c275ad
commit 322d0f4407
23 changed files with 713 additions and 165 deletions

View File

@@ -13,6 +13,11 @@
const WEIGHTS = [3, 7, 9, 0, 5, 8, 4, 2, 1, 6] as const;
const CHECK_INDEX = 3;
// Sind für ein Geburtsdatum alle laufenden Nummern vergeben, vergibt die
// Sozialversicherung eine Ersatznummer mit dem Monat 13 im TTMMJJ-Teil. Sie ist
// eine gültige Nummer; die Prüfziffer wird wie bei jeder anderen gerechnet.
const ERSATZMONAT = 13;
export type SvnrError = "length" | "serial" | "checksum" | "date" | "birthDateMismatch";
const MESSAGES: Record<SvnrError, string> = {
@@ -105,15 +110,17 @@ export function validateSvnr(input: string, birthDate?: string | null): SvnrErro
const day = Number(n.slice(4, 6));
const month = Number(n.slice(6, 8));
if (month < 1 || month > 12 || day < 1 || day > 31) return "date";
if (month < 1 || month > ERSATZMONAT || day < 1 || day > 31) return "date";
// Without a century the tail cannot be resolved to a real date, so the
// day-of-month bound is the generous one; a supplied birthDate settles it.
if (day > [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1]) return "date";
if (month !== ERSATZMONAT && day > [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1]) return "date";
const expected = svnrCheckDigit(n);
if (expected === null || expected !== Number(n[CHECK_INDEX])) return "checksum";
if (birthDate) {
// Eine Ersatznummer trägt kein Geburtsdatum, ein Vergleich ergäbe immer
// eine Abweichung.
if (birthDate && month !== ERSATZMONAT) {
const [y, m, d] = birthDate.split("-");
if (d !== n.slice(4, 6) || m !== n.slice(6, 8) || y?.slice(-2) !== n.slice(8, 10)) return "birthDateMismatch";
}