Make the part-time arrangement a state you can report on
Last step moved the four part-time arrangements out of the absence list and recorded the reason in the history text. That answered "what happened" but not "who is in one right now", and the profile showed nothing at all. So it becomes a real field: teilzeit_art, with an optional end date. The objection I raised then still holds — a state goes stale, because nobody goes back to note when a Bildungsteilzeit ended. teilzeit_bis is the answer to it: with an end date a report decides for itself what is still running instead of trusting that someone maintained the row. Left empty it means "open end", which is an honest thing to say. It runs through the ordinary change machinery rather than beside it. It sits in app_feld_karte, so it shows up in the history as a field with before and after, and can be corrected there like any other. The description suffix from last step is gone — writing the same thing twice is how two versions start disagreeing. Reporting: filter by variant, by "in one at all", and by when it ends; group headcount by variant, where the absence of one reads "Keine" rather than a dash, because in a report that is an answer and not a gap. Plus columns in the export and the import. One gap found while rehearsing, and only because the probe happened to pick a return date in the future: a scheduled return carries its payload through pending_org_changes, and that payload did not include the variant. Someone would have come back on reduced hours in April with the reason gone. The daily run now carries it too. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,8 @@ function mitarbeiter(teil: Partial<EmployeeRow> = {}): EmployeeRow {
|
||||
dienstwagen_art: null,
|
||||
has_kuendigungsschutz: false,
|
||||
kuendigungsschutz_bis: null,
|
||||
teilzeit_art: null,
|
||||
teilzeit_bis: null,
|
||||
is_laterale_fuehrung: false,
|
||||
is_c_level: false,
|
||||
title_prefix: [],
|
||||
|
||||
@@ -52,6 +52,8 @@ function mitarbeiter(teil: Partial<EmployeeRow> = {}): EmployeeRow {
|
||||
dienstwagen_art: null,
|
||||
has_kuendigungsschutz: false,
|
||||
kuendigungsschutz_bis: null,
|
||||
teilzeit_art: null,
|
||||
teilzeit_bis: null,
|
||||
is_laterale_fuehrung: false,
|
||||
is_c_level: false,
|
||||
title_prefix: [],
|
||||
@@ -123,3 +125,23 @@ describe("VertragTab — Kündigungsschutz", () => {
|
||||
expect(wertZu("Besonderer Kündigungsschutz")).toBe("Nein");
|
||||
});
|
||||
});
|
||||
|
||||
// Die Teilzeitvarianten sind keine Abwesenheiten, sondern ein Zustand mit
|
||||
// weniger Stunden. Damit darüber berichtet werden kann, steht die Variante an
|
||||
// der Person — und dann muss sie auch am Profil zu sehen sein.
|
||||
describe("VertragTab — Teilzeitvariante", () => {
|
||||
it("nennt Variante und Ende", () => {
|
||||
render(<VertragTab employee={mitarbeiter({ teilzeit_art: "Bildungsteilzeit", teilzeit_bis: "2027-06-30" })} />);
|
||||
expect(wertZu("Teilzeitvariante")).toBe("Bildungsteilzeit bis 30.06.2027");
|
||||
});
|
||||
|
||||
it("sagt es auch, wenn das Ende offen ist", () => {
|
||||
render(<VertragTab employee={mitarbeiter({ teilzeit_art: "Elternteilzeit", teilzeit_bis: null })} />);
|
||||
expect(wertZu("Teilzeitvariante")).toBe("Elternteilzeit (Ende offen)");
|
||||
});
|
||||
|
||||
it("bleibt leer, wo keine besteht", () => {
|
||||
render(<VertragTab employee={mitarbeiter()} />);
|
||||
expect(wertZu("Teilzeitvariante")).toBe("–");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -37,6 +37,7 @@ function emp(overrides: Partial<ReportEmployee> = {}): ReportEmployee {
|
||||
has_dienstwagen: false,
|
||||
is_laterale_fuehrung: false,
|
||||
is_c_level: false,
|
||||
teilzeit_art: null,
|
||||
dependents_count: 0,
|
||||
...overrides,
|
||||
};
|
||||
@@ -310,3 +311,18 @@ describe("aggregateEvents", () => {
|
||||
expect(produktion.people[0]).toMatchObject({ id: "1", title: "Eintritt als Maschinenbediener:in", entry_date: "2026-03-01" });
|
||||
});
|
||||
});
|
||||
|
||||
// Auswertbar sein war der Zweck: „wer ist gerade in Bildungsteilzeit" liess
|
||||
// sich vorher nicht beantworten, weil die Variante nur im Text der Historie
|
||||
// stand.
|
||||
describe("Gruppierung nach Teilzeitvariante", () => {
|
||||
it("gruppiert nach der Variante", () => {
|
||||
expect(groupKeyFor(emp({ teilzeit_art: "Bildungsteilzeit" }), "teilzeit_art", lookups)).toBe("Bildungsteilzeit");
|
||||
expect(groupKeyFor(emp({ teilzeit_art: "Elternteilzeit" }), "teilzeit_art", lookups)).toBe("Elternteilzeit");
|
||||
});
|
||||
|
||||
it("nennt das Fehlen „Keine“ statt eines Gedankenstrichs", () => {
|
||||
// In einer Auswertung ist „keine Teilzeit" eine Aussage, kein Fehlen.
|
||||
expect(groupKeyFor(emp({ teilzeit_art: null }), "teilzeit_art", lookups)).toBe("Keine");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user