feat(customers): add Digipay installment admin section

Wire routes, settings groups, page access, and customer UI for installment management.
This commit is contained in:
2026-10-21 03:38:59 -04:00
parent e5b3d0c931
commit 88271dba2a
7 changed files with 129 additions and 1 deletions
+16
View File
@@ -80,6 +80,9 @@ export const customerSpecialPricingEnabledSetting = ref(false)
/** reactive — زیرمنوی اعتبار طلایی در مشتریان */
export const goldCreditEnabledSetting = ref(false)
/** reactive — زیرمنوی خرید اقساطی دیجی‌پی */
export const digipayInstallmentEnabledSetting = ref(false)
/** reactive — منو و زنگوله اعلان داخل اپ */
export const appNotificationEnabledSetting = ref(true)
@@ -185,6 +188,10 @@ export function setCustomerSpecialPricingEnabledFromSettings(value: boolean): vo
customerSpecialPricingEnabledSetting.value = value
}
export function setDigipayInstallmentEnabledFromSettings(value: boolean): void {
digipayInstallmentEnabledSetting.value = value
}
export function setGoldCreditEnabledFromSettings(value: boolean): void {
goldCreditEnabledSetting.value = value
}
@@ -314,6 +321,13 @@ export function applyCustomerSpecialPricingFromRows(
if (row) setCustomerSpecialPricingEnabledFromSettings(isSwitchOn(row.value))
}
export function applyDigipayInstallmentEnabledFromRows(
rows: Array<{ key?: string; value?: string | null }>
) {
const row = rows.find((item) => item.key === 'enable_digipay_installment')
if (row) setDigipayInstallmentEnabledFromSettings(isSwitchOn(row.value))
}
export function applyGoldCreditEnabledFromRows(
rows: Array<{ key?: string; value?: string | null }>
) {
@@ -340,6 +354,7 @@ export function applySuperAdminAccessFlagsFromItems(
applyGroupSmsFromRows(rows)
applyCustomerSpecialPricingFromRows(rows)
applyGoldCreditEnabledFromRows(rows)
applyDigipayInstallmentEnabledFromRows(rows)
applyConditionalOrderEnabledFromRows(rows)
applyAutomationEnabledFromRows(rows)
applyProductFundsEnabledFromRows(rows)
@@ -442,6 +457,7 @@ async function bootstrapSettingsFromApi(): Promise<void> {
applyGroupSmsFromRows(list)
applyCustomerSpecialPricingFromRows(list)
applyGoldCreditEnabledFromRows(list)
applyDigipayInstallmentEnabledFromRows(list)
applyConditionalOrderEnabledFromRows(list)
applyAutomationEnabledFromRows(list)
applyProductFundsEnabledFromRows(list)