feat(order): wait for colleague callback before settling wallet

Keep cover orders pending until colleague sts 2/4/6 via callback or 35s poll. Nightly prices:prune also drops old log tables.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-02 15:55:03 +03:30
co-authored by Cursor
parent e9674d6571
commit 0b1e5c687b
13 changed files with 1093 additions and 105 deletions
+16 -2
View File
@@ -346,6 +346,18 @@ INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `de
SELECT 'montzar_open_sell', 'true', 'باز بودن فروش همکار', 1, 1, NULL
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_order_wait_callback', 'true', 'انتظار کالبک سفارش همکار', 1, 1,
'روشن: سفارش همکار تا دریافت کالبک (یا استعلام مسیر وضعیت) در انتظار می‌ماند و کیف ثبت نمی‌شود. خاموش: مثل قبل بلافاصله با پاسخ HTTP همکار قطعی می‌شود.',
'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_order_wait_callback' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'montzar_order_status_path', '/server/customer/order', 'مسیر استعلام وضعیت سفارش همکار', 1, 1,
'مسیر GET روی سرور همکار (montzar_base_url). شماره سفارش همکار به انتها اضافه می‌شود؛ مثلاً /server/customer/order/40000.',
'text'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_order_status_path' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
SELECT 'montzar_diff', '0', 'اختلاف قیمت همکار', 1, 1, 'سیستم پر می‌کند'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_diff' LIMIT 1);
@@ -1357,7 +1369,7 @@ UPDATE `settings` SET `type` = 'switch' WHERE `key` IN (
'sms_notif_jibit_admin', 'sms_notif_bank_card_admin', 'sms_notif_bank_card_customer',
'sms_notif_fund_withdraw_admin', 'sms_notif_fund_withdraw_customer',
'sms_notif_price_trigger', 'sms_notif_wallet_alert', 'sms_notif_support_admin',
'montzar_closed', 'montzar_open_buy', 'montzar_open_sell',
'montzar_closed', 'montzar_open_buy', 'montzar_open_sell', 'montzar_order_wait_callback',
'payping_fin_sync_enabled', 'external_order_api_enabled', 'is_store', 'wss_enabled', 'tracking_systems_enabled',
'register_referral_sms_to_referrer', 'register_referral_bonus_message',
'referral_gift_on_first_order', 'referral_gift_buy_from_montzar',
@@ -1386,6 +1398,7 @@ UPDATE `settings` SET `type` = 'text' WHERE `key` IN (
'name_fa', 'name_en', 'app_url', 'bace_url', 'logo_login', 'logo_register', 'admin_url', 'title_pwa', 'title_fav',
'server_url', 'key', 'main_product', 'zaarbox_api_url', 'zaarbox_price_key', 'chart_id',
'etehadie_api_url', 'montzar_mobile', 'montzar_password', 'montzar_base_url',
'montzar_order_status_path',
'montzar_token', 'montzar_diff', 'montzar_live_price', 'montzar_mazaneh',
'montzar_truly_buy_mazaneh', 'montzar_truly_sell_mazaneh',
'montzar_account_zarin', 'montzar_account_tahesab', 'montzar_account_pargar',
@@ -2384,7 +2397,8 @@ UPDATE `settings` SET `can_edit` = 1 WHERE `key` IN (
'jibit_verification',
'main_product_price',
'min_first_buy', 'min_withdraw', 'min_deposit', 'minimum_sell',
'montzar_mobile', 'montzar_open_buy', 'montzar_open_sell',
'montzar_mobile', 'montzar_open_buy', 'montzar_open_sell', 'montzar_order_wait_callback',
'montzar_order_status_path',
'montzar_password', 'montzar_product_id',
'montzar_account_zarin', 'montzar_account_tahesab', 'montzar_account_pargar',
'open_register',