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
+3
View File
@@ -503,6 +503,8 @@ export const CONSENT_KINDS = [
"health_integration",
"location_weather",
"push_notifications",
/** In-app notifications (proactive tips etc.) separate from push. */
"notifications",
/** Product analytics legitimate interest with opt-out (spec §8, §33). */
"product_analytics",
] as const;
@@ -568,6 +570,7 @@ export const NOTIFICATION_TYPES = [
"week_plan_change",
"pantry_forecast",
"subscription_status",
"proactive_tip",
] as const;
export type NotificationType = (typeof NOTIFICATION_TYPES)[number];