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

17
lib/dienstwagen.ts Normal file
View File

@@ -0,0 +1,17 @@
import type { DienstwagenArt } from "./supabase/types";
// Wie ein Dienstwagen benannt wird.
//
// Gespeichert steht „Elektro"; gesprochen wird von einem E-KFZ, und danach
// wird auch gefragt. Die Beschriftung stand an drei Stellen einzeln — im
// Auswahlfeld, in der Zusammenfassung des Einstellungsassistenten und auf dem
// Vertragsblatt. Drei Kopien einer Beschriftung laufen auseinander, und dann
// heisst dasselbe Auto je nach Bildschirm anders.
export function dienstwagenLabel(art: DienstwagenArt | null | undefined): string {
if (art === "Elektro") return "E-KFZ";
if (art === "Verbrenner") return "Verbrenner";
// Der CHECK erlaubt es nicht, aber gelesen wird auch, was jemand über den
// Import hineingelegt hat.
return art ?? "–";
}