diff --git a/database/sql/__pycache__/generate_merge_sql.cpython-314.pyc b/database/sql/__pycache__/generate_merge_sql.cpython-314.pyc new file mode 100644 index 0000000..57e9f5b Binary files /dev/null and b/database/sql/__pycache__/generate_merge_sql.cpython-314.pyc differ diff --git a/database/sql/abaeigold_merge_goldali_catalog.sql b/database/sql/abaeigold_merge_goldali_catalog.sql new file mode 100644 index 0000000..a4c532c --- /dev/null +++ b/database/sql/abaeigold_merge_goldali_catalog.sql @@ -0,0 +1,1376 @@ +-- ============================================================================= +-- عبایی گلد — ادغام settings با کاتالوگ goldAliii +-- +-- منبع مقادیر: abaeigold_client.json +-- قالب کلیدها: goldali (102 کلید) +-- +-- قوانین: +-- • کلید مشترک → value از کلاینت، metadata از کاتالوگ +-- • کلید کاتالوگ بدون مقدار در کلاینت → value=''، is_active=0 +-- • کلیدهای اضافی کلاینت → DELETE +-- +-- قبل از اجرا: USE دیتابیس عبایی گلد + بکاپ +-- ============================================================================= + +START TRANSACTION; + +SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci; + +ALTER TABLE `settings` + MODIFY COLUMN `description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL, + MODIFY COLUMN `title_fa` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL, + MODIFY COLUMN `type` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL; + +-- 1) INSERT + +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'admin_url', 'https://abaeigold.ir/admin/', 'آدرس پنل ادمین', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'admin_url' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'app_url', 'https://abaeigold.ir', 'آدرس اپ (کاربر)', 1, 1, '0inserver', 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'app_url' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'auto_active_customer', 'false', 'فعال‌سازی خودکار کاربر', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'auto_active_customer' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'bace_url', '91.212.174.137', 'آدرس پایه', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'bace_url' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'balance_report_exclude_customer_id', '', 'حذف مشتری از تراز ادمین', 0, 0, NULL, 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'balance_report_exclude_customer_id' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'bale_bot_token', '', 'توکن بات بله', 0, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'bale_bot_token' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'buy_fee', '0', 'سود/اختلاف خرید (ریال)', 1, 1, 'اگر خالی باشد از fee_single', 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'buy_fee' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'charge_notif', 'false', 'پیامک شارژ ادمین', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'charge_notif' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'chart_id', '', 'UUID نمودار Zaarbox', 1, 0, 'خالی = ca3800a0-1f57-3528-b963-178f9168e04f', 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'chart_id' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'close_price', 'true', 'بستن قیمت در بازه زمانی', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'close_price' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'color_primary', '#0A1B37', 'رنگ اصلی', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'color_primary' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'color_secondary', '#0A1B37', 'رنگ ثانویه', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'color_secondary' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'display_montzar', 'true', 'نمایش بلوک همکار در UI', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'display_montzar' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'down_price', '', 'کمترین قیمت امروز', 0, 0, NULL, 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'down_price' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'endDay', '20:30', 'پایان بازه معامله', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'endDay' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'etehadie_api_url', '', 'آدرس API اتحادیه (پشتیبان)', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'etehadie_api_url' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'external_order_api_enabled', '', 'فعال‌سازی API سفارش خارجی (get_wallet / order)', 1, 0, 'true + node_client_id + node_shared_secret', NULL +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'external_order_api_enabled' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'fee_cash', '500000', 'اختلاف ریالی هر گرم (سفارش)', 1, 1, 'goldAliii: 0', 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'fee_cash' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'fee_free', '0', 'تعداد سفارش اول بدون کارمزد', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'fee_free' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'fee_service_charge_percentage', '0.005', 'درصد کارمزد سفارش', 1, 1, 'goldAliii: 7%', 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'fee_service_charge_percentage' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'fee_single', '500000', 'اختلاف قیمت پایه (ریال)', 1, 1, 'پیش‌فرض Laravel fee.single', 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'fee_single' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'gift_for_referral', '', 'پاداش معرف‌شونده', 1, 0, NULL, 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'gift_for_referral' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'gift_for_referrer', '0.005', 'پاداش معرف', 1, 1, NULL, 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'gift_for_referrer' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'group_sms', 'false', 'پیامک گروهی', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'group_sms' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'has_chat', 'true', 'چت پشتیبانی', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'has_chat' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'has_page_earn_money', 'false', 'صفحه کسب درآمد', 1, 1, 'in server', 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'has_page_earn_money' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'has_page_fund', 'true', 'صفحه صندوق', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'has_page_fund' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'has_page_permission', 'true', 'صفحه مجوزها', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'has_page_permission' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'has_page_physical_gold', 'true', 'صفحه طلای فیزیکی', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'has_page_physical_gold' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'has_page_price_trigger', 'true', 'صفحه هشدار قیمت', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'has_page_price_trigger' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'is_requaire_referral', 'true', 'کد معرف اجباری (قدیمی)', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'is_requaire_referral' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'jibit_verification', 'false', 'تأیید کارت بانکی با جیبیت', 1, 1, 'true/false — BankAccountController', 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'jibit_verification' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'key', 'abaeigold', 'کلید داخلی اپ', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'key' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'logo_login', 'logo_login', '', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'logo_login' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'logo_register', 'logo_register', 'لوگوی صفحه ورود', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'logo_register' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'main_product', '13', 'قیمت صفحه اصلی', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'main_product' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'main_product_price', 'false', 'قیمت از محصول (legacy)', 1, 1, 'از price_provider استفاده کنید', 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'main_product_price' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'metal_type', '', 'عنوان فلز در UI', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'metal_type' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'min_first_buy', '', 'حداقل اولین خرید (ریال)', 1, 0, NULL, 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'min_first_buy' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'min_withdraw', '', 'حداقل برداشت (ریال)', 1, 0, NULL, 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'min_withdraw' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'minimum_sell', '', 'حداقل فروش', 1, 0, NULL, 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'minimum_sell' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montify_name', '', 'نام فروشگاه', 1, 0, 'RequestsController — اختیاری', 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montify_name' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_base_url', 'https://limangold.ir', 'آدرس سرور همکار', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_base_url' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_closed', 'false', 'بسته بودن همکار', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_closed' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_diff', '300106.05286206', 'اختلاف قیمت همکار', 0, 1, 'سیستم پر می‌کند', 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_diff' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_live_price', '179740440.58339', 'قیمت لحظه‌ای همکار', 0, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_live_price' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_mazaneh', '778600000', 'مظنه همکار', 0, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_mazaneh' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_mobile', '09901810700', 'موبایل API همکار', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_mobile' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_open_buy', 'true', 'باز بودن خرید همکار', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_open_buy' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_open_sell', 'true', 'باز بودن فروش همکار', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_open_sell' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_password', '09901810700', 'رمز API همکار', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_password' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_price', 'true', 'قیمت از همکار (montzar)', 1, 1, 'گلد علی: false — zaarbox فعال', 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_price' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_product_id', '25', 'کد محصول همکار', 1, 1, NULL, 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_product_id' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2xpbWFuZ29sZC5pci9zZXJ2ZXIvYXV0aC9sb2dpbiIsImlhdCI6MTc4MDQ5MjE0MiwiZXhwIjoxNzgzMDg0MTQyLCJuYmYiOjE3ODA0OTIxNDIsImp0aSI6IkZyYWwzN09jMzB4SHJRM1MiLCJzdWIiOiIzMzQ2IiwicHJ2IjoiMWQwYTAyMGFjZjVjNGI2YzQ5Nzk4OWRmMWFiZjBmYmQ0ZThjOGQ2MyJ9.cw31HhaBYJtNvTNnJwctU1J5tGp1-FDtIQVSU67HZA8', 'توکن همکار (خودکار)', 0, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_token' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_truly_buy_mazaneh', '779900000', 'مظنه خرید همکار', 0, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_truly_buy_mazaneh' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'montzar_truly_sell_mazaneh', '777300000', 'مظنه فروش همکار', 0, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_truly_sell_mazaneh' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'name_en', 'abaei_gold', 'نام انگلیسی اپ', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'name_en' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'name_fa', 'عبایی گلد', 'نام فارسی اپ', 1, 1, 'پلتفرم خرید و فروش آنلاین طلای آبشده . اولین ایده پرداز قلک طلا در ایران', 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'name_fa' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'node_client_id', '', 'شناسه کلاینت API خارجی (X-Client-Id)', 1, 0, 'مقدار قبلی .env: NODE_CLIENT_ID', NULL +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'node_client_id' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'node_shared_secret', '', 'کلید امضای HMAC API خارجی', 1, 0, 'مقدار قبلی .env: NODE_SHARED_SECRET', NULL +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'node_shared_secret' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'open_register', 'true', 'ثبت‌نام باز', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'open_register' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'payping_fin_customer_id', '', 'customer_id fin', 1, 0, NULL, 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_fin_customer_id' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'payping_fin_sync_enabled', '', 'همگام‌سازی fin لیمان', 1, 0, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_fin_sync_enabled' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'payping_fin_token', '', 'توکن fin', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_fin_token' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'payping_fin_url', '', 'URL fin', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_fin_url' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'payping_gateway_item', '', 'item تکی (legacy)', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_gateway_item' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'payping_gateway_items', '', 'لیست item (چرخشی)', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_gateway_items' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'payping_gateway_name', '', 'نام gateway درگاه', 1, 0, 'sepal,', 'select' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_gateway_name' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'payping_round_toman', '', 'گرد کردن مبلغ به تومان', 0, 0, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_round_toman' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'payping_start_url', '', 'آدرس شروع درگاه', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_start_url' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'payping_strict_failed_withdraw', '', 'اولویت تراکنش ناموفق', 0, 0, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_strict_failed_withdraw' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'payping_verify_url', '', 'آدرس تأیید درگاه', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_verify_url' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'price_extreme_date', '', 'تاریخ min/max روز', 0, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'price_extreme_date' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'price_provider', 'montzar', 'منبع قیمت', 1, 1, 'montzar,zaarbox,main_product,etehadie,taban_gohar', 'select' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'price_provider' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'product_auto_close_open_on_list', 'true', 'باز/بسته خودکار محصول', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'product_auto_close_open_on_list' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'product_update_price_on_list', 'true', 'بروز قیمت در لیست محصول', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'product_update_price_on_list' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'profit_gold_api_enabled', '', 'API سود طلا', 0, 0, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'profit_gold_api_enabled' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'referral_bonus_amount', '', 'مبلغ پاداش معرف', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'referral_bonus_amount' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'referral_count_for_gift', '', 'تعداد معرف برای هدیه', 1, 0, NULL, 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'referral_count_for_gift' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'referral_id', 'required', 'الزام کد معرف', 0, 1, 'required,', 'select' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'referral_id' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'referral_limit', '', 'محدودیت دعوت', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'referral_limit' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'register_jibit_verify', '', 'تأیید کدملی/موبایل در ثبت‌نام', 1, 0, 'AuthController', 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'register_jibit_verify' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'register_referral_bonus_message', '', 'پیام پاداش در SMS ثبت‌نام', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'register_referral_bonus_message' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'register_referral_sms_to_referrer', '', 'SMS به معرف هنگام ثبت‌نام', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'register_referral_sms_to_referrer' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'sell_fee', '0', 'سود/اختلاف فروش (ریال)', 1, 1, 'اگر خالی باشد از fee_single', 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'sell_fee' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'send_to_tahesab', 'false', 'ارسال ته‌حساب', 0, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'send_to_tahesab' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'server_url', 'https://abaeigold.ir/api', 'آدرس API سرور', 1, 1, 'in server', 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'server_url' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'show_last_price', 'false', 'نمایش آخرین قیمت DB اگر API قطع شد', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'show_last_price' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'startDay', '10:00', 'شروع بازه معامله', 1, 1, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'startDay' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'tabanGohar_price', 'false', 'قیمت تابان گوهر', 1, 1, NULL, 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'tabanGohar_price' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'tahesab_bank_account', '', 'حساب بانکی ته‌حساب', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'tahesab_bank_account' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'tahesab_db', '', 'دیتابیس ته‌حساب', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'tahesab_db' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'tahesab_token', '', 'توکن ته‌حساب', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'tahesab_token' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'telegram_bot_token', '', 'توکن بات تلگرام', 0, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'telegram_bot_token' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'test*', '', '', 1, 0, 'تستی است', 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'test*' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'text_about', '', 'متن درباره ما', 1, 0, NULL, 'longtext' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'text_about' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'text_rule', '', 'متن قوانین', 1, 0, NULL, 'longtext' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'text_rule' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'title_fav', '', 'عنوان favicon', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'title_fav' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'title_pwa', '', 'عنوان PWA', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'title_pwa' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'up_price', '', 'بیشترین قیمت امروز', 0, 0, 'ReportController', 'number' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'up_price' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'zaarbox_api_url', '', 'url زرباکس', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'zaarbox_api_url' LIMIT 1); +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'zaarbox_price_key', '', 'کد محصول زرباکس', 1, 0, NULL, 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'zaarbox_price_key' LIMIT 1); + +-- 2) UPDATE + +UPDATE `settings` SET + `title_fa` = 'آدرس پنل ادمین', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = 'https://abaeigold.ir/admin/', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'admin_url'; +UPDATE `settings` SET + `title_fa` = 'آدرس اپ (کاربر)', + `can_edit` = 1, + `type` = 'text', + `description` = '0inserver', + `value` = 'https://abaeigold.ir', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'app_url'; +UPDATE `settings` SET + `title_fa` = 'فعال‌سازی خودکار کاربر', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'false', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'auto_active_customer'; +UPDATE `settings` SET + `title_fa` = 'آدرس پایه', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '91.212.174.137', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'bace_url'; +UPDATE `settings` SET + `title_fa` = 'حذف مشتری از تراز ادمین', + `can_edit` = 0, + `type` = 'number', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'balance_report_exclude_customer_id'; +UPDATE `settings` SET + `title_fa` = 'توکن بات بله', + `can_edit` = 0, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'bale_bot_token'; +UPDATE `settings` SET + `title_fa` = 'سود/اختلاف خرید (ریال)', + `can_edit` = 1, + `type` = 'number', + `description` = 'اگر خالی باشد از fee_single', + `value` = '0', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'buy_fee'; +UPDATE `settings` SET + `title_fa` = 'پیامک شارژ ادمین', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'false', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'charge_notif'; +UPDATE `settings` SET + `title_fa` = 'UUID نمودار Zaarbox', + `can_edit` = 1, + `type` = 'text', + `description` = 'خالی = ca3800a0-1f57-3528-b963-178f9168e04f', + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'chart_id'; +UPDATE `settings` SET + `title_fa` = 'بستن قیمت در بازه زمانی', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'close_price'; +UPDATE `settings` SET + `title_fa` = 'رنگ اصلی', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '#0A1B37', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'color_primary'; +UPDATE `settings` SET + `title_fa` = 'رنگ ثانویه', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '#0A1B37', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'color_secondary'; +UPDATE `settings` SET + `title_fa` = 'نمایش بلوک همکار در UI', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'display_montzar'; +UPDATE `settings` SET + `title_fa` = 'کمترین قیمت امروز', + `can_edit` = 0, + `type` = 'number', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'down_price'; +UPDATE `settings` SET + `title_fa` = 'پایان بازه معامله', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '20:30', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'endDay'; +UPDATE `settings` SET + `title_fa` = 'آدرس API اتحادیه (پشتیبان)', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'etehadie_api_url'; +UPDATE `settings` SET + `title_fa` = 'فعال‌سازی API سفارش خارجی (get_wallet / order)', + `can_edit` = 1, + `type` = NULL, + `description` = 'true + node_client_id + node_shared_secret', + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'external_order_api_enabled'; +UPDATE `settings` SET + `title_fa` = 'اختلاف ریالی هر گرم (سفارش)', + `can_edit` = 1, + `type` = 'number', + `description` = 'goldAliii: 0', + `value` = '500000', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'fee_cash'; +UPDATE `settings` SET + `title_fa` = 'تعداد سفارش اول بدون کارمزد', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = '0', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'fee_free'; +UPDATE `settings` SET + `title_fa` = 'درصد کارمزد سفارش', + `can_edit` = 1, + `type` = 'number', + `description` = 'goldAliii: 7%', + `value` = '0.005', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'fee_service_charge_percentage'; +UPDATE `settings` SET + `title_fa` = 'اختلاف قیمت پایه (ریال)', + `can_edit` = 1, + `type` = 'number', + `description` = 'پیش‌فرض Laravel fee.single', + `value` = '500000', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'fee_single'; +UPDATE `settings` SET + `title_fa` = 'پاداش معرف‌شونده', + `can_edit` = 1, + `type` = 'number', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'gift_for_referral'; +UPDATE `settings` SET + `title_fa` = 'پاداش معرف', + `can_edit` = 1, + `type` = 'number', + `description` = NULL, + `value` = '0.005', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'gift_for_referrer'; +UPDATE `settings` SET + `title_fa` = 'پیامک گروهی', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'false', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'group_sms'; +UPDATE `settings` SET + `title_fa` = 'چت پشتیبانی', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'has_chat'; +UPDATE `settings` SET + `title_fa` = 'صفحه کسب درآمد', + `can_edit` = 1, + `type` = 'switch', + `description` = 'in server', + `value` = 'false', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'has_page_earn_money'; +UPDATE `settings` SET + `title_fa` = 'صفحه صندوق', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'has_page_fund'; +UPDATE `settings` SET + `title_fa` = 'صفحه مجوزها', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'has_page_permission'; +UPDATE `settings` SET + `title_fa` = 'صفحه طلای فیزیکی', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'has_page_physical_gold'; +UPDATE `settings` SET + `title_fa` = 'صفحه هشدار قیمت', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'has_page_price_trigger'; +UPDATE `settings` SET + `title_fa` = 'کد معرف اجباری (قدیمی)', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'is_requaire_referral'; +UPDATE `settings` SET + `title_fa` = 'تأیید کارت بانکی با جیبیت', + `can_edit` = 1, + `type` = 'switch', + `description` = 'true/false — BankAccountController', + `value` = 'false', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'jibit_verification'; +UPDATE `settings` SET + `title_fa` = 'کلید داخلی اپ', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = 'abaeigold', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'key'; +UPDATE `settings` SET + `title_fa` = '', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = 'logo_login', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'logo_login'; +UPDATE `settings` SET + `title_fa` = 'لوگوی صفحه ورود', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = 'logo_register', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'logo_register'; +UPDATE `settings` SET + `title_fa` = 'قیمت صفحه اصلی', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '13', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'main_product'; +UPDATE `settings` SET + `title_fa` = 'قیمت از محصول (legacy)', + `can_edit` = 1, + `type` = 'switch', + `description` = 'از price_provider استفاده کنید', + `value` = 'false', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'main_product_price'; +UPDATE `settings` SET + `title_fa` = 'عنوان فلز در UI', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'metal_type'; +UPDATE `settings` SET + `title_fa` = 'حداقل اولین خرید (ریال)', + `can_edit` = 1, + `type` = 'number', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'min_first_buy'; +UPDATE `settings` SET + `title_fa` = 'حداقل برداشت (ریال)', + `can_edit` = 1, + `type` = 'number', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'min_withdraw'; +UPDATE `settings` SET + `title_fa` = 'حداقل فروش', + `can_edit` = 1, + `type` = 'number', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'minimum_sell'; +UPDATE `settings` SET + `title_fa` = 'نام فروشگاه', + `can_edit` = 1, + `type` = 'text', + `description` = 'RequestsController — اختیاری', + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'montify_name'; +UPDATE `settings` SET + `title_fa` = 'آدرس سرور همکار', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = 'https://limangold.ir', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_base_url'; +UPDATE `settings` SET + `title_fa` = 'بسته بودن همکار', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'false', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_closed'; +UPDATE `settings` SET + `title_fa` = 'اختلاف قیمت همکار', + `can_edit` = 0, + `type` = 'text', + `description` = 'سیستم پر می‌کند', + `value` = '300106.05286206', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_diff'; +UPDATE `settings` SET + `title_fa` = 'قیمت لحظه‌ای همکار', + `can_edit` = 0, + `type` = 'text', + `description` = NULL, + `value` = '179740440.58339', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_live_price'; +UPDATE `settings` SET + `title_fa` = 'مظنه همکار', + `can_edit` = 0, + `type` = 'text', + `description` = NULL, + `value` = '778600000', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_mazaneh'; +UPDATE `settings` SET + `title_fa` = 'موبایل API همکار', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '09901810700', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_mobile'; +UPDATE `settings` SET + `title_fa` = 'باز بودن خرید همکار', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_open_buy'; +UPDATE `settings` SET + `title_fa` = 'باز بودن فروش همکار', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_open_sell'; +UPDATE `settings` SET + `title_fa` = 'رمز API همکار', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '09901810700', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_password'; +UPDATE `settings` SET + `title_fa` = 'قیمت از همکار (montzar)', + `can_edit` = 1, + `type` = 'switch', + `description` = 'گلد علی: false — zaarbox فعال', + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_price'; +UPDATE `settings` SET + `title_fa` = 'کد محصول همکار', + `can_edit` = 1, + `type` = 'number', + `description` = NULL, + `value` = '25', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_product_id'; +UPDATE `settings` SET + `title_fa` = 'توکن همکار (خودکار)', + `can_edit` = 0, + `type` = 'text', + `description` = NULL, + `value` = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2xpbWFuZ29sZC5pci9zZXJ2ZXIvYXV0aC9sb2dpbiIsImlhdCI6MTc4MDQ5MjE0MiwiZXhwIjoxNzgzMDg0MTQyLCJuYmYiOjE3ODA0OTIxNDIsImp0aSI6IkZyYWwzN09jMzB4SHJRM1MiLCJzdWIiOiIzMzQ2IiwicHJ2IjoiMWQwYTAyMGFjZjVjNGI2YzQ5Nzk4OWRmMWFiZjBmYmQ0ZThjOGQ2MyJ9.cw31HhaBYJtNvTNnJwctU1J5tGp1-FDtIQVSU67HZA8', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_token'; +UPDATE `settings` SET + `title_fa` = 'مظنه خرید همکار', + `can_edit` = 0, + `type` = 'text', + `description` = NULL, + `value` = '779900000', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_truly_buy_mazaneh'; +UPDATE `settings` SET + `title_fa` = 'مظنه فروش همکار', + `can_edit` = 0, + `type` = 'text', + `description` = NULL, + `value` = '777300000', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'montzar_truly_sell_mazaneh'; +UPDATE `settings` SET + `title_fa` = 'نام انگلیسی اپ', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = 'abaei_gold', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'name_en'; +UPDATE `settings` SET + `title_fa` = 'نام فارسی اپ', + `can_edit` = 1, + `type` = 'text', + `description` = 'پلتفرم خرید و فروش آنلاین طلای آبشده . اولین ایده پرداز قلک طلا در ایران', + `value` = 'عبایی گلد', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'name_fa'; +UPDATE `settings` SET + `title_fa` = 'شناسه کلاینت API خارجی (X-Client-Id)', + `can_edit` = 1, + `type` = NULL, + `description` = 'مقدار قبلی .env: NODE_CLIENT_ID', + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'node_client_id'; +UPDATE `settings` SET + `title_fa` = 'کلید امضای HMAC API خارجی', + `can_edit` = 1, + `type` = NULL, + `description` = 'مقدار قبلی .env: NODE_SHARED_SECRET', + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'node_shared_secret'; +UPDATE `settings` SET + `title_fa` = 'ثبت‌نام باز', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'open_register'; +UPDATE `settings` SET + `title_fa` = 'customer_id fin', + `can_edit` = 1, + `type` = 'number', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'payping_fin_customer_id'; +UPDATE `settings` SET + `title_fa` = 'همگام‌سازی fin لیمان', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'payping_fin_sync_enabled'; +UPDATE `settings` SET + `title_fa` = 'توکن fin', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'payping_fin_token'; +UPDATE `settings` SET + `title_fa` = 'URL fin', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'payping_fin_url'; +UPDATE `settings` SET + `title_fa` = 'item تکی (legacy)', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'payping_gateway_item'; +UPDATE `settings` SET + `title_fa` = 'لیست item (چرخشی)', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'payping_gateway_items'; +UPDATE `settings` SET + `title_fa` = 'نام gateway درگاه', + `can_edit` = 1, + `type` = 'select', + `description` = 'sepal,', + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'payping_gateway_name'; +UPDATE `settings` SET + `title_fa` = 'گرد کردن مبلغ به تومان', + `can_edit` = 0, + `type` = 'switch', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'payping_round_toman'; +UPDATE `settings` SET + `title_fa` = 'آدرس شروع درگاه', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'payping_start_url'; +UPDATE `settings` SET + `title_fa` = 'اولویت تراکنش ناموفق', + `can_edit` = 0, + `type` = 'switch', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'payping_strict_failed_withdraw'; +UPDATE `settings` SET + `title_fa` = 'آدرس تأیید درگاه', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'payping_verify_url'; +UPDATE `settings` SET + `title_fa` = 'تاریخ min/max روز', + `can_edit` = 0, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'price_extreme_date'; +UPDATE `settings` SET + `title_fa` = 'منبع قیمت', + `can_edit` = 1, + `type` = 'select', + `description` = 'montzar,zaarbox,main_product,etehadie,taban_gohar', + `value` = 'montzar', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'price_provider'; +UPDATE `settings` SET + `title_fa` = 'باز/بسته خودکار محصول', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'product_auto_close_open_on_list'; +UPDATE `settings` SET + `title_fa` = 'بروز قیمت در لیست محصول', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'true', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'product_update_price_on_list'; +UPDATE `settings` SET + `title_fa` = 'API سود طلا', + `can_edit` = 0, + `type` = 'switch', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'profit_gold_api_enabled'; +UPDATE `settings` SET + `title_fa` = 'مبلغ پاداش معرف', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'referral_bonus_amount'; +UPDATE `settings` SET + `title_fa` = 'تعداد معرف برای هدیه', + `can_edit` = 1, + `type` = 'number', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'referral_count_for_gift'; +UPDATE `settings` SET + `title_fa` = 'الزام کد معرف', + `can_edit` = 0, + `type` = 'select', + `description` = 'required,', + `value` = 'required', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'referral_id'; +UPDATE `settings` SET + `title_fa` = 'محدودیت دعوت', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'referral_limit'; +UPDATE `settings` SET + `title_fa` = 'تأیید کدملی/موبایل در ثبت‌نام', + `can_edit` = 1, + `type` = 'switch', + `description` = 'AuthController', + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'register_jibit_verify'; +UPDATE `settings` SET + `title_fa` = 'پیام پاداش در SMS ثبت‌نام', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'register_referral_bonus_message'; +UPDATE `settings` SET + `title_fa` = 'SMS به معرف هنگام ثبت‌نام', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'register_referral_sms_to_referrer'; +UPDATE `settings` SET + `title_fa` = 'سود/اختلاف فروش (ریال)', + `can_edit` = 1, + `type` = 'number', + `description` = 'اگر خالی باشد از fee_single', + `value` = '0', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'sell_fee'; +UPDATE `settings` SET + `title_fa` = 'ارسال ته‌حساب', + `can_edit` = 0, + `type` = 'switch', + `description` = NULL, + `value` = 'false', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'send_to_tahesab'; +UPDATE `settings` SET + `title_fa` = 'آدرس API سرور', + `can_edit` = 1, + `type` = 'text', + `description` = 'in server', + `value` = 'https://abaeigold.ir/api', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'server_url'; +UPDATE `settings` SET + `title_fa` = 'نمایش آخرین قیمت DB اگر API قطع شد', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'false', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'show_last_price'; +UPDATE `settings` SET + `title_fa` = 'شروع بازه معامله', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '10:00', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'startDay'; +UPDATE `settings` SET + `title_fa` = 'قیمت تابان گوهر', + `can_edit` = 1, + `type` = 'switch', + `description` = NULL, + `value` = 'false', + `is_active` = 1, + `updated_at` = NOW() +WHERE `key` = 'tabanGohar_price'; +UPDATE `settings` SET + `title_fa` = 'حساب بانکی ته‌حساب', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'tahesab_bank_account'; +UPDATE `settings` SET + `title_fa` = 'دیتابیس ته‌حساب', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'tahesab_db'; +UPDATE `settings` SET + `title_fa` = 'توکن ته‌حساب', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'tahesab_token'; +UPDATE `settings` SET + `title_fa` = 'توکن بات تلگرام', + `can_edit` = 0, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'telegram_bot_token'; +UPDATE `settings` SET + `title_fa` = '', + `can_edit` = 1, + `type` = 'text', + `description` = 'تستی است', + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'test*'; +UPDATE `settings` SET + `title_fa` = 'متن درباره ما', + `can_edit` = 1, + `type` = 'longtext', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'text_about'; +UPDATE `settings` SET + `title_fa` = 'متن قوانین', + `can_edit` = 1, + `type` = 'longtext', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'text_rule'; +UPDATE `settings` SET + `title_fa` = 'عنوان favicon', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'title_fav'; +UPDATE `settings` SET + `title_fa` = 'عنوان PWA', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'title_pwa'; +UPDATE `settings` SET + `title_fa` = 'بیشترین قیمت امروز', + `can_edit` = 0, + `type` = 'number', + `description` = 'ReportController', + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'up_price'; +UPDATE `settings` SET + `title_fa` = 'url زرباکس', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'zaarbox_api_url'; +UPDATE `settings` SET + `title_fa` = 'کد محصول زرباکس', + `can_edit` = 1, + `type` = 'text', + `description` = NULL, + `value` = '', + `is_active` = 0, + `updated_at` = NOW() +WHERE `key` = 'zaarbox_price_key'; + +-- 3) logo_login normalize + +DELETE FROM `settings` +WHERE `key` LIKE 'logo_login%' AND `key` <> 'logo_login' + AND EXISTS (SELECT 1 FROM (SELECT `id`, `key` FROM `settings`) AS `s` WHERE `s`.`key` = 'logo_login'); + +UPDATE `settings` SET + `key` = 'logo_login', + `value` = TRIM(REPLACE(REPLACE(`value`, CHAR(13), ''), CHAR(10), '')), + `updated_at` = NOW() +WHERE `key` LIKE 'logo_login%' AND `key` <> 'logo_login'; + +-- 4) DELETE extras + +DELETE FROM `settings` +WHERE `key` NOT IN ( + 'admin_url', + 'app_url', + 'auto_active_customer', + 'bace_url', + 'balance_report_exclude_customer_id', + 'bale_bot_token', + 'buy_fee', + 'charge_notif', + 'chart_id', + 'close_price', + 'color_primary', + 'color_secondary', + 'display_montzar', + 'down_price', + 'endDay', + 'etehadie_api_url', + 'external_order_api_enabled', + 'fee_cash', + 'fee_free', + 'fee_service_charge_percentage', + 'fee_single', + 'gift_for_referral', + 'gift_for_referrer', + 'group_sms', + 'has_chat', + 'has_page_earn_money', + 'has_page_fund', + 'has_page_permission', + 'has_page_physical_gold', + 'has_page_price_trigger', + 'is_requaire_referral', + 'jibit_verification', + 'key', + 'logo_login', + 'logo_register', + 'main_product', + 'main_product_price', + 'metal_type', + 'min_first_buy', + 'min_withdraw', + 'minimum_sell', + 'montify_name', + 'montzar_base_url', + 'montzar_closed', + 'montzar_diff', + 'montzar_live_price', + 'montzar_mazaneh', + 'montzar_mobile', + 'montzar_open_buy', + 'montzar_open_sell', + 'montzar_password', + 'montzar_price', + 'montzar_product_id', + 'montzar_token', + 'montzar_truly_buy_mazaneh', + 'montzar_truly_sell_mazaneh', + 'name_en', + 'name_fa', + 'node_client_id', + 'node_shared_secret', + 'open_register', + 'payping_fin_customer_id', + 'payping_fin_sync_enabled', + 'payping_fin_token', + 'payping_fin_url', + 'payping_gateway_item', + 'payping_gateway_items', + 'payping_gateway_name', + 'payping_round_toman', + 'payping_start_url', + 'payping_strict_failed_withdraw', + 'payping_verify_url', + 'price_extreme_date', + 'price_provider', + 'product_auto_close_open_on_list', + 'product_update_price_on_list', + 'profit_gold_api_enabled', + 'referral_bonus_amount', + 'referral_count_for_gift', + 'referral_id', + 'referral_limit', + 'register_jibit_verify', + 'register_referral_bonus_message', + 'register_referral_sms_to_referrer', + 'sell_fee', + 'send_to_tahesab', + 'server_url', + 'show_last_price', + 'startDay', + 'tabanGohar_price', + 'tahesab_bank_account', + 'tahesab_db', + 'tahesab_token', + 'telegram_bot_token', + 'test*', + 'text_about', + 'text_rule', + 'title_fav', + 'title_pwa', + 'up_price', + 'zaarbox_api_url', + 'zaarbox_price_key' +); + +DELETE FROM `settings` WHERE `key` = 'price_method'; + +COMMIT; diff --git a/database/sql/abaeigold_merge_goldali_const.sql b/database/sql/abaeigold_merge_goldali_const.sql new file mode 100644 index 0000000..cb463bd --- /dev/null +++ b/database/sql/abaeigold_merge_goldali_const.sql @@ -0,0 +1,117 @@ +-- ============================================================================= +-- عبایی گلد — ادغام const با کاتالوگ goldAliii +-- +-- منبع مقادیر: abaeigold_client.json +-- قالب: 10 کلید goldali +-- ============================================================================= + +START TRANSACTION; + +SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci; + +ALTER TABLE `const` + MODIFY COLUMN `title_fa` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL; + +-- 1) INSERT + +INSERT INTO `const` (`key`, `value`, `title_fa`) +SELECT 'limited_price', '', 'سقف قیمت محدود' +WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'limited_price' LIMIT 1); +INSERT INTO `const` (`key`, `value`, `title_fa`) +SELECT 'is_gateway_open', '', 'باز بودن درگاه پرداخت' +WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'is_gateway_open' LIMIT 1); +INSERT INTO `const` (`key`, `value`, `title_fa`) +SELECT 'liman', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vMjEyLjIzLjIwMS4xNzMvc2VydmVyL2F1dGgvbG9naW4iLCJpYXQiOjE3Nzk2MzcxNTEsImV4cCI6MTc4MjIyOTE1MSwibmJmIjoxNzc5NjM3MTUxLCJqdGkiOiJFaHdqRXhiY2xDRmxsY25sIiwic3ViIjoiMzM0NiIsInBydiI6IjFkMGEwMjBhY2Y1YzRiNmM0OTc5ODlkZjFhYmYwZmJkNGU4YzhkNjMifQ.GQrsnIDkcHGeXQGdfoiv1xFEqqek0M05CMRK3zk-PAE', 'توکن لیمان' +WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'liman' LIMIT 1); +INSERT INTO `const` (`key`, `value`, `title_fa`) +SELECT 'header_banner', '', 'بنر بالای صفحه' +WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'header_banner' LIMIT 1); +INSERT INTO `const` (`key`, `value`, `title_fa`) +SELECT 'app_closed', 'false', 'بسته بودن اپ' +WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'app_closed' LIMIT 1); +INSERT INTO `const` (`key`, `value`, `title_fa`) +SELECT 'main_product', '13', 'محصول آبشده پیش‌فرض' +WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'main_product' LIMIT 1); +INSERT INTO `const` (`key`, `value`, `title_fa`) +SELECT 'gram', '', 'گرم ثبت‌نام' +WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'gram' LIMIT 1); +INSERT INTO `const` (`key`, `value`, `title_fa`) +SELECT 'first_customer_wallet_value', '', 'حداقل اولین خرید' +WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'first_customer_wallet_value' LIMIT 1); +INSERT INTO `const` (`key`, `value`, `title_fa`) +SELECT 'jibit_counter', '0', 'شمارنده جیبیت' +WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'jibit_counter' LIMIT 1); +INSERT INTO `const` (`key`, `value`, `title_fa`) +SELECT 'price', '[]', 'لیست قیمت TGJU (JSON)' +WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'price' LIMIT 1); + +-- 2) UPDATE + +UPDATE `const` SET + `title_fa` = 'سقف قیمت محدود', + `value` = '', + `updated_at` = NOW() +WHERE `key` = 'limited_price'; +UPDATE `const` SET + `title_fa` = 'باز بودن درگاه پرداخت', + `value` = '', + `updated_at` = NOW() +WHERE `key` = 'is_gateway_open'; +UPDATE `const` SET + `title_fa` = 'توکن لیمان', + `value` = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vMjEyLjIzLjIwMS4xNzMvc2VydmVyL2F1dGgvbG9naW4iLCJpYXQiOjE3Nzk2MzcxNTEsImV4cCI6MTc4MjIyOTE1MSwibmJmIjoxNzc5NjM3MTUxLCJqdGkiOiJFaHdqRXhiY2xDRmxsY25sIiwic3ViIjoiMzM0NiIsInBydiI6IjFkMGEwMjBhY2Y1YzRiNmM0OTc5ODlkZjFhYmYwZmJkNGU4YzhkNjMifQ.GQrsnIDkcHGeXQGdfoiv1xFEqqek0M05CMRK3zk-PAE', + `updated_at` = NOW() +WHERE `key` = 'liman'; +UPDATE `const` SET + `title_fa` = 'بنر بالای صفحه', + `value` = '', + `updated_at` = NOW() +WHERE `key` = 'header_banner'; +UPDATE `const` SET + `title_fa` = 'بسته بودن اپ', + `value` = 'false', + `updated_at` = NOW() +WHERE `key` = 'app_closed'; +UPDATE `const` SET + `title_fa` = 'محصول آبشده پیش‌فرض', + `value` = '13', + `updated_at` = NOW() +WHERE `key` = 'main_product'; +UPDATE `const` SET + `title_fa` = 'گرم ثبت‌نام', + `value` = '', + `updated_at` = NOW() +WHERE `key` = 'gram'; +UPDATE `const` SET + `title_fa` = 'حداقل اولین خرید', + `value` = '', + `updated_at` = NOW() +WHERE `key` = 'first_customer_wallet_value'; +UPDATE `const` SET + `title_fa` = 'شمارنده جیبیت', + `value` = '0', + `updated_at` = NOW() +WHERE `key` = 'jibit_counter'; +UPDATE `const` SET + `title_fa` = 'لیست قیمت TGJU (JSON)', + `value` = '[]', + `updated_at` = NOW() +WHERE `key` = 'price'; + +-- 3) DELETE extras + +DELETE FROM `const` +WHERE `key` NOT IN ( + 'limited_price', + 'is_gateway_open', + 'liman', + 'header_banner', + 'app_closed', + 'main_product', + 'gram', + 'first_customer_wallet_value', + 'jibit_counter', + 'price' +); + +COMMIT; diff --git a/database/sql/generate_merge_sql.py b/database/sql/generate_merge_sql.py new file mode 100644 index 0000000..345e975 --- /dev/null +++ b/database/sql/generate_merge_sql.py @@ -0,0 +1,352 @@ +#!/usr/bin/env python3 +""" +Generate client merge SQL (settings + const) from: + - goldAli catalog template (abshode_rahimi_merge_goldali_catalog.sql UPDATE blocks) + - client JSON: { "settings": [...], "const": [...] } + +Usage: + python generate_merge_sql.py abaeigold_client.json abaeigold +""" + +from __future__ import annotations + +import json +import re +import sys +from pathlib import Path + +SQL_DIR = Path(__file__).resolve().parent +CATALOG_SQL = SQL_DIR / "abshode_rahimi_merge_goldali_catalog.sql" + +CONST_CATALOG: list[dict] = [ + {"key": "limited_price", "title_fa": "سقف قیمت محدود", "default": ""}, + {"key": "is_gateway_open", "title_fa": "باز بودن درگاه پرداخت", "default": ""}, + {"key": "liman", "title_fa": "توکن لیمان", "default": ""}, + {"key": "header_banner", "title_fa": "بنر بالای صفحه", "default": ""}, + {"key": "app_closed", "title_fa": "بسته بودن اپ", "default": "false"}, + {"key": "main_product", "title_fa": "محصول آبشده پیش‌فرض", "default": "13"}, + {"key": "gram", "title_fa": "گرم ثبت‌نام", "default": ""}, + {"key": "first_customer_wallet_value", "title_fa": "حداقل اولین خرید", "default": ""}, + {"key": "jibit_counter", "title_fa": "شمارنده جیبیت", "default": "0"}, + {"key": "price", "title_fa": "لیست قیمت TGJU (JSON)", "default": "[]"}, +] + +# Legacy client keys → catalog key (value only) +SETTINGS_ALIASES = { + "liman_token": "const:liman", +} + +# Keys dropped from client settings (logs, legacy goldir in settings if any) +SETTINGS_SKIP = { + "montzar_order_response", + "montzar_last_product_log", + "liman_token", +} + +CONST_SKIP_PREFIXES = ("goldir",) +CONST_SKIP_KEYS = {"log", "last_order_log"} + + +def normalize_key(key: str) -> str: + return key.strip().replace("\r", "").replace("\n", "") + + +def sql_str(value: str | None) -> str: + if value is None: + return "NULL" + return "'" + str(value).replace("\\", "\\\\").replace("'", "''") + "'" + + +def _parse_sql_field(line: str) -> str | None: + line = line.strip().rstrip(",") + if line.endswith("= NULL"): + return None + eq = line.index("=") + raw = line[eq + 1 :].strip() + if raw.startswith("'") and raw.endswith("'"): + return raw[1:-1].replace("''", "'") + return raw + + +def parse_catalog_updates(text: str) -> dict[str, dict]: + catalog: dict[str, dict] = {} + blocks = re.split(r"(?=UPDATE `settings` SET)", text) + for block in blocks: + if not block.startswith("UPDATE `settings` SET"): + continue + key_m = re.search( + r"`updated_at` = NOW\(\)\s+WHERE `key` = '([^']+)';", block + ) + if not key_m: + continue + key = key_m.group(1) + fields: dict[str, str | None] = {} + for line in block.splitlines(): + line = line.strip() + for col in ("title_fa", "can_edit", "type", "description"): + if line.startswith(f"`{col}` ="): + fields[col] = _parse_sql_field(line) + catalog[key] = { + "title_fa": fields.get("title_fa") or "", + "can_edit": int(fields.get("can_edit") or 0), + "type": fields.get("type"), + "description": fields.get("description"), + } + + # fallback: ensure full key list from DELETE block + delete_m = re.search( + r"DELETE FROM `settings`\s+WHERE `key` NOT IN \(\s*(.*?)\s*\);", + text, + re.S, + ) + if delete_m: + for key in re.findall(r"'([^']+)'", delete_m.group(1)): + catalog.setdefault( + key, + {"title_fa": "", "can_edit": 1, "type": "text", "description": None}, + ) + catalog.pop("price_method", None) + return catalog + + +def load_client_rows(path: Path) -> tuple[dict[str, str | None], dict[str, str | None]]: + data = json.loads(path.read_text(encoding="utf-8")) + settings: dict[str, str | None] = {} + const: dict[str, str | None] = {} + + for row in data.get("settings", []): + key = normalize_key(row["key"]) + if key in SETTINGS_SKIP: + continue + val = row.get("value") + if val is not None and isinstance(val, str): + val = val.strip() + settings[key] = val if val != "" else None + + for row in data.get("const", []): + key = normalize_key(row["key"]) + if key in CONST_SKIP_KEYS or key.startswith(CONST_SKIP_PREFIXES): + continue + val = row.get("value") + if val is not None and isinstance(val, str): + val = val.strip() + const[key] = val if val != "" else None + + # liman_token in settings → const.liman + if "liman_token" in {normalize_key(r["key"]) for r in data.get("settings", [])}: + for row in data.get("settings", []): + if normalize_key(row["key"]) == "liman_token" and row.get("value"): + const["liman"] = row["value"] + + # montzar_price → price_provider + mp = settings.get("montzar_price") + if mp and str(mp).lower() in ("true", "1"): + settings["price_provider"] = "montzar" + elif settings.get("main_product_price") and str(settings.get("main_product_price")).lower() == "true": + settings["price_provider"] = "main_product" + elif not settings.get("price_provider"): + settings.setdefault("price_provider", "montzar" if mp and str(mp).lower() in ("true", "1") else "") + + # main_product from const if missing in settings + if const.get("main_product") and not settings.get("main_product"): + settings["main_product"] = const["main_product"] + + return settings, const + + +def is_active_value(value: str | None) -> int: + if value is None or value == "": + return 0 + return 1 + + +def generate_settings_sql( + client_name: str, + client_name_fa: str, + catalog: dict[str, dict], + client_settings: dict[str, str | None], +) -> str: + lines: list[str] = [ + "-- =============================================================================", + f"-- {client_name_fa} — ادغام settings با کاتالوگ goldAliii", + "--", + f"-- منبع مقادیر: {client_name}_client.json", + f"-- قالب کلیدها: goldali ({len(catalog)} کلید)", + "--", + "-- قوانین:", + "-- • کلید مشترک → value از کلاینت، metadata از کاتالوگ", + "-- • کلید کاتالوگ بدون مقدار در کلاینت → value=''، is_active=0", + "-- • کلیدهای اضافی کلاینت → DELETE", + "--", + f"-- قبل از اجرا: USE دیتابیس {client_name_fa} + بکاپ", + "-- =============================================================================", + "", + "START TRANSACTION;", + "", + "SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;", + "", + "ALTER TABLE `settings`", + " MODIFY COLUMN `description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,", + " MODIFY COLUMN `title_fa` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,", + " MODIFY COLUMN `type` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL;", + "", + "-- 1) INSERT", + "", + ] + + catalog_keys = sorted(catalog.keys()) + + for key in catalog_keys: + meta = catalog[key] + val = client_settings.get(key) + if val is None: + val = "" + active = is_active_value(val if val != "" else None) + lines.append( + "INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)" + ) + lines.append( + f"SELECT {sql_str(key)}, {sql_str(val)}, {sql_str(meta['title_fa'])}, " + f"{meta['can_edit']}, {active}, {sql_str(meta['description'])}, {sql_str(meta['type'])}" + ) + lines.append(f"WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = {sql_str(key)} LIMIT 1);") + + lines.extend(["", "-- 2) UPDATE", ""]) + + for key in catalog_keys: + meta = catalog[key] + val = client_settings.get(key) + if val is None: + val = "" + active = is_active_value(val if val != "" else None) + lines.append("UPDATE `settings` SET") + lines.append(f" `title_fa` = {sql_str(meta['title_fa'])},") + lines.append(f" `can_edit` = {meta['can_edit']},") + lines.append(f" `type` = {sql_str(meta['type'])},") + lines.append(f" `description` = {sql_str(meta['description'])},") + lines.append(f" `value` = {sql_str(val)},") + lines.append(f" `is_active` = {active},") + lines.append(" `updated_at` = NOW()") + lines.append(f"WHERE `key` = {sql_str(key)};") + + lines.extend([ + "", + "-- 3) logo_login normalize", + "", + "DELETE FROM `settings`", + "WHERE `key` LIKE 'logo_login%' AND `key` <> 'logo_login'", + " AND EXISTS (SELECT 1 FROM (SELECT `id`, `key` FROM `settings`) AS `s` WHERE `s`.`key` = 'logo_login');", + "", + "UPDATE `settings` SET", + " `key` = 'logo_login',", + " `value` = TRIM(REPLACE(REPLACE(`value`, CHAR(13), ''), CHAR(10), '')),", + " `updated_at` = NOW()", + "WHERE `key` LIKE 'logo_login%' AND `key` <> 'logo_login';", + "", + "-- 4) DELETE extras", + "", + "DELETE FROM `settings`", + "WHERE `key` NOT IN (", + ]) + for i, key in enumerate(catalog_keys): + comma = "," if i < len(catalog_keys) - 1 else "" + lines.append(f" {sql_str(key)}{comma}") + lines.append(");") + lines.extend([ + "", + "DELETE FROM `settings` WHERE `key` = 'price_method';", + "", + "COMMIT;", + "", + ]) + return "\n".join(lines) + + +def generate_const_sql( + client_name: str, + client_name_fa: str, + client_const: dict[str, str | None], +) -> str: + lines: list[str] = [ + "-- =============================================================================", + f"-- {client_name_fa} — ادغام const با کاتالوگ goldAliii", + "--", + f"-- منبع مقادیر: {client_name}_client.json", + "-- قالب: 10 کلید goldali", + "-- =============================================================================", + "", + "START TRANSACTION;", + "", + "SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;", + "", + "ALTER TABLE `const`", + " MODIFY COLUMN `title_fa` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL;", + "", + "-- 1) INSERT", + "", + ] + + for item in CONST_CATALOG: + key = item["key"] + val = client_const.get(key) + if val is None: + val = item["default"] + lines.append("INSERT INTO `const` (`key`, `value`, `title_fa`)") + lines.append( + f"SELECT {sql_str(key)}, {sql_str(val)}, {sql_str(item['title_fa'])}" + ) + lines.append(f"WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = {sql_str(key)} LIMIT 1);") + + lines.extend(["", "-- 2) UPDATE", ""]) + + for item in CONST_CATALOG: + key = item["key"] + val = client_const.get(key) + if val is None: + val = item["default"] + lines.append("UPDATE `const` SET") + lines.append(f" `title_fa` = {sql_str(item['title_fa'])},") + lines.append(f" `value` = {sql_str(val)},") + lines.append(" `updated_at` = NOW()") + lines.append(f"WHERE `key` = {sql_str(key)};") + + allowed = [item["key"] for item in CONST_CATALOG] + lines.extend(["", "-- 3) DELETE extras", "", "DELETE FROM `const`", "WHERE `key` NOT IN ("]) + for i, key in enumerate(allowed): + comma = "," if i < len(allowed) - 1 else "" + lines.append(f" {sql_str(key)}{comma}") + lines.extend([");", "", "COMMIT;", ""]) + return "\n".join(lines) + + +def main() -> None: + if len(sys.argv) < 3: + print(__doc__) + sys.exit(1) + + client_json = Path(sys.argv[1]) + client_slug = sys.argv[2] + client_name_fa = sys.argv[3] if len(sys.argv) > 3 else client_slug + + catalog_text = CATALOG_SQL.read_text(encoding="utf-8") + catalog = parse_catalog_updates(catalog_text) + if not catalog: + print("ERROR: could not parse catalog from", CATALOG_SQL) + sys.exit(1) + + client_settings, client_const = load_client_rows(client_json) + + settings_sql = generate_settings_sql(client_slug, client_name_fa, catalog, client_settings) + const_sql = generate_const_sql(client_slug, client_name_fa, client_const) + + out_settings = SQL_DIR / f"{client_slug}_merge_goldali_catalog.sql" + out_const = SQL_DIR / f"{client_slug}_merge_goldali_const.sql" + out_settings.write_text(settings_sql, encoding="utf-8") + out_const.write_text(const_sql, encoding="utf-8") + + print(f"Wrote {out_settings} ({len(catalog)} keys)") + print(f"Wrote {out_const} ({len(CONST_CATALOG)} keys)") + + +if __name__ == "__main__": + main() diff --git a/database/sql/sources/abaeigold_client.json b/database/sql/sources/abaeigold_client.json new file mode 100644 index 0000000..bca5f85 --- /dev/null +++ b/database/sql/sources/abaeigold_client.json @@ -0,0 +1,85 @@ +{ + "const": [ + {"key": "main_product", "value": "13"}, + {"key": "header_banner", "value": null}, + {"key": "goldir", "value": null}, + {"key": "goldir_password", "value": null}, + {"key": "goldir_mobile", "value": null}, + {"key": "goldir_order_response", "value": null}, + {"key": "goldir_price", "value": null}, + {"key": "goldir_diff", "value": null}, + {"key": "goldir_mazaneh", "value": null}, + {"key": "goldir_truly_buy_mazaneh", "value": null}, + {"key": "goldir_truly_sell_mazaneh", "value": null}, + {"key": "log", "value": null}, + {"key": "last_order_log", "value": null}, + {"key": "jibit_counter", "value": "0"}, + {"key": "app_closed", "value": "false"} + ], + "settings": [ + {"key": "name_fa", "value": "عبایی گلد"}, + {"key": "name_en", "value": "abaei_gold"}, + {"key": "app_url", "value": "https://abaeigold.ir"}, + {"key": "bace_url", "value": "91.212.174.137"}, + {"key": "logo_login\r\n", "value": "logo_login\r\n"}, + {"key": "logo_register", "value": "logo_register"}, + {"key": "admin_url", "value": "https://abaeigold.ir/admin/"}, + {"key": "tahesab_token", "value": null}, + {"key": "tahesab_db", "value": null}, + {"key": "is_requaire_referral", "value": "true"}, + {"key": "has_page_earn_money", "value": "false"}, + {"key": "has_page_fund", "value": "true"}, + {"key": "has_page_permission", "value": "true"}, + {"key": "has_page_price_trigger", "value": "true"}, + {"key": "has_page_physical_gold", "value": "true"}, + {"key": "color_primary", "value": "#0A1B37"}, + {"key": "color_secondary", "value": "#0A1B37"}, + {"key": "fee_service_charge_percentage", "value": "0.005"}, + {"key": "has_chat", "value": "true"}, + {"key": "server_url", "value": "https://abaeigold.ir/api"}, + {"key": "key", "value": "abaeigold"}, + {"key": "liman_token", "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vMjEyLjIzLjIwMS4xNzMvc2VydmVyL2F1dGgvbG9naW4iLCJpYXQiOjE3Nzk2MzcxNTEsImV4cCI6MTc4MjIyOTE1MSwibmJmIjoxNzc5NjM3MTUxLCJqdGkiOiJFaHdqRXhiY2xDRmxsY25sIiwic3ViIjoiMzM0NiIsInBydiI6IjFkMGEwMjBhY2Y1YzRiNmM0OTc5ODlkZjFhYmYwZmJkNGU4YzhkNjMifQ.GQrsnIDkcHGeXQGdfoiv1xFEqqek0M05CMRK3zk-PAE"}, + {"key": "telegram_bot_token", "value": null}, + {"key": "fee_cash", "value": "500000"}, + {"key": "fee_single", "value": "500000"}, + {"key": "send_to_tahesab", "value": "false"}, + {"key": "fee_free", "value": "0"}, + {"key": "charge_notif", "value": "false"}, + {"key": "auto_active_customer", "value": "false"}, + {"key": "open_register", "value": "true"}, + {"key": "tabanGohar_price", "value": "false"}, + {"key": "main_product_price", "value": "false"}, + {"key": "tahesab_bank_account", "value": null}, + {"key": "referral_id", "value": "required"}, + {"key": "group_sms", "value": "false"}, + {"key": "bale_bot_token", "value": null}, + {"key": "jibit_verification", "value": "false"}, + {"key": "gift_for_referrer", "value": "0.005"}, + {"key": "display_montzar", "value": "true"}, + {"key": "referral_limit", "value": ""}, + {"key": "close_price", "value": "true"}, + {"key": "startDay", "value": "10:00"}, + {"key": "endDay", "value": "20:30"}, + {"key": "montzar_mobile", "value": "09901810700"}, + {"key": "montzar_password", "value": "09901810700"}, + {"key": "montzar_product_id", "value": "25"}, + {"key": "montzar_price", "value": "true"}, + {"key": "buy_fee", "value": "0"}, + {"key": "sell_fee", "value": "0"}, + {"key": "montzar_base_url", "value": "https://limangold.ir"}, + {"key": "montzar_token", "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2xpbWFuZ29sZC5pci9zZXJ2ZXIvYXV0aC9sb2dpbiIsImlhdCI6MTc4MDQ5MjE0MiwiZXhwIjoxNzgzMDg0MTQyLCJuYmYiOjE3ODA0OTIxNDIsImp0aSI6IkZyYWwzN09jMzB4SHJRM1MiLCJzdWIiOiIzMzQ2IiwicHJ2IjoiMWQwYTAyMGFjZjVjNGI2YzQ5Nzk4OWRmMWFiZjBmYmQ0ZThjOGQ2MyJ9.cw31HhaBYJtNvTNnJwctU1J5tGp1-FDtIQVSU67HZA8"}, + {"key": "montzar_closed", "value": "false"}, + {"key": "montzar_open_buy", "value": "true"}, + {"key": "montzar_open_sell", "value": "true"}, + {"key": "montzar_diff", "value": "300106.05286206"}, + {"key": "montzar_mazaneh", "value": "778600000"}, + {"key": "montzar_truly_buy_mazaneh", "value": "779900000"}, + {"key": "montzar_truly_sell_mazaneh", "value": "777300000"}, + {"key": "montzar_order_response", "value": "[]"}, + {"key": "montzar_last_product_log", "value": "{}"}, + {"key": "show_last_price", "value": "false"}, + {"key": "montzar_live_price", "value": "179740440.58339"}, + {"key": "product_update_price_on_list", "value": "true"}, + {"key": "product_auto_close_open_on_list", "value": "true"} + ] +}