feat(admin): colleague accounting codes and reliable banner saves

Add per-provider Montzar account codes on the colleague transactions page, rename the menu label, and auto-persist banner uploads with https file URLs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-26 16:59:24 +03:30
co-authored by Cursor
parent 1c26ec3eaf
commit 3d63e2cf7f
12 changed files with 388 additions and 99 deletions
+2 -1
View File
@@ -325,7 +325,8 @@ const filteredRows = computed(() =>
if (!menu && !isSystemMode.value && TRADING_HOURS_SETTING_KEY_SET.has(row.key || '')) {
return false
}
if (isSystemMode.value) return true
// پیشرفته فقط can_edit=0؛ قابل‌ویرایش‌ها (مثل دسترسی مشتری) فقط در «تنظیمات»
if (isSystemMode.value) return !isEditable(row)
return isEditable(row)
})
)
@@ -36,7 +36,7 @@ export const EDITABLE_SETTING_GROUPS: SettingGroupDef[] = [
title: 'کارمزدها',
icon: 'vuesax-linear:dollar-circle',
match: (k) =>
/^(fee_|buy_fee|sell_fee|up_price|down_price|price_extreme_date)/.test(k) ||
/^(fee_|buy_fee|sell_fee)/.test(k) ||
k.includes('charge_percentage')
},
{
@@ -49,7 +49,8 @@ export const EDITABLE_SETTING_GROUPS: SettingGroupDef[] = [
id: 'price_source',
title: 'منبع قیمت و تابلو',
icon: 'vuesax-linear:chart-2',
match: (k) => /^(price_provider|zaarbox_|main_product$)/.test(k)
match: (k) =>
/^(chart_use_local_data|zaarbox_price_key|show_gold_ounce_price)$/.test(k)
},
{
id: 'content',
@@ -71,21 +72,16 @@ export const EDITABLE_SETTING_GROUPS: SettingGroupDef[] = [
title: 'همکار Montzar',
icon: 'vuesax-linear:link-2',
match: (k) =>
(k.startsWith('montzar_') && !['montzar_base_url', 'montzar_closed'].includes(k)) ||
k === 'display_montzar'
},
{
id: 'store',
title: 'سفارش خارجی',
icon: 'vuesax-linear:shop',
match: (k) => /^external_order/.test(k)
/^(montzar_mobile|montzar_open_buy|montzar_open_sell|montzar_password|montzar_product_id|display_montzar)$/.test(
k
)
},
{
id: 'deposit_methods',
title: 'روش‌های واریز',
icon: 'vuesax-linear:card-send',
match: (k) =>
k.startsWith('deposit_method_')
k === 'deposit_method_card_to_card'
|| k === 'deposit_account_holder'
|| k === 'deposit_card_number'
|| k === 'deposit_account_number'
@@ -101,21 +97,6 @@ export const EDITABLE_SETTING_GROUPS: SettingGroupDef[] = [
|| k === 'deposit_account_number'
|| k === 'deposit_sheba',
},
{
id: 'gateway',
title: 'درگاه پرداخت',
match: (k) => k === 'deposit_method_gateway',
},
{
id: 'identified',
title: 'شناسه واریز',
match: (k) => k === 'deposit_method_identified',
},
{
id: 'shetab',
title: 'شبکه شتابی',
match: (k) => k === 'deposit_method_shetab',
},
],
},
{
@@ -163,14 +144,15 @@ export const EDITABLE_SETTING_GROUPS: SettingGroupDef[] = [
}
]
/** گروه‌های صفحه دیپلوی — شامل تنظیمات can_edit=0 */
/** گروه‌های صفحه دیپلوی — فقط تنظیمات can_edit=0 (قابل‌ویرایش‌ها در EDITABLE_SETTING_GROUPS) */
export const SYSTEM_SETTING_GROUPS: SettingGroupDef[] = [
{
id: 'customer_features',
title: 'دسترسی مشتری به قابلیت‌ها',
icon: 'vuesax-linear:people',
// فقط فلگ‌های مالک سوپرادمین — banner/tracking/نمایش محصول در «تنظیمات» عادی‌اند
match: (k) =>
/^(enable_automation|enable_conditional_order|enable_product_funds|has_page_price_trigger|has_page_notification|has_page_gift_card|enable_customer_level_profit|banner_enabled|jibit_enabled|customer_direct_sms|has_page_earn_money|group_sms|customer_special_pricing|tracking_systems_enabled|permision__enabled|show_to_users_chat)$/.test(
/^(enable_automation|enable_conditional_order|enable_product_funds|has_page_price_trigger|has_page_notification|has_page_gift_card|enable_customer_level_profit|jibit_enabled|customer_direct_sms|has_page_earn_money|group_sms|customer_special_pricing|permision__enabled|show_to_users_chat)$/.test(
k
)
},
@@ -201,7 +183,7 @@ export const SYSTEM_SETTING_GROUPS: SettingGroupDef[] = [
title: 'منبع قیمت و تابلو',
icon: 'vuesax-linear:dollar-circle',
match: (k) =>
/^(price_provider|zaarbox_|main_product$)/.test(k) ||
/^(price_provider|zaarbox_|main_product$|up_price|down_price|price_extreme_date)$/.test(k) ||
k.includes('charge_percentage')
},
{
@@ -222,14 +204,28 @@ export const SYSTEM_SETTING_GROUPS: SettingGroupDef[] = [
icon: 'vuesax-linear:card-send',
match: (k) =>
k.startsWith('external_payment_')
|| k === 'wallet_payment_provider',
|| k === 'wallet_payment_provider'
|| k === 'deposit_method_gateway'
|| k === 'deposit_method_identified'
|| k === 'deposit_method_shetab',
subsections: [
{
id: 'gateway',
title: 'درگاه فروشگاه / پرداخت آنلاین',
match: (k) =>
k.startsWith('external_payment_')
|| k === 'wallet_payment_provider',
|| k === 'wallet_payment_provider'
|| k === 'deposit_method_gateway',
},
{
id: 'identified',
title: 'شناسه واریز',
match: (k) => k === 'deposit_method_identified',
},
{
id: 'shetab',
title: 'شبکه شتابی',
match: (k) => k === 'deposit_method_shetab',
},
],
},
@@ -175,23 +175,10 @@ export function supportMessengerIdPlaceholder(messenger?: string): string {
}
/**
* کلیدهایی که کد tenant مستقیم می‌نویسد — can_edit=1 در DB (خارج از سوپرادمین)،
* فقط در «تنظیمات پیشرفته» دیده می‌شوند و از UI قابل ویرایش نیستند.
* هم‌تراز SuperAdminProgramSettingsOverlay::RUNTIME_KEYS (+ tracking_systems جدا).
* کلیدهایی که کد tenant مستقیم می‌نویسد — از UI قابل ویرایش نیستند.
* هم‌تراز SuperAdminProgramSettingsOverlay::RUNTIME_KEYS.
*/
export const SETTING_CODE_MANAGED_KEYS = new Set([
'montzar_last_product_log',
'montzar_order_response',
'montzar_live_price',
'montzar_mazaneh',
'montzar_diff',
'montzar_truly_buy_mazaneh',
'montzar_truly_sell_mazaneh',
'montzar_token',
'montzar_closed',
'up_price',
'down_price',
'price_extreme_date',
'do_send_liman',
])
@@ -327,6 +314,9 @@ const KEY_TYPE_FALLBACK: Record<string, SettingFieldType> = {
gift_for_referral: 'number',
referral_bonus_amount: 'text',
montzar_product_id: 'number',
montzar_account_zarin: 'text',
montzar_account_tahesab: 'text',
montzar_account_pargar: 'text',
balance_report_exclude_customer_id: 'number',
jibit_verification: 'switch',
register_jibit_verify: 'switch',
@@ -775,6 +765,12 @@ const KEY_HELP_FALLBACK: Record<string, string> = {
'رمز عبور حساب اتصال به سرویس همکار قیمت. محرمانه نگه دارید.',
montzar_product_id:
'محصول مرجع آبشده در API همکار — از لیست محصولات همکار انتخاب کنید.',
montzar_account_zarin:
'کد حساب طرف‌حساب همکار در زرین؛ سند خرید/فروش پوشش‌شده روی همکار روی این حساب ثبت می‌شود.',
montzar_account_tahesab:
'کد حساب طرف‌حساب همکار در ته‌حساب؛ سند خرید/فروش پوشش‌شده روی همکار روی این حساب ثبت می‌شود.',
montzar_account_pargar:
'کد حساب طرف‌حساب همکار در پرگار؛ سند خرید/فروش پوشش‌شده روی همکار روی این حساب ثبت می‌شود.',
montzar_base_url:
'آدرس پایه سرور سرویس همکار (بدون اسلش انتهایی).',
zaarbox_api_url:
@@ -1081,6 +1077,9 @@ export const KEY_LABEL_FALLBACK: Record<string, string> = {
main_product: 'محصول مرجع قیمت',
montzar_open_buy: 'خرید از همکار',
montzar_open_sell: 'فروش از همکار',
montzar_account_zarin: 'کد حساب همکار در زرین',
montzar_account_tahesab: 'کد حساب همکار در ته‌حساب',
montzar_account_pargar: 'کد حساب همکار در پرگار',
external_order_api_enabled: 'API سفارش خارجی',
payping_fin_sync_enabled: 'همگام‌سازی با حسابداری مالی',
accounting_provider: 'سیستم حسابداری',
@@ -1131,12 +1130,21 @@ export const KEY_LABEL_FALLBACK: Record<string, string> = {
change_mesghal: 'وزن مثقال (گرم)'
}
/** غیرقابل ویرایش در پنل — هم‌تراز deploy_settings_const.sql */
/** غیرقابل ویرایش در پنل عادی (can_edit=0) — در تنظیمات پیشرفته قابل ویرایش (ادمین دیپلوی) */
export const SETTING_LOCKED_KEYS = new Set([
'admin_url', 'apk_download_link', 'app_url',
'bale_bot_token', 'banner_enabled',
'chart_id', 'chart_use_local_data',
'external_order_api_enabled',
'chart_id',
'up_price', 'down_price', 'price_extreme_date',
'main_product', 'price_provider', 'zaarbox_api_url',
'montzar_base_url', 'montzar_diff', 'montzar_closed', 'montzar_order_response',
'montzar_token', 'montzar_live_price', 'montzar_last_product_log',
'montzar_truly_buy_mazaneh', 'montzar_truly_sell_mazaneh', 'montzar_mazaneh',
'node_client_id', 'node_shared_secret', 'external_order_api_enabled',
'deposit_method_gateway', 'deposit_method_identified', 'deposit_method_shetab',
'payping_verify_url', 'payping_start_url', 'payping_strict_failed_withdraw',
'payping_fin_token', 'payping_round_toman', 'payping_gateway_items',
'payping_gateway_name', 'payping_fin_customer_id', 'payping_fin_url',
'external_payment_enabled',
'external_payment_base_url',
'external_payment_client_id',
@@ -1162,15 +1170,11 @@ export const SETTING_LOCKED_KEYS = new Set([
'is_store',
'sms_panel',
'logo_login', 'logo_register', 'title_pwa', 'title_fav',
'main_product', 'main_wallet_products', 'metal_type', 'main_metal',
'main_wallet_products', 'metal_type', 'main_metal',
'montify_name',
'montzar_base_url',
'node_client_id', 'node_shared_secret',
'payping_fin_customer_id', 'payping_fin_sync_enabled', 'payping_fin_token', 'payping_fin_url',
'payping_gateway_items', 'payping_gateway_name',
'payping_round_toman', 'payping_start_url', 'payping_strict_failed_withdraw', 'payping_verify_url',
'payping_fin_sync_enabled',
'permision__enabled',
'price_provider', 'profit_gold_api_enabled',
'profit_gold_api_enabled',
'send_to_tahesab', 'send_to_pargar', 'accounting_provider',
'sse_path',
'tahesab_bank_account', 'tahesab_db', 'tahesab_host', 'tahesab_port', 'tahesab_token',
@@ -1183,15 +1187,15 @@ export const SETTING_LOCKED_KEYS = new Set([
'price_channel_bale_to', 'price_channel_telegram_to', 'price_channel_rubika_to',
'unit',
'wss_enabled',
'zaarbox_api_url',
'show_to_users_chat', 'chat_api', 'chat_api_key', 'chat_upload_url', 'chat_download_url'
])
/** قابل ویرایش در پنل — هم‌تراز deploy_settings_const.sql */
/** قابل ویرایش در پنل عادی — هم‌تراز deploy_settings_const.sql */
export const SETTING_EDITABLE_KEYS = new Set([
'name_fa',
'auto_active_customer', 'balance_report_exclude_customer_id',
'buy_fee', 'charge_notif', 'close_price',
'chart_use_local_data',
'require_zero_main_gold_before_other_buy',
'sms_notif_order_admin', 'sms_notif_order_customer',
'sms_notif_withdraw_admin', 'sms_notif_withdraw_otp', 'sms_notif_login_otp',
@@ -1201,7 +1205,7 @@ export const SETTING_EDITABLE_KEYS = new Set([
'sms_notif_price_trigger', 'sms_notif_wallet_alert', 'sms_notif_support_admin',
'deposit_sms_support_number', 'deposit_support_message_text',
'deposit_account_holder', 'deposit_card_number', 'deposit_account_number', 'deposit_sheba',
'deposit_method_card_to_card', 'deposit_method_gateway', 'deposit_method_identified', 'deposit_method_shetab',
'deposit_method_card_to_card',
'endDay',
'fee_free', 'fee_service_charge_percentage',
'gift_for_referral', 'gift_for_referrer',
@@ -1211,9 +1215,7 @@ export const SETTING_EDITABLE_KEYS = new Set([
'min_first_buy', 'min_withdraw', 'min_deposit', 'minimum_sell',
'montzar_mobile', 'montzar_open_buy', 'montzar_open_sell',
'montzar_password', 'montzar_product_id',
'montzar_closed', 'montzar_diff', 'montzar_last_product_log', 'montzar_live_price', 'montzar_mazaneh',
'montzar_order_response', 'montzar_token',
'montzar_truly_buy_mazaneh', 'montzar_truly_sell_mazaneh',
'montzar_account_zarin', 'montzar_account_tahesab', 'montzar_account_pargar',
'open_register',
'referral_id', 'referral_limit', 'referral_gift_on_first_order', 'referral_gift_buy_from_montzar',
'register_jibit_verify', 'register_referral_bonus_message', 'register_referral_sms_to_referrer',
@@ -1222,10 +1224,8 @@ export const SETTING_EDITABLE_KEYS = new Set([
'products_site_link_enabled', 'products_site_link_url', 'products_site_link_text',
'startDay',
'support_messengers', 'support_messenger_text',
'up_price', 'down_price', 'price_extreme_date', 'do_send_liman',
'do_send_liman',
'has_chat',
'deposit_support_message_text', 'deposit_account_holder', 'deposit_card_number', 'deposit_account_number', 'deposit_sheba',
'deposit_method_card_to_card', 'deposit_method_gateway', 'deposit_method_identified', 'deposit_method_shetab',
'text_about', 'text_rule', 'about_software', 'enamad_url', 'enamad_logo',
'zaarbox_price_key',
'price_channel_enabled', 'price_channel_messengers', 'price_channel_diff',