Grades 4 and 5, Bazaar purchase from the app, pack SKUs
- rag: MATH_4 / MATH_5 textbooks (TOC and page offsets read from the PDFs) - content: grades 4 and 5 in the seed files: 7 units / 28 nodes each, 204 + 194 questions (every node >= 4), all re-solved blind once - subscription: Plan.bazaar_sku (admin); POST /api/subscription/purchase accepts paymentMethod=bazaar for packs, rejects unknown methods (was ignored) - payment: idempotency key cannot switch provider; discount codes refused on Bazaar orders (Bazaar charges the fixed SKU price) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -128,6 +128,10 @@ class RedeemDiscountView(APIView):
|
||||
from payment.models import Order
|
||||
# سفارش باید متعلق به همان کاربر احرازهویتشده باشد (جلوگیری از اعمال تخفیف روی سفارش دیگران).
|
||||
order = get_object_or_404(Order, pk=order_id, user_id=request.user.id)
|
||||
# بازار قیمتِ ثابتِ SKU را میگیرد، هرچه مبلغِ سفارش باشد؛ تخفیف روی سفارشِ بازار فقط
|
||||
# کد را میسوزاند و کاربر همان قیمتِ کامل را میپرداخت.
|
||||
if order.provider == 'bazaar':
|
||||
raise ValidationError({'orderId': 'کدِ تخفیف روی خرید از کافهبازار اعمال نمیشود.'})
|
||||
|
||||
try:
|
||||
with transaction.atomic():
|
||||
|
||||
Reference in New Issue
Block a user