tia/drizzle/meta
Mannu 678cf65d70 feat: DB-backed notification system with vaccine + activity nudges
Migration (0009): notifications table with unique daily/weekly slots,
is_read column, metadata JSONB for vaccine info. No more localStorage
for read state — syncs across devices.

API GET /api/notifications?childId=:
- Generates vaccine notifications (upsert, filtered by given vaccines at query time)
- log_nudge: if no feed/diaper/sleep logged today after noon IST
- memory_nudge: if no photo added to memories today
- garment_nudge: if wardrobe < 10 items (once per week slot)
- Returns unread first, then recent read, limit 60

API PATCH /api/notifications  — mark all read for family+child
API PATCH /api/notifications/[id] — mark single notification read

Page /notifications:
- Fetches from real API (no hardcoded mock data)
- Optimistic mark-read on tap, navigates to actionUrl
- Colored cards per type (red=vaccine, amber=log, purple=memory, pink=garment)
- Unread badge + Mark all read button in sticky header
- Legend row at bottom

debug-migration: added notifications table CREATE IF NOT EXISTS for hot-apply

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 09:33:51 +05:30
..
0000_snapshot.json chore(db): regenerate baseline migration from corrected schema 2026-05-23 12:25:20 +05:30
0001_snapshot.json feat(wardrobe): add complete wardrobe feature (W0–W9) 2026-05-23 18:09:22 +05:30
0002_snapshot.json feat(wardrobe): add complete wardrobe feature (W0–W9) 2026-05-23 18:09:22 +05:30
_journal.json feat: DB-backed notification system with vaccine + activity nudges 2026-05-29 09:33:51 +05:30