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>
18 lines
766 B
TypeScript
18 lines
766 B
TypeScript
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 ?? "–";
|
||
}
|