#!/bin/bash
STRIPE_KEY="sk_test_51SIwGl2WZb9MHlLoM0tvnneH7zdQJDLq4Ub7bmpK1mxZspvGKiMpEhvOYAXn8ZNYtRBvfoQZIObHuzQp89KLp1N300Jtko6flq"

echo "Creating QAR prices via Stripe API..."

# Tier 2 Professional: £209 → QAR 966
curl -s https://api.stripe.com/v1/prices \
  -u "$STRIPE_KEY": \
  -d "product=prod_TNf1u5lJYQutnv" \
  -d "currency=qar" \
  -d "unit_amount=96600" \
  -d "recurring[interval]=month" \
  -d "metadata[tier_id]=tier2" \
  -d "metadata[billing_period]=monthly" \
  | jq '{id, unit_amount, currency, recurring}'

echo "✅ Created tier2 QAR price"

# Tier 3 Business: £249 → QAR 1151
curl -s https://api.stripe.com/v1/prices \
  -u "$STRIPE_KEY": \
  -d "product=prod_TNf1RZVMy8XP4p" \
  -d "currency=qar" \
  -d "unit_amount=115100" \
  -d "recurring[interval]=month" \
  -d "metadata[tier_id]=tier3" \
  -d "metadata[billing_period]=monthly" \
  | jq '{id, unit_amount, currency, recurring}'

echo "✅ Created tier3 QAR price"

echo ""
echo "New QAR prices:"
stripe prices list --limit 10 | jq -r '.data[0:5] | .[] | select(.currency == "qar") | "\(.metadata.tier_id): QAR \(.unit_amount/100)/\(.recurring.interval)"'
