Kundenansicht: Protokoll-Collection customerViewLog mit Schreiben, Lesen und Loeschen nach 12 Monaten

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-01 19:25:26 +00:00
1 parent 772095ab19
commit fdf594706d
6 files changed
+157 -1

No files matched your search

+19 -1
View File
@@ -2,7 +2,7 @@
/**
* Wartungs-Abo: legt die Collections subscriptions, hourCredits, takeoverCredits
* (Uebernahmegutschriften), aboOffers (individuelle Angebote), portalFeatures (Portal-Funktionen je
* Projekt) und newsPosts (News-Pinnwand) in woms-database an und
* Projekt), newsPosts (News-Pinnwand) und customerViewLog (Protokoll der Kundenansicht) in woms-database an und
* ergaenzt worksheets um das Flag countsToPlan ("zaehlt aufs Abo-Stundenkonto").
* Idempotent: existierende Collection/Attribute/Indexe werden uebersprungen.
* Usage (im Container): docker exec -w /app webklar-kundenbereich-server node scripts/setup-abo-collections.mjs
@@ -333,4 +333,22 @@ await ensure('worksheets.countsToPlan', () =>
)
await waitForAttributes('worksheets', ['countsToPlan'])
// Kundenansicht: wer wann das Portal eines Kunden geoeffnet oder darin etwas geaendert hat (12 Monate)
await ensureCollection(
'customerViewLog',
'Kundenansicht-Protokoll',
[
{ type: 'string', key: 'customerId', size: 64 },
{ type: 'string', key: 'staffUserId', size: 64 },
{ type: 'string', key: 'staffName', size: 128 },
{ type: 'string', key: 'action', size: 32 },
{ type: 'string', key: 'detail', size: 300 },
{ type: 'datetime', key: 'createdAt' },
],
[
{ key: 'idx_customer_created', type: 'key', attributes: ['customerId', 'createdAt'] },
{ key: 'idx_created', type: 'key', attributes: ['createdAt'] },
]
)
console.log('Fertig.')