feat(accounting): document colleague trades on configured accounts

Post Montzar-covered buy/sell to Zarin/Tahesab/Pargar using montzar_account_* settings, and harden public storage URL/MIME handling for uploads.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-26 16:59:27 +03:30
co-authored by Cursor
parent ad78545ebd
commit 885ed33e6e
10 changed files with 457 additions and 34 deletions
+25 -1
View File
@@ -281,6 +281,21 @@ INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `de
SELECT 'montzar_product_id', '25', 'کد محصول همکار', 1, 1, NULL
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`)
SELECT 'montzar_account_zarin', '', 'کد حساب همکار در زرین', 1, 1,
'کد حساب طرف‌حساب همکار در زرین؛ سند خرید/فروش پوشش‌شده روی همکار روی این حساب ثبت می‌شود.'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_account_zarin' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
SELECT 'montzar_account_tahesab', '', 'کد حساب همکار در ته‌حساب', 1, 1,
'کد حساب طرف‌حساب همکار در ته‌حساب؛ سند خرید/فروش پوشش‌شده روی همکار روی این حساب ثبت می‌شود.'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_account_tahesab' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
SELECT 'montzar_account_pargar', '', 'کد حساب همکار در پرگار', 1, 1,
'کد حساب طرف‌حساب همکار در پرگار؛ سند خرید/فروش پوشش‌شده روی همکار روی این حساب ثبت می‌شود.'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_account_pargar' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
SELECT 'montzar_base_url', 'https://limangold.ir', 'آدرس سرور همکار', 1, 1, NULL
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_base_url' LIMIT 1);
@@ -1301,7 +1316,9 @@ UPDATE `settings` SET `type` = 'text' WHERE `key` IN (
'server_url', 'key', 'main_product', 'zaarbox_api_url', 'zaarbox_price_key', 'chart_id',
'etehadie_api_url', 'montzar_mobile', 'montzar_password', 'montzar_base_url',
'montzar_token', 'montzar_diff', 'montzar_live_price', 'montzar_mazaneh',
'montzar_truly_buy_mazaneh', 'montzar_truly_sell_mazaneh', 'startDay', 'endDay',
'montzar_truly_buy_mazaneh', 'montzar_truly_sell_mazaneh',
'montzar_account_zarin', 'montzar_account_tahesab', 'montzar_account_pargar',
'startDay', 'endDay',
'payping_start_url', 'payping_verify_url', 'payping_gateway_items', 'payping_fin_url',
'payping_fin_token', 'tahesab_host', 'tahesab_token', 'tahesab_db',
'pargar_username', 'pargar_password', 'pargar_api_token',
@@ -1735,6 +1752,9 @@ UPDATE `settings` SET `description` = 'روشن: تطبیق کد ملی و مو
UPDATE `settings` SET `description` = 'شماره موبایل حساب API سرویس همکار قیمت. برای دریافت توکن و لیست محصولات.' WHERE `key` = 'montzar_mobile';
UPDATE `settings` SET `description` = 'رمز عبور حساب API سرویس همکار قیمت. محرمانه نگه دارید.' WHERE `key` = 'montzar_password';
UPDATE `settings` SET `description` = 'شناسه محصول آبشده در API همکار. باید با محصول مرجع در سرویس خارجی یکسان باشد.' WHERE `key` = 'montzar_product_id';
UPDATE `settings` SET `description` = 'کد حساب طرف‌حساب همکار در زرین؛ سند خرید/فروش پوشش‌شده روی همکار روی این حساب ثبت می‌شود.' WHERE `key` = 'montzar_account_zarin';
UPDATE `settings` SET `description` = 'کد حساب طرف‌حساب همکار در ته‌حساب؛ سند خرید/فروش پوشش‌شده روی همکار روی این حساب ثبت می‌شود.' WHERE `key` = 'montzar_account_tahesab';
UPDATE `settings` SET `description` = 'کد حساب طرف‌حساب همکار در پرگار؛ سند خرید/فروش پوشش‌شده روی همکار روی این حساب ثبت می‌شود.' WHERE `key` = 'montzar_account_pargar';
-- [super-admin can_edit=0]
-- UPDATE `settings` SET `description` = 'آدرس پایه سرور API همکار (بدون اسلش انتهایی). مثال: https://example.com' WHERE `key` = 'montzar_base_url';
UPDATE `settings` SET `description` = 'توکن دسترسی API همکار. پس از ورود موفق توسط سیستم پر می‌شود؛ دستی ویرایش نکنید.' WHERE `key` = 'montzar_token';
@@ -2060,6 +2080,9 @@ UPDATE `settings` SET `title_fa` = 'باز بودن فروش همکار' WHERE `
UPDATE `settings` SET `title_fa` = 'پاسخ سفارش همکار' WHERE `key` = 'montzar_order_response';
UPDATE `settings` SET `title_fa` = 'رمز API همکار' WHERE `key` = 'montzar_password';
UPDATE `settings` SET `title_fa` = 'کد محصول همکار' WHERE `key` = 'montzar_product_id';
UPDATE `settings` SET `title_fa` = 'کد حساب همکار در زرین' WHERE `key` = 'montzar_account_zarin';
UPDATE `settings` SET `title_fa` = 'کد حساب همکار در ته‌حساب' WHERE `key` = 'montzar_account_tahesab';
UPDATE `settings` SET `title_fa` = 'کد حساب همکار در پرگار' WHERE `key` = 'montzar_account_pargar';
UPDATE `settings` SET `title_fa` = 'توکن همکار (خودکار)' WHERE `key` = 'montzar_token';
UPDATE `settings` SET `title_fa` = 'مظنه خرید همکار' WHERE `key` = 'montzar_truly_buy_mazaneh';
UPDATE `settings` SET `title_fa` = 'مظنه فروش همکار' WHERE `key` = 'montzar_truly_sell_mazaneh';
@@ -2244,6 +2267,7 @@ UPDATE `settings` SET `can_edit` = 1 WHERE `key` IN (
'min_first_buy', 'min_withdraw', 'min_deposit', 'minimum_sell',
'montzar_mobile', 'montzar_open_buy', 'montzar_open_sell',
'montzar_password', 'montzar_product_id',
'montzar_account_zarin', 'montzar_account_tahesab', 'montzar_account_pargar',
'open_register',
'referral_id', 'referral_show', 'referral_limit', 'referral_gift_on_first_order', 'referral_gift_buy_from_montzar',
'register_jibit_verify', 'register_referral_bonus_message', 'register_referral_sms_to_referrer',