added setting for users

This commit is contained in:
2026-08-16 22:00:48 +03:30
parent 84b0a4767a
commit 17dea2a52f
13 changed files with 635 additions and 29 deletions
+15
View File
@@ -58,6 +58,9 @@ export const priceTriggerEnabledSetting = ref(false)
/** reactive — دکمه ارسال پیامک گروهی در صفحه پیامک‌ها */
export const groupSmsEnabledSetting = ref(false)
/** reactive — زیرمنوی قیمت ویژه مشتری */
export const customerSpecialPricingEnabledSetting = ref(false)
/** reactive — منو و زنگوله اعلان داخل اپ */
export const appNotificationEnabledSetting = ref(true)
@@ -156,6 +159,10 @@ export function setGroupSmsEnabledFromSettings(value: boolean): void {
groupSmsEnabledSetting.value = value
}
export function setCustomerSpecialPricingEnabledFromSettings(value: boolean): void {
customerSpecialPricingEnabledSetting.value = value
}
export function setConditionalOrderEnabledFromSettings(value: boolean): void {
conditionalOrderEnabledSetting.value = value
}
@@ -262,6 +269,13 @@ export function applyGroupSmsFromRows(rows: Array<{ key?: string; value?: string
if (row) setGroupSmsEnabledFromSettings(isSwitchOn(row.value))
}
export function applyCustomerSpecialPricingFromRows(
rows: Array<{ key?: string; value?: string | null }>
) {
const row = rows.find((item) => item.key === 'customer_special_pricing')
if (row) setCustomerSpecialPricingEnabledFromSettings(isSwitchOn(row.value))
}
export function applyConditionalOrderEnabledFromRows(
rows: Array<{ key?: string; value?: string | null }>
) {
@@ -330,6 +344,7 @@ async function bootstrapSettingsFromApi(): Promise<void> {
applyTrackingSystemsEnabledFromRows(list)
applyCustomerDirectSmsFromRows(list)
applyGroupSmsFromRows(list)
applyCustomerSpecialPricingFromRows(list)
applyConditionalOrderEnabledFromRows(list)
applyProductFundsEnabledFromRows(list)
applyCustomerLevelProfitEnabledFromRows(list)