Erlernter Beruf und zustaendige HR im Report
All checks were successful
CI / Lint, Typen, Tests, Build (push) Successful in 11m57s
CI / Migrationen auf leerer Datenbank (push) Successful in 10m15s

- Neues freiwilliges Textfeld "Erlernter Beruf": Hiring Wizard (Person,
  Zusammenfassung), Daten aendern, Stammdaten, Wiedereintritt, Export,
  Historie. Gespeichert getrimmt, leer heisst nicht erfasst.
- Reports: Aufteilen nach "Zustaendige HR" mit Gruppe "Nicht zugeordnet"
  und Vorlage "Headcount nach zustaendiger HR".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 11:21:11 +02:00
parent 0e9d2f2296
commit e77eaf7fba
18 changed files with 314 additions and 6 deletions

View File

@@ -8,6 +8,8 @@ import {
measureValue,
MEASURE_LABELS,
messgroesseLabel,
REPORT_PRESETS,
GROUP_LABELS,
type OrgLookups,
type ReportEmployee,
type ReportEvent,
@@ -98,6 +100,33 @@ describe("groupKeyFor", () => {
expect(groupKeyFor(emp({ entry_date: "2019-06-01" }), "entry_year", lookups)).toBe("2019");
});
it("gruppiert nach dem Namen der zuständigen HR", () => {
expect(groupKeyFor(emp({ zustaendige_hr: "Test HR Eins" }), "zustaendige_hr", lookups)).toBe("Test HR Eins");
});
it("fasst Personen ohne zuständige HR als eigene Gruppe zusammen", () => {
// Wer niemandem zugeordnet ist, ist genau die Antwort, nach der man hier sucht.
expect(groupKeyFor(emp({ zustaendige_hr: null }), "zustaendige_hr", lookups)).toBe("Nicht zugeordnet");
expect(groupKeyFor(emp(), "zustaendige_hr", lookups)).toBe("Nicht zugeordnet");
});
it("bietet die zuständige HR als Gruppierung und als Vorlage an", () => {
expect(GROUP_LABELS.zustaendige_hr).toBe("Zuständige HR");
expect(REPORT_PRESETS.some((p) => p.group === "zustaendige_hr")).toBe(true);
});
it("zählt je zuständiger HR", () => {
const rows = aggregateReport(
[emp({ id: "1", zustaendige_hr: "Anna" }), emp({ id: "2", zustaendige_hr: "Anna" }), emp({ id: "3", zustaendige_hr: null })],
"headcount",
"zustaendige_hr",
null,
lookups
);
const anzahl = Object.fromEntries(rows.map((r) => [r.key, r.value]));
expect(anzahl).toMatchObject({ Anna: 2, "Nicht zugeordnet": 1 });
});
it("resolves the Rolle & Anstellung boolean dimensions as Ja/Nein", () => {
const e = emp({ is_betriebsrat: true, has_dienstwagen: false, is_laterale_fuehrung: true, is_c_level: false });
expect(groupKeyFor(e, "betriebsrat", lookups)).toBe("Ja");