Flag people who cannot simply be dismissed
Works council members, expectant mothers, parents on leave, registered disabled employees, apprentices — each has its own rules that come before a dismissal. The tool does not judge whether one is lawful, but it must not stay quiet about it either, and looking it up on the contract tab is exactly the step that gets skipped under time pressure. So: a checkbox, an optional end date, and a red warning at the top of the termination panel naming the date — or saying plainly that no end was recorded. It shows for a no-show too; the protection runs from the start of the contract, not the first day worked. The date is optional on purpose. A works council mandate has a known end, a pregnancy does not, and a mandatory field would force an invented number. A constraint says only what cannot be: an end date without the flag, which would be a leftover nobody could interpret. The field goes the whole way through — hire, data change, contract sheet, export, report criteria (as a yes/no and as a date range), and the import. A field that exists in one screen and not the next is how people stop trusting the numbers. Terminating is now offered for planned entries as well, labelled "Nicht angetreten", with No Show preselected. Without it a person who never turned up stayed a planned entry forever, since nothing else can end one. One finding worth recording: tsc has been reporting success on a broken program. A generated file under .next got corrupted when a build ran against a live dev server, and its syntax errors suppressed semantic checking everywhere else — two genuine type errors in this change went unreported until I typechecked with .next excluded. The file is removed and the ordinary typecheck is meaningful again. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,8 @@ function mitarbeiter(teil: Partial<EmployeeRow> = {}): EmployeeRow {
|
||||
is_betriebsrat: false,
|
||||
has_dienstwagen: false,
|
||||
dienstwagen_art: null,
|
||||
has_kuendigungsschutz: false,
|
||||
kuendigungsschutz_bis: null,
|
||||
is_laterale_fuehrung: false,
|
||||
is_c_level: false,
|
||||
title_prefix: [],
|
||||
@@ -85,7 +87,7 @@ describe("TerminatePanel — Nichtantritt", () => {
|
||||
});
|
||||
|
||||
it("lässt das Datum bei einem gewöhnlichen Austritt frei", () => {
|
||||
zeige();
|
||||
zeige({ status: "Aktiv" });
|
||||
const feld = screen.getByLabelText(/Austrittsdatum/);
|
||||
expect(feld).toBeEnabled();
|
||||
expect(feld).toHaveValue("");
|
||||
@@ -104,7 +106,7 @@ describe("TerminatePanel — Nichtantritt", () => {
|
||||
it("schickt den Eintrittstag, auch wenn vorher ein anderes Datum dastand", async () => {
|
||||
const user = userEvent.setup();
|
||||
const { terminateEmployee } = await import("@/actions/employees");
|
||||
zeige();
|
||||
zeige({ status: "Aktiv" });
|
||||
|
||||
// Erst ein Datum eintippen, dann auf No Show wechseln.
|
||||
await user.type(screen.getByLabelText(/Austrittsdatum/), "2026-12-31");
|
||||
@@ -118,7 +120,7 @@ describe("TerminatePanel — Nichtantritt", () => {
|
||||
|
||||
it("blendet die Offboarding-Checkliste aus — ausgegeben wurde nie etwas", async () => {
|
||||
const user = userEvent.setup();
|
||||
zeige();
|
||||
zeige({ status: "Aktiv" });
|
||||
expect(screen.getByText("Offboarding-Checkliste")).toBeVisible();
|
||||
await user.selectOptions(screen.getByLabelText("Beendigungsart"), "No Show");
|
||||
expect(screen.getByText("Offboarding-Checkliste")).not.toBeVisible();
|
||||
@@ -131,3 +133,45 @@ describe("TerminatePanel — Nichtantritt", () => {
|
||||
expect(screen.getByText(/Planstelle wird wieder frei/)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
// Besonderer Kündigungsschutz: Betriebsrat, Mutterschutz, Karenz, begünstigte
|
||||
// Behinderung, Lehre. Die Anwendung entscheidet nicht, ob eine Beendigung
|
||||
// zulässig ist — sie darf es aber auch nicht verschweigen. Im Vertragsblatt
|
||||
// nachzusehen ist genau der Schritt, den man unter Zeitdruck auslässt.
|
||||
describe("TerminatePanel — Kündigungsschutz", () => {
|
||||
it("warnt mit dem Enddatum, wenn eines erfasst ist", () => {
|
||||
zeige({ has_kuendigungsschutz: true, kuendigungsschutz_bis: "2027-06-30" });
|
||||
expect(screen.getByText(/Achtung: besonderer Kündigungsschutz bis 30\.06\.2027/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("warnt auch ohne Enddatum, und sagt dass keines erfasst ist", () => {
|
||||
zeige({ has_kuendigungsschutz: true, kuendigungsschutz_bis: null });
|
||||
expect(screen.getByText(/Ende nicht erfasst/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("schweigt, wo kein Schutz besteht", () => {
|
||||
zeige();
|
||||
expect(screen.queryByText(/besonderer Kündigungsschutz/i)).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("warnt auch bei einem Nichtantritt — der Schutz gilt ab Vertragsbeginn", async () => {
|
||||
const user = userEvent.setup();
|
||||
zeige({ has_kuendigungsschutz: true, kuendigungsschutz_bis: "2027-06-30" });
|
||||
await user.selectOptions(screen.getByLabelText("Beendigungsart"), "No Show");
|
||||
expect(screen.getByText(/Achtung: besonderer Kündigungsschutz/)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe("TerminatePanel — geplanter Eintritt", () => {
|
||||
it("schlägt bei einem geplanten Eintritt No Show vor", () => {
|
||||
zeige({ status: "Geplant" });
|
||||
expect(screen.getByLabelText("Beendigungsart")).toHaveValue("No Show");
|
||||
expect(screen.getByRole("heading", { name: "Nicht angetreten" })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("bleibt bei einer aktiven Person beim gewöhnlichen Austritt", () => {
|
||||
zeige({ status: "Aktiv" });
|
||||
expect(screen.getByLabelText("Beendigungsart")).toHaveValue("Einvernehmliche Auflösung");
|
||||
expect(screen.getByRole("heading", { name: "Austritt" })).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -50,6 +50,8 @@ function mitarbeiter(teil: Partial<EmployeeRow> = {}): EmployeeRow {
|
||||
is_betriebsrat: false,
|
||||
has_dienstwagen: false,
|
||||
dienstwagen_art: null,
|
||||
has_kuendigungsschutz: false,
|
||||
kuendigungsschutz_bis: null,
|
||||
is_laterale_fuehrung: false,
|
||||
is_c_level: false,
|
||||
title_prefix: [],
|
||||
@@ -102,3 +104,22 @@ describe("VertragTab — Merkmale", () => {
|
||||
expect(wertZu("Laterale Führung")).toBe("Nein");
|
||||
});
|
||||
});
|
||||
|
||||
describe("VertragTab — Kündigungsschutz", () => {
|
||||
it("nennt das Enddatum statt eines blossen Ja", () => {
|
||||
// „Ja" allein liesse offen, ob der Schutz noch läuft — und genau danach
|
||||
// fragt jemand, der auf dieses Blatt schaut.
|
||||
render(<VertragTab employee={mitarbeiter({ has_kuendigungsschutz: true, kuendigungsschutz_bis: "2027-06-30" })} />);
|
||||
expect(wertZu("Besonderer Kündigungsschutz")).toBe("bis 30.06.2027");
|
||||
});
|
||||
|
||||
it("sagt es auch, wenn das Ende offen ist", () => {
|
||||
render(<VertragTab employee={mitarbeiter({ has_kuendigungsschutz: true, kuendigungsschutz_bis: null })} />);
|
||||
expect(wertZu("Besonderer Kündigungsschutz")).toBe("Ja (Ende offen)");
|
||||
});
|
||||
|
||||
it("steht ohne Schutz auf Nein", () => {
|
||||
render(<VertragTab employee={mitarbeiter()} />);
|
||||
expect(wertZu("Besonderer Kündigungsschutz")).toBe("Nein");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user