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:
Sven (AAMOS AI)
2026-08-10 03:51:57 +07:00
parent e2cc24eee2
commit f494b1810e
10 changed files with 900 additions and 1 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
"start": "node dist/index.js",
"build": "tsup src/index.ts --format esm --target node22 --sourcemap --clean",
"typecheck": "tsc --noEmit",
"test": "vitest run --passWithNoTests",
"test": "pnpm --filter=@app/database run db:test-setup && vitest run --passWithNoTests",
"eval": "tsx src/eval/run.ts",
"eval:scan": "tsx src/eval/scan-eval.ts"
},