mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
fix(subscription): fall back to purchase flow for free-tariff switches
The bot backend now rejects prorated tariff switches from a free (0RUB) tariff with 400 free_tariff_cannot_switch + use_purchase_flow=true (TARIFF_SWITCH_RESET_FREE_DAYS: the free remainder must reset, not be prorated over hundreds of accumulated days and carried to a paid tariff). Handle it like the existing trial_cannot_switch contract: - SwitchTariffSheet: accept free_tariff_cannot_switch in shouldUsePurchaseFlow so the sheet hands off to the purchase form - TariffPickerGrid: new subscription_on_free_tariff purchase-options flag disables the switch CTA up front and shows purchase instead Companion to BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot#3056. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -364,6 +364,9 @@ export interface TariffsPurchaseOptions {
|
||||
// New fields for expired subscription handling
|
||||
subscription_status?: string;
|
||||
subscription_is_expired?: boolean;
|
||||
// Free (0₽) source tariff: switch is blocked (free days must reset),
|
||||
// tariff cards must offer the purchase flow instead of the prorated switch
|
||||
subscription_on_free_tariff?: boolean;
|
||||
has_subscription?: boolean;
|
||||
// Multi-tariff: all available tariffs already purchased
|
||||
all_tariffs_purchased?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user