Anrede-Verhältnis Du/Sie pro Kunde + Geburtstagsgruß respektiert Anrede

Schema:
- Customer.useInformalAddress: Boolean (Default: false = Sie)
- Auch bei Firmenkunden verfügbar (Chef kann man auch duzen)

Frontend:
- Neues Pflichtfeld "Anrede per" (Du/Sie) im Kunden-Formular
- Anzeige als Badge in CustomerDetail-Stammdaten

Geburtstagsgruß im Portal:
- Bei Du: "Herzlichen Glückwunsch, Max! Alles Gute zu deinem 42. Geburtstag!"
- Bei Sie: "Herzlichen Glückwunsch, Herr Müller! Alles Gute zu Ihrem 42. Geburtstag!"
- Konsistent auch bei nachträglichen Glückwünschen (hattest/hatten, bist/sind etc.)
- Backend liefert firstName, lastName, salutation und useInformalAddress

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-23 12:27:23 +02:00
parent d1005f9730
commit 6175421a4c
8 changed files with 65 additions and 10 deletions
@@ -267,6 +267,14 @@ export default function CustomerDetail({ portalCustomerId }: { portalCustomerId?
</dd>
</div>
)}
<div>
<dt className="text-sm text-gray-500">Anrede per</dt>
<dd>
<Badge variant={c.useInformalAddress ? 'info' : 'default'}>
{c.useInformalAddress ? 'Du (informell)' : 'Sie (formell)'}
</Badge>
</dd>
</div>
<div>
<dt className="text-sm text-gray-500">Vorname</dt>
<dd className="flex items-center gap-1">
@@ -135,6 +135,17 @@ export default function CustomerForm() {
]}
/>
<Select
label="Anrede per *"
{...register('useInformalAddress', {
setValueAs: (v) => v === 'true' || v === true,
})}
options={[
{ value: 'false', label: 'Sie (formell)' },
{ value: 'true', label: 'Du (informell)' },
]}
/>
<Input
label="Vorname"
{...register('firstName', { required: 'Vorname erforderlich' })}