-- Run this once in phpMyAdmin.
--
-- Your PasarGuard admin login (JrVPN) is on a shared/reseller panel and
-- doesn't have permission to GET /api/groups ("Permission denied:
-- groups.read"). Because of that, the bot's "select all groups"
-- fallback (used for free trials, and for any plan with no group ids
-- configured) was silently sending group_ids: [] — so new accounts had
-- no groups ticked at all in the panel.
--
-- Found via debug_groups.php with one-group test accounts:
--   Tunnel = 2, Direct & Tunnel = 3, Direct = 8
--
-- This sets a fixed fallback list (editable anytime from
-- تنظیمات ← تست رایگان ← گروه‌های پیش‌فرض پنل in the bot) and applies the
-- same three groups to the existing paid plan, so both free trials and
-- paid purchases tick all three groups. If groups.read permission is
-- ever granted on the panel side, the bot automatically goes back to
-- reading the live group list instead of this fixed one.

INSERT INTO settings (setting_key, setting_value) VALUES ('pg_default_group_ids', '2,3,8')
ON DUPLICATE KEY UPDATE setting_value = '2,3,8';

UPDATE categories SET pg_group_ids = '2,3,8' WHERE id = 15;
