#!/bin/bash
# Create QAR prices with proper currency conversion
# 1 GBP = 4.62 QAR

echo "Creating QAR subscription prices..."
echo ""

# Tier 1: £179 → QAR 827
echo "Creating Tier 1 (Starter) - QAR 827/month"
stripe prices create \
  --product=prod_TNf1iF9UkLTD9u \
  --currency=qar \
  --unit-amount=82700 \
  '--recurring[interval]=month' \
  --metadata tier_id=tier1 \
  --metadata billing_period=monthly \
  --metadata currency=QAR

# Tier 2: £209 → QAR 966  
echo "Creating Tier 2 (Professional) - QAR 966/month"
stripe prices create \
  --product=prod_TNf1u5lJYQutnv \
  --currency=qar \
  --unit-amount=96600 \
  '--recurring[interval]=month' \
  --metadata tier_id=tier2 \
  --metadata billing_period=monthly \
  --metadata currency=QAR

# Tier 3: £249 → QAR 1151
echo "Creating Tier 3 (Business) - QAR 1151/month"
stripe prices create \
  --product=prod_TNf1RZVMy8XP4p \
  --currency=qar \
  --unit-amount=115100 \
  '--recurring[interval]=month' \
  --metadata tier_id=tier3 \
  --metadata billing_period=monthly \
  --metadata currency=QAR

# Tier 4: £349 → QAR 1612
echo "Creating Tier 4 (Enterprise) - QAR 1612/month"
stripe prices create \
  --product=prod_TNf1HMUhxmVbZq \
  --currency=qar \
  --unit-amount=161200 \
  '--recurring[interval]=month' \
  --metadata tier_id=tier4 \
  --metadata billing_period=monthly \
  --metadata currency=QAR

# Tier 5: £449 → QAR 2074
echo "Creating Tier 5 (Ultimate) - QAR 2074/month"
stripe prices create \
  --product=prod_TNf1BCDtDWWWN4 \
  --currency=qar \
  --unit-amount=207400 \
  '--recurring[interval]=month' \
  --metadata tier_id=tier5 \
  --metadata billing_period=monthly \
  --metadata currency=QAR

echo ""
echo "✅ QAR prices created!"
echo ""
echo "Listing all QAR monthly prices:"
stripe prices list --limit 50 | jq -r '.data[] | select(.currency == "qar" and .recurring.interval == "month") | "\(.metadata.tier_id // "no-tier"): QAR \(.unit_amount/100) (\(.id))"'
