tia/src
Mannu 714909d7ee feat(billing): Task 1 — Razorpay subscription schema + migration
Three tables + lifecycle enum for Razorpay subscriptions:
- subscription_plans: maps razorpay_plan_id -> grants (price/storage/member/child)
- family_subscriptions: per-family sub state mirrored from Razorpay
- razorpay_webhook_events: append-only log, razorpay_event_id = idempotency key
- subscription_status_enum: mirrors Razorpay's lifecycle states exactly
- partial unique index family_live_sub_idx: at most one non-terminal sub/family

Notes:
- Raw-SQL + Drizzle schema both added (repo uses raw sql`` at runtime;
  schema file keeps drizzle-kit + type inference working)
- child_limit added to plan (not in original handoff) since premium lifts the
  free 1-baby cap to 3 per product decision
- Migration 0012 idempotent; also added to debug-migration hot-apply steps
- when=1780100000000 (> last entry, per journal drift rule)

Entitlement will sync onto families.tier (Task 3/5) so existing quota.ts
guards stay unchanged — these tables are audit + Razorpay state mirror.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 12:10:53 +05:30
..
__tests__ feat(quota): storage quota + family-member limits for free tier 2026-05-27 23:21:11 +05:30
app feat(billing): Task 1 — Razorpay subscription schema + migration 2026-06-06 12:10:53 +05:30
components fix(mockup): clean PNG avatar, local memory photos 2026-05-31 12:33:59 +05:30
db feat(billing): Task 1 — Razorpay subscription schema + migration 2026-06-06 12:10:53 +05:30
hooks feat(g5-g6): age-aware UX + mama affiliate page 2026-05-18 00:59:17 +05:30
lib feat: Telegram alerting + public health probe + Umami visitor digest 2026-05-30 22:01:18 +05:30
scripts Security hardening: auth, bcrypt, rate-limiting, RLS, audit 2026-05-16 23:11:01 +05:30
types Circle feature: C0–C9 multi-tenant social groups (Sprint 9 + 10) 2026-05-24 01:04:50 +05:30
auth.ts Fix db imports: use dbUnscoped 2026-05-16 23:12:33 +05:30
middleware.ts Fix PWA always opening marketing page instead of app home 2026-05-28 10:28:31 +05:30