Give each characteristic its own line, and name the car

The contract sheet had one field, "Merkmale", holding whatever applied,
comma-separated — and a dash when nothing did. Two problems in one row.
A dash cannot distinguish "has no company car" from "nobody ever
answered the question", and the entry read "Dienstwagen" without saying
which kind, which is the thing worth knowing since electric vehicles are
tracked separately.

Betriebsrat, Dienstwagen, laterale Führung and C-Level are now four
lines like every other line on the sheet, each with Ja or Nein. The
company car shows its drivetrain instead: E-KFZ or Verbrenner.

That label existed in three places — the dropdown, the hire summary and
now here. It lives in lib/dienstwagen.ts, so the same car cannot end up
named differently depending on which screen you are looking at.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 07:06:58 +02:00
parent 08d2740690
commit a3fac47f47
4 changed files with 135 additions and 8 deletions

View File

@@ -1,3 +1,4 @@
import { dienstwagenLabel } from "@/lib/dienstwagen";
import { fmtDate } from "@/lib/format";
import type { Database } from "@/lib/supabase/types";
@@ -13,12 +14,11 @@ const PAYGRADE_LABELS: Record<string, string> = {
};
export function VertragTab({ employee }: { employee: EmployeeRow }) {
const flags = [
employee.is_betriebsrat && "Betriebsrat",
employee.has_dienstwagen && "Dienstwagen",
employee.is_laterale_fuehrung && "Laterale Führung",
employee.is_c_level && "C-Level",
].filter(Boolean);
// Früher stand hier eine einzige Zeile „Merkmale" mit allem, was zutraf,
// durch Kommas getrennt — und ein Gedankenstrich, wenn nichts zutraf. Damit
// liess sich nicht ablesen, ob jemand *keinen* Dienstwagen hat oder ob
// niemand die Frage je beantwortet hat. Jedes Merkmal steht jetzt für sich,
// mit Ja oder Nein, wie jede andere Zeile auf diesem Blatt auch.
const rows: [string, string][] = [
["Eintrittsdatum", fmtDate(employee.entry_date)],
["Vertragsart", employee.contract_type === "befristet" ? `befristet bis ${fmtDate(employee.contract_end_date)}` : "unbefristet"],
@@ -29,7 +29,12 @@ export function VertragTab({ employee }: { employee: EmployeeRow }) {
["Paygrade", PAYGRADE_LABELS[employee.paygrade] ?? employee.paygrade],
["Angestellte:r / Arbeiter:in", employee.worker_type ?? "–"],
["Arbeitstage", employee.work_days?.join(", ") || "–"],
["Merkmale", flags.length > 0 ? flags.join(", ") : "–"],
// Beim Dienstwagen steht die Antriebsart statt eines blossen „Ja" — das
// war die Frage dahinter, seit E-Fahrzeuge getrennt zu führen sind.
["Dienstwagen", employee.has_dienstwagen ? dienstwagenLabel(employee.dienstwagen_art) : "Nein"],
["Betriebsrat", employee.is_betriebsrat ? "Ja" : "Nein"],
["Laterale Führung", employee.is_laterale_fuehrung ? "Ja" : "Nein"],
["C-Level", employee.is_c_level ? "Ja" : "Nein"],
];
if (employee.exit_date) rows.push(["Austrittsdatum", fmtDate(employee.exit_date)]);