Kundenansicht neu P7: GET /api/abo liefert Fassung 6 und Wortlaut nur der neuen Ansicht
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4a3b0030d2
commit
bf1e968a83
2 files changed
+76
-1
No files matched your search
@@ -26,6 +26,7 @@ import { featureConfig } from '../services/featureRegistry.js'
|
||||
import { istAboModell } from '../services/aboModell.js'
|
||||
import { ENTHALTEN_IN, aboModellFuerKunde } from '../services/aboFunktionen.js'
|
||||
import { neueAnsicht } from '../services/kundenansicht/schalter.js'
|
||||
import { bestelltexteFuerClient } from '../services/bestelltexte.js'
|
||||
import { PRODUCT_KEYS, contractAttachmentFor, describeItems, isTermsV4OrNewer, productLabel, productView, termsDocFor } from '../services/products.js'
|
||||
import {
|
||||
ACTIVE_STATUSES,
|
||||
@@ -214,10 +215,15 @@ router.get('/', requireSession, async (req, res) => {
|
||||
active ? null : getOpenOffer(customerId, 'hosting').catch(() => null),
|
||||
active ? null : getOpenOffer(customerId, 'wartung').catch(() => null),
|
||||
])
|
||||
// Fassung 6 (P7): nur in der neuen Ansicht und mit gesetzter Neu-Fassung; sonst bleibt die Antwort wie sie war (neun Schluessel)
|
||||
const fassung6 = neueAnsicht(req) && Boolean(config.abo.termsVersionNeu)
|
||||
return res.json({
|
||||
available: isStripeConfigured() && isPilotAllowed(customer, hostingOffer || wartungOffer),
|
||||
testAccount: config.abo.testEmails.includes(String(customer?.email || '').toLowerCase()),
|
||||
termsVersion: config.abo.termsVersion,
|
||||
termsVersion: fassung6 ? config.abo.termsVersionNeu : config.abo.termsVersion,
|
||||
...(fassung6
|
||||
? { bestelltexte: bestelltexteFuerClient({ fassung: config.abo.termsVersionNeu, termsUrl: termsDocFor(config.abo.termsVersionNeu).url }) }
|
||||
: {}),
|
||||
// Leistungsbeginn bei "Nach Ablauf der Widerrufsfrist" für die Bestellseite
|
||||
lateStartAt: lateStartAt().toISOString(),
|
||||
products: [productView('hosting'), productView('wartung')],
|
||||
|
||||
Reference in new issue
Block a user