From b8857e789ef60cf0c8766abbeadd094f62070a61 Mon Sep 17 00:00:00 2001 From: Fringg Date: Thu, 5 Mar 2026 07:15:41 +0300 Subject: [PATCH] fix: consume promo offer in miniapp tariff-mode renewal path The tariff-mode renewal in miniapp applied promo_offer_discount_percent to final_total but never passed consume_promo_offer to subtract_user_balance, allowing infinite reuse of first-purchase-only promo discounts via miniapp. --- app/webapi/routes/miniapp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/webapi/routes/miniapp.py b/app/webapi/routes/miniapp.py index 4c6425d3..25d22bb8 100644 --- a/app/webapi/routes/miniapp.py +++ b/app/webapi/routes/miniapp.py @@ -5328,6 +5328,7 @@ async def submit_subscription_renewal_endpoint( # Списываем баланс (subtract_user_balance делает commit и обновляет user.balance_kopeks) success = await subtract_user_balance( db, user, final_total, description, + consume_promo_offer=promo_offer_discount_percent > 0, mark_as_paid_subscription=True, ) if not success: