Abo-Bedingungen Fassung 5: Unterstützung in § 4, Fassung 4 archiviert

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-09-30 15:26:39 +00:00
1 parent 88854aa2b4
commit 8acc743cf7
10 files changed
+538 -41

No files matched your search

+8 -3
View File
@@ -117,7 +117,8 @@ test('priceIdsOfInvoice: eindeutige Preis-IDs, ohne Lücken', () => {
test('Vertragsunterlagen je Version', () => {
// F08 (Task 12): endParagraph = Paragraph zum Vertragsende der Fassung (v4: § 9 ist der Wechsel, § 11 das Vertragsende);
// Fix 1 (3): version = die Fassung, die K01 nennt - ohne Angabe die archivierte Fassung 3, passend zum PDF
assert.deepEqual(termsDocFor('2026-10-05-v4'), { version: '2026-10-05-v4', url: '/abo-bedingungen.html', pdfFile: 'WEBklar-Abo-Vertragsunterlagen.pdf', endParagraph: '§ 11' })
assert.deepEqual(termsDocFor('2026-10-05-v5'), { version: '2026-10-05-v5', url: '/abo-bedingungen.html', pdfFile: 'WEBklar-Abo-Vertragsunterlagen.pdf', endParagraph: '§ 11' })
assert.deepEqual(termsDocFor('2026-09-30-v4'), { version: '2026-09-30-v4', url: '/vertragsunterlagen/v4/abo-bedingungen.html', pdfFile: 'vertragsunterlagen/v4/WEBklar-Abo-Vertragsunterlagen.pdf', endParagraph: '§ 11' })
assert.deepEqual(termsDocFor('2026-09-25-v3'), {
version: '2026-09-25-v3',
url: '/vertragsunterlagen/v3/abo-bedingungen.html',
@@ -185,11 +186,15 @@ test('Produktansicht: Domain-Zeile nennt die Endungen', () => {
// F22 / Task 12: Vertragsunterlagen als Mail-Anhang in der Fassung, der der Kunde zugestimmt hat
test('contractAttachmentFor: Datei je Fassung mit absolutem Pfad unter public/', () => {
const v3 = contractAttachmentFor('2026-09-25-v3')
const v4 = contractAttachmentFor('2026-10-05-v4')
const v4 = contractAttachmentFor('2026-09-30-v4')
const v5 = contractAttachmentFor('2026-10-05-v5')
assert.equal(v3.filename, 'WEBklar-Wartungs-Abo-Vertragsunterlagen.pdf')
assert.equal(v4.filename, 'WEBklar-Abo-Vertragsunterlagen.pdf')
assert.ok(path.isAbsolute(v4.path) && v4.path.endsWith(path.join('public', v4.filename)))
assert.equal(v5.filename, 'WEBklar-Abo-Vertragsunterlagen.pdf')
assert.ok(path.isAbsolute(v5.path) && v5.path.endsWith(path.join('public', v5.filename)))
assert.ok(v4.path.endsWith(path.join('public', 'vertragsunterlagen', 'v4', v4.filename)))
assert.ok(existsSync(v4.path), v4.path)
assert.ok(existsSync(v5.path), v5.path)
assert.ok(existsSync(v3.path), v3.path)
assert.deepEqual(contractAttachmentFor(null), v3)
assert.deepEqual(Object.keys(v4).sort(), ['filename', 'path'])