Files
MathApp/subscription/migrations/0008_paid_quota_ten_a_day.py
Zareian 2edc56fc08 paid plans: 10 tutor questions a day at 179,000 / 1,790,000 toman
Five a day was too close to the free three. Pricing keeps the tutor under ~40% of net revenue
at typical use (a third of the cap); full numbers in the cost report and docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 10:11:31 +03:30

43 lines
2.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
سقفِ پولی ۱۰ سوال در روز، با قیمتی که هزینه‌اش را می‌پوشاند (۲۰۲۶-۱۰-۰۲).
۵ سوال در روز (0007) در برابرِ ۳ِ رایگان تفاوتی حس نمی‌شد (صاحبِ پروژه). با ۱۰ سوال و هزینه‌ی
میانگینِ ~۶۰۰ تومان برای هر سوال، مشترکی که یک‌سومِ سقف را مصرف کند (~۱۰۰ سوال در ماه) حدودِ
۶۰ هزار تومان هزینه دارد. ماهانه‌ی ۱۷۹ هزار تومانی آن را زیرِ ۴۰٪ِ درآمدِ خالص نگه می‌دارد (۳۹٪ با
سهمِ ۱۵٪یِ بازار، ۳۴٪ با زرین‌پال)؛ سالانه‌ی ۱٬۷۹۰ هزار تومانی (قیمتِ ۱۰ ماه) ۴۷٪ / ۴۰٪. مشترکی که
هر روز سقف را پر کند (۳۰۰ سوال، ~۱۸۰ هزار تومان) زیان دارد؛ حسابِ کامل: گزارشِ هزینه در
گزارش-۲۶ و docs/ai-cost-and-guardrails.md.
فقط پلن‌هایی را عوض می‌کند که هنوز همان قیمت و سقفِ 0007 را دارند، تا ویرایشِ ادمین بازنویسی نشود.
"""
from django.db import migrations
CHANGES = [
# (قیمتِ 0007، مدت) → مقدارِ تازه
((99_000, 30), {'price': 179_000, 'ai_daily_quota': 10}),
((990_000, 365), {'price': 1_790_000, 'ai_daily_quota': 10, 'discount_percent': 17}),
]
def apply(apps, schema_editor):
Plan = apps.get_model('subscription', 'Plan')
for (price, days), new in CHANGES:
Plan.objects.filter(price=price, duration_days=days, ai_daily_quota=5).update(**new)
def undo(apps, schema_editor):
Plan = apps.get_model('subscription', 'Plan')
for (price, days), new in CHANGES:
Plan.objects.filter(price=new['price'], duration_days=days).update(price=price, ai_daily_quota=5)
class Migration(migrations.Migration):
dependencies = [
('subscription', '0007_plans_priced_by_ai_cost'),
]
operations = [
migrations.RunPython(apply, undo),
]