feat(worker): S2 proaktiva puffar (expiring-ingredient)
- Ny notification_type 'proactive_tip' och consent_kind 'notifications'.
- Dubbelgrind: personalization + notifications samtycke måste vara granted.
- Mallbaserade pufftexter i 12 språk; ingen fri AI-text.
- Led med nyttan ('gurkan börjar bli slapp — recept du brukar gilla').
- Max 1 puff/hushåll/dag; ingen upprepning av samma vara+recept inom 7 dagar.
- UTC för all datummatte; createdAt sätts explicit från processorns now.
- Ny worker-jobbtyp SEND_PROACTIVE_TIPS.
- Integrationstester för dubbelgrind, revoke, frekvens, duplicate, UTC.
- Migration 0022 + worker test script kör db:test-setup.
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
processMealBoxReminders,
|
||||
processMemorySync,
|
||||
processOutbox,
|
||||
processProactiveTips,
|
||||
processRetention,
|
||||
processStoreNotification,
|
||||
processSubscriptionSweep,
|
||||
@@ -82,6 +83,12 @@ const worker = new Worker(
|
||||
return;
|
||||
}
|
||||
|
||||
case "SEND_PROACTIVE_TIPS": {
|
||||
const tips = await processProactiveTips(ctx);
|
||||
log(`Proaktiva puffar: ${tips}`);
|
||||
return;
|
||||
}
|
||||
|
||||
case "UPDATE_USER_MEMORY": {
|
||||
const updates = await processMemorySync(ctx);
|
||||
log(`Minnesuppdateringar: ${updates}`);
|
||||
|
||||
Reference in New Issue
Block a user