Hosting-Abo: Preis 15 € -> 20 € pro Monat (Vertragsbedingungen v4, Katalog, Leitfaden)
- server/config.js: amountCents 2000, lookup_key webklar_hosting_monatlich_2000 - ensurePrice haengt einen neuen Preis an das vorhandene Stripe-Produkt (metadata.webklar), statt ein zweites "WEBklar Hosting-Abo" anzulegen - abo-bedingungen.html (Uebersicht, Preise, Leistungsbeschreibung) + PDF, Leitfaden + PDF - Tests auf 20 € umgestellt (399/399) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
78b4d7b7fe
commit
e4efdac226
18 files changed
+79
-59
No files matched your search
@@ -15,7 +15,7 @@ const { grantCreditForInvoice, loadInvoice, invoiceLines } = await import('../se
|
||||
|
||||
const price = (id, lookup_key, unit_amount) => ({ id, object: 'price', lookup_key, unit_amount, active: true })
|
||||
st.prices.set('price_w', price('price_w', 'webklar_wartung_monatlich_5000', 5000))
|
||||
st.prices.set('price_h', price('price_h', 'webklar_hosting_monatlich_1500', 1500))
|
||||
st.prices.set('price_h', price('price_h', 'webklar_hosting_monatlich_2000', 2000))
|
||||
|
||||
const sub = (id, priceObj) => ({
|
||||
id,
|
||||
@@ -66,14 +66,14 @@ test('Wartungs-Rechnung: 60 Minuten, genau einmal', async () => {
|
||||
})
|
||||
|
||||
test('Hosting-Rechnung: keine Stunde', async () => {
|
||||
st.invoices.set('in_2', inv('in_2', 'sub_h', [regular('price_h', 1500)]))
|
||||
assert.deepEqual(await grantCreditForInvoice(payload('in_2', 'sub_h', 1500)), { skipped: 'keine Wartungs-Leistung' })
|
||||
st.invoices.set('in_2', inv('in_2', 'sub_h', [regular('price_h', 2000)]))
|
||||
assert.deepEqual(await grantCreditForInvoice(payload('in_2', 'sub_h', 2000)), { skipped: 'keine Wartungs-Leistung' })
|
||||
assert.equal(aw.docs('hourCredits').has('in_2'), false)
|
||||
})
|
||||
|
||||
test('Frisch geladene Rechnung zählt, nicht die Webhook-Nutzlast', async () => {
|
||||
// Nutzlast in alter Form (ohne pricing/parent) behauptet Wartung, frisch geladen ist es Hosting
|
||||
st.invoices.set('in_3', inv('in_3', 'sub_h', [regular('price_h', 1500)]))
|
||||
st.invoices.set('in_3', inv('in_3', 'sub_h', [regular('price_h', 2000)]))
|
||||
const oldPayload = {
|
||||
id: 'in_3',
|
||||
subscription: 'sub_h',
|
||||
@@ -94,7 +94,7 @@ test('Preis-Zuordnung wird zwischengespeichert', async () => {
|
||||
})
|
||||
|
||||
test('Unbekannte Preis-ID (404) neben Hosting: keine Stunde, kein Absturz', async () => {
|
||||
st.invoices.set('in_5', inv('in_5', 'sub_h', [regular('price_h', 1500), regular('price_weg', 800)]))
|
||||
st.invoices.set('in_5', inv('in_5', 'sub_h', [regular('price_h', 2000), regular('price_weg', 800)]))
|
||||
assert.deepEqual(await grantCreditForInvoice(payload('in_5', 'sub_h', 2300)), { skipped: 'keine Wartungs-Leistung' })
|
||||
assert.equal(aw.docs('hourCredits').has('in_5'), false)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user