Files
alpenwerk-hr/lib/dienstwagen.ts
Maximilian Stubhan a3fac47f47 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>
2026-08-14 07:06:58 +02:00

18 lines
766 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 ?? "–";
}