# ─────────────────────────────────────────────────────────────
# NOMAZRA — Google Play Billing Product IDs & Subscription Plans
# This file contains all subscription plan IDs, prices, and benefits
# for Google Pay integration via Google Play Billing Library.
# ─────────────────────────────────────────────────────────────

# ── SUBSCRIPTION PRODUCT IDS ──

PLANS:

  1. FREE PLAN
     - Product ID: (none — default tier, no purchase required)
     - Price: $0.00 / month
     - Queries per day: 10
     - Documents per day: 1
     - Voice input: ❌ (text only)
     - Voice call: ❌
     - TTS voices: 1 male (echo), 1 female (nova)
     - Countries: 1 (user's selected country only)
     - Chat history: 7 days
     - PDF export: ❌
     - Ads: ✅ (banner + interstitial)
     - Document analysis: Basic (summary only)
     - Rights cards: Limited (top 10 per country)
     - Priority support: ❌

  2. PLUS PLAN (Monthly)
     - Google Play Product ID: nomazra_plus_monthly
     - Price: $9.99 / month
     - Queries per day: 50
     - Documents per day: 10
     - Voice input: ✅ (Whisper transcription)
     - Voice call: ❌
     - TTS voices: 1 male (echo), 1 female (nova)
     - Countries: 5
     - Chat history: 90 days
     - PDF export: ✅
     - Ads: ❌ (ad-free)
     - Document analysis: Full (with legal review)
     - Rights cards: Full access for selected countries
     - Priority support: ❌
     - Cost estimator: ✅
     - Contract drafting: Basic templates

  3. PREMIUM PLAN (Monthly)
     - Google Play Product ID: nomazra_premium_monthly
     - Price: $19.99 / month
     - Queries per day: Unlimited
     - Documents per day: Unlimited
     - Voice input: ✅
     - Voice call: ✅ (real-time AI legal consultation)
     - TTS voices: 4 (alloy, echo, nova, shimmer)
     - Countries: All (140+)
     - Chat history: Unlimited
     - PDF export: ✅
     - Ads: ❌
     - Document analysis: Full + AI-powered clause review
     - Rights cards: Full access all countries
     - Priority support: ✅
     - Cost estimator: ✅ (detailed)
     - Contract drafting: Full AI drafting
     - Multi-country comparison: ✅
     - Emergency contacts: All countries
     - Legal reminders: ✅

  4. PROFESSIONAL PLAN (Monthly)
     - Google Play Product ID: nomazra_pro_monthly
     - Price: $49.99 / month
     - Queries per day: Unlimited
     - Documents per day: Unlimited
     - Voice input: ✅
     - Voice call: ✅ (priority queue, extended sessions up to 60 min)
     - TTS voices: 4 (alloy, echo, nova, shimmer)
     - Countries: All (140+)
     - Chat history: Unlimited
     - PDF export: ✅ (branded templates)
     - Ads: ❌
     - Document analysis: Full + bulk processing
     - Rights cards: Full access + custom cards
     - Priority support: ✅ (dedicated)
     - Cost estimator: ✅ (detailed + market data)
     - Contract drafting: Full AI + custom templates
     - Multi-country comparison: ✅
     - Emergency contacts: All countries
     - Legal reminders: ✅
     - API access: ✅ (REST API for integrations)
     - Team accounts: Up to 5 members
     - Custom law database: ✅ (upload own legal references)
     - White-label reports: ✅
     - Bulk document analysis: ✅ (up to 50 at once)
     - Export formats: PDF, DOCX, CSV


# ── YEARLY PLANS (OPTIONAL — for future implementation) ──

  5. PLUS PLAN (Yearly)
     - Google Play Product ID: nomazra_plus_yearly
     - Price: $99.99 / year (save ~17%)
     - Same benefits as PLUS Monthly

  6. PREMIUM PLAN (Yearly)
     - Google Play Product ID: nomazra_premium_yearly
     - Price: $199.99 / year (save ~17%)
     - Same benefits as PREMIUM Monthly

  7. PROFESSIONAL PLAN (Yearly)
     - Google Play Product ID: nomazra_pro_yearly
     - Price: $499.99 / year (save ~17%)
     - Same benefits as PROFESSIONAL Monthly


# ── GOOGLE PLAY BILLING CONFIGURATION ──

Google Play Console Setup:
  - App package: com.kelthos.nomazra
  - Billing API version: Google Play Billing Library v7+
  - Subscription type: Auto-renewing
  - Grace period: 7 days
  - Account hold: 30 days
  - Free trial: 7 days (PLUS & PREMIUM only)
  - Introductory price: None

SKU Configuration (Google Play Console > Monetization > Subscriptions):

  nomazra_plus_monthly:
    - Base plan ID: monthly
    - Billing period: P1M (1 month)
    - Price: USD 9.99
    - Free trial: P7D (7-day free trial)
    - Grace period: P7D
    - Resubscribe: enabled

  nomazra_premium_monthly:
    - Base plan ID: monthly
    - Billing period: P1M
    - Price: USD 19.99
    - Free trial: P7D
    - Grace period: P7D
    - Resubscribe: enabled

  nomazra_pro_monthly:
    - Base plan ID: monthly
    - Billing period: P1M
    - Price: USD 49.99
    - Free trial: None
    - Grace period: P7D
    - Resubscribe: enabled

  nomazra_plus_yearly:
    - Base plan ID: yearly
    - Billing period: P1Y (1 year)
    - Price: USD 99.99
    - Free trial: None
    - Grace period: P14D

  nomazra_premium_yearly:
    - Base plan ID: yearly
    - Billing period: P1Y
    - Price: USD 199.99
    - Free trial: None
    - Grace period: P14D

  nomazra_pro_yearly:
    - Base plan ID: yearly
    - Billing period: P1Y
    - Price: USD 499.99
    - Free trial: None
    - Grace period: P14D


# ── FLUTTER IMPLEMENTATION REFERENCE ──

Dart Product IDs (for in_app_purchase package):

  static const kPlusMonthly = 'nomazra_plus_monthly';
  static const kPremiumMonthly = 'nomazra_premium_monthly';
  static const kProMonthly = 'nomazra_pro_monthly';
  static const kPlusYearly = 'nomazra_plus_yearly';
  static const kPremiumYearly = 'nomazra_premium_yearly';
  static const kProYearly = 'nomazra_pro_yearly';


# ── BACKEND VERIFICATION ──

Server-side receipt validation endpoint:
  POST /api/nomazra/subscription/verify/
  Body: { "purchase_token": "...", "product_id": "nomazra_plus_monthly" }
  Response: { "valid": true, "plan": "plus", "expires_at": "2026-04-25T..." }

Server-side webhook (RTDN — Real-Time Developer Notifications):
  POST /api/nomazra/subscription/webhook/
  Handles: SUBSCRIPTION_PURCHASED, SUBSCRIPTION_RENEWED,
           SUBSCRIPTION_CANCELED, SUBSCRIPTION_ON_HOLD,
           SUBSCRIPTION_IN_GRACE_PERIOD, SUBSCRIPTION_EXPIRED


# ── RATE LIMITS PER PLAN ──

PLAN_LIMITS = {
    "free":        {"queries_per_day": 10,   "docs_per_day": 1,    "countries": 1,    "voice_call": False, "voice_input": False, "pdf_export": False, "max_call_minutes": 0},
    "plus":        {"queries_per_day": 50,   "docs_per_day": 10,   "countries": 5,    "voice_call": False, "voice_input": True,  "pdf_export": True,  "max_call_minutes": 0},
    "premium":     {"queries_per_day": 9999, "docs_per_day": 9999, "countries": 999,  "voice_call": True,  "voice_input": True,  "pdf_export": True,  "max_call_minutes": 30},
    "professional": {"queries_per_day": 9999, "docs_per_day": 9999, "countries": 999, "voice_call": True,  "voice_input": True,  "pdf_export": True,  "max_call_minutes": 60},
}
