Fix: Anrede per Du/Sie wird nicht gespeichert

Das useInformalAddress-Feld war:
1. Im Frontend-Submit-Handler nicht in submitData enthalten (wurde bei jedem Update rausgefiltert)
2. Im Service-Type nicht definiert (TypeScript-mäßig unbekannt)
3. Beim Laden im Edit-Mode: Boolean aus DB matchte nicht das String-value des <select>

Fixes:
- Frontend: submitData enthält jetzt useInformalAddress (String oder Boolean → sauberes Boolean)
- Frontend: beim reset() wird Boolean zu 'true'/'false' konvertiert für <select>
- Backend: Service-Type erweitert um useInformalAddress, autoBirthdayGreeting, autoBirthdayChannel
- Backend: Audit-Feldlabels für die neuen Felder

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-23 13:10:03 +02:00
parent 958752ecc9
commit 9d5412cef0
3 changed files with 11 additions and 0 deletions
@@ -39,6 +39,8 @@ export default function CustomerForm() {
if (data.foundingDate) {
data.foundingDate = data.foundingDate.split('T')[0] as any;
}
// Boolean → String für <select>-Wert ('true'/'false')
(data as any).useInformalAddress = data.useInformalAddress === true ? 'true' : 'false';
reset(data);
}
}, [customer, reset]);
@@ -65,6 +67,9 @@ export default function CustomerForm() {
const submitData: any = {
type: data.type,
salutation: data.salutation || '',
useInformalAddress:
data.useInformalAddress === true ||
(data.useInformalAddress as any) === 'true',
firstName: data.firstName,
lastName: data.lastName,
companyName: data.companyName || '',