Webshop A1/A2: Konfiguration, Schalter, Katalog shopSetup, Schema und Setup-Skript
config.shop (SHOP_ENABLED, SHOP_PILOT_EMAILS, SHOP_UPLOAD_DIR, STRIPE_CONNECT_WEBHOOK_SECRET), config.shopSetup (299 € einmalig), Collection-IDs shopConfig/shopProducts/shopOrders/shopWiderrufe, services/shop/schalter.js, Katalogschluessel shopSetup in stripeBilling und stripe-products.mjs, services/shop/schema.js, scripts/shop-setup.mjs (--check), schemaKeys fuer die Test-Mocks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b168b10485
commit
e9ab15bdb5
11 files changed
+759
-6
No files matched your search
@@ -281,3 +281,24 @@ test('termine_einrichtung_einmalpreis', async () => {
|
||||
assert.equal(await ensurePrice('termineSetup'), id)
|
||||
assert.equal(st.calls.slice(again).filter((c) => c.method === 'POST').length, 0)
|
||||
})
|
||||
|
||||
test('shop_einrichtung_einmalpreis', async () => {
|
||||
const before = st.calls.length
|
||||
const id = await ensurePrice('shopSetup')
|
||||
const calls = st.calls.slice(before)
|
||||
const created = calls.filter((c) => c.method === 'POST' && c.path === '/v1/prices')
|
||||
assert.equal(created.length, 1)
|
||||
assert.equal(created[0].body['unit_amount'], '29900')
|
||||
assert.equal(created[0].body['lookup_key'], 'webklar_shop_einrichtung_29900')
|
||||
assert.equal(created[0].body['nickname'], 'Webshop-Einrichtung 299 €')
|
||||
assert.ok(!Object.keys(created[0].body).some((k) => k.startsWith('recurring')), 'kein recurring')
|
||||
assert.equal(st.prices.get(id).recurring, null)
|
||||
const products = calls.filter((c) => c.method === 'POST' && c.path === '/v1/products')
|
||||
assert.equal(products.length, 1)
|
||||
assert.equal(products[0].body['name'], 'Webshop – Einrichtung')
|
||||
assert.equal(products[0].body['metadata[webklar]'], 'shop-einrichtung')
|
||||
// zweiter Aufruf: kein zweiter Preis (auch ohne Cache per lookup_key gefunden)
|
||||
const again = st.calls.length
|
||||
assert.equal(await ensurePrice('shopSetup'), id)
|
||||
assert.equal(st.calls.slice(again).filter((c) => c.method === 'POST').length, 0)
|
||||
})
|
||||
Reference in new issue
Block a user