Buchungskalender: Zustimmungs-Test streng, Online-Zahlung nur beim Einschalten prüfen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
32cffb3518
commit
e3b399e003
3 files changed
+17
-5
No files matched your search
@@ -273,7 +273,7 @@ router.put('/einstellungen', ...schreib, route(async (req, res) => {
|
||||
if (rechnungAuftrag !== undefined && typeof rechnungAuftrag !== 'boolean') throw ungueltig({ rechnungAuftrag: 'Ungültige Eingabe.' })
|
||||
const r = vw.pruefeEinstellungen(rest, vorher)
|
||||
if (r.fehler) throw ungueltig(r.fehler)
|
||||
if (r.werte.onlineZahlung === true && stripeZustand(vorher) !== 'aktiv') {
|
||||
if (r.werte.onlineZahlung === true && !vorher.onlineZahlung && stripeZustand(vorher) !== 'aktiv') {
|
||||
throw new UkFehler(409, 'stripe_nicht_aktiv', { onlineZahlung: 'Online-Zahlung ist erst möglich, wenn dein Stripe-Konto aktiv ist.' })
|
||||
}
|
||||
if (r.werte.rechnungsPraefix !== undefined && r.werte.rechnungsPraefix !== (vorher.rechnungsPraefix ?? '') && !vw.zaehlerLeer(vorher)) {
|
||||
|
||||
@@ -83,7 +83,6 @@ export function pruefeEinstellungen(eingabe, vorher = {}) {
|
||||
}
|
||||
if (e.onlineZahlung !== undefined) {
|
||||
if (typeof e.onlineZahlung !== 'boolean') fehler.onlineZahlung = 'Ungültige Eingabe.'
|
||||
else if (e.onlineZahlung && !vorher.stripeAccountId) fehler.onlineZahlung = 'Dafür muss zuerst Stripe verbunden werden.'
|
||||
else werte.onlineZahlung = e.onlineZahlung
|
||||
}
|
||||
const gesamt = { ...vorher, ...werte }
|
||||
|
||||
Reference in new issue
Block a user