Add customer multi-level referral profit editor and related settings UI.
Expose enable_customer_level_profit in config and let admins edit per-customer level percents from the customers table/mobile sheets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1707,7 +1707,7 @@ export const bootstrapAdminChat = async (
|
||||
bootstrapPromise = (async () => {
|
||||
try {
|
||||
void postAdminChatEnsureWebhook().catch((error) => {
|
||||
console.error('admin chat ensure webhook failed:', error)
|
||||
console.warn('admin chat ensure webhook failed:', error)
|
||||
})
|
||||
|
||||
await fetchAdminRooms()
|
||||
|
||||
@@ -49,6 +49,9 @@ export const conditionalOrderEnabledSetting = ref(false)
|
||||
/** reactive — قلک per-product در اپ مشتری */
|
||||
export const productFundsEnabledSetting = ref(false)
|
||||
|
||||
/** reactive — سود چندسطحی معرف در لیست مشتریان */
|
||||
export const customerLevelProfitEnabledSetting = ref(false)
|
||||
|
||||
/** reactive — منو و UI هشدار قیمت */
|
||||
export const priceTriggerEnabledSetting = ref(false)
|
||||
|
||||
@@ -154,6 +157,10 @@ export function setProductFundsEnabledFromSettings(value: boolean): void {
|
||||
productFundsEnabledSetting.value = value
|
||||
}
|
||||
|
||||
export function setCustomerLevelProfitEnabledFromSettings(value: boolean): void {
|
||||
customerLevelProfitEnabledSetting.value = value
|
||||
}
|
||||
|
||||
export function setPriceTriggerEnabledFromSettings(value: boolean): void {
|
||||
priceTriggerEnabledSetting.value = value
|
||||
}
|
||||
@@ -257,6 +264,13 @@ export function applyProductFundsEnabledFromRows(
|
||||
if (row) setProductFundsEnabledFromSettings(isSwitchOn(row.value))
|
||||
}
|
||||
|
||||
export function applyCustomerLevelProfitEnabledFromRows(
|
||||
rows: Array<{ key?: string; value?: string | null }>
|
||||
) {
|
||||
const row = rows.find((item) => item.key === 'enable_customer_level_profit')
|
||||
if (row) setCustomerLevelProfitEnabledFromSettings(isSwitchOn(row.value))
|
||||
}
|
||||
|
||||
export function applyPriceTriggerEnabledFromRows(
|
||||
rows: Array<{ key?: string; value?: string | null }>
|
||||
) {
|
||||
@@ -305,6 +319,7 @@ async function bootstrapSettingsFromApi(): Promise<void> {
|
||||
applyCustomerDirectSmsFromRows(list)
|
||||
applyConditionalOrderEnabledFromRows(list)
|
||||
applyProductFundsEnabledFromRows(list)
|
||||
applyCustomerLevelProfitEnabledFromRows(list)
|
||||
applyPriceTriggerEnabledFromRows(list)
|
||||
applyAppNotificationEnabledFromRows(list)
|
||||
applySupportChatMenuEnabledFromRows(list)
|
||||
|
||||
Reference in New Issue
Block a user