feat(financial): add enable/disable toggle for shelter animal charity and round-up donation
This commit is contained in:
1 parent
e7ded849f6
commit
204350eff8
18 files changed
+11235
-11034
No files matched your search
@@ -20,6 +20,7 @@ export const DEFAULT_UI_TEXTS: Record<string, string> = {
|
||||
CATALOG_SHOW_ORDERS: 'false',
|
||||
CATALOG_SHOW_WALLET: 'false',
|
||||
CATALOG_SHOW_CHARITY: 'false',
|
||||
CHARITY_DONATION_ENABLED: 'true',
|
||||
PRESCRIPTION_UPLOAD_ENABLED: 'true',
|
||||
ORDER_DISABLED_TITLE: 'امکان ثبت سفارش آنلاین موقتاً غیرفعال است',
|
||||
ORDER_DISABLED_MESSAGE:
|
||||
|
||||
@@ -100,6 +100,10 @@ export const CANONICAL_ALIASES: Record<string, string[]> = {
|
||||
charity_round_step: ['CHARITY_ROUND_STEP', 'charityRoundStep'],
|
||||
charityRoundStep: ['CHARITY_ROUND_STEP', 'charity_round_step'],
|
||||
|
||||
CHARITY_DONATION_ENABLED: ['charity_donation_enabled', 'charityDonationEnabled'],
|
||||
charity_donation_enabled: ['CHARITY_DONATION_ENABLED', 'charityDonationEnabled'],
|
||||
charityDonationEnabled: ['CHARITY_DONATION_ENABLED', 'charity_donation_enabled'],
|
||||
|
||||
// Zibal Gateway & Tokens
|
||||
ZIBAL_EBANK_TOKEN: [
|
||||
'zibal_ebank_token',
|
||||
@@ -344,6 +348,10 @@ export class SettingsService implements OnModuleInit {
|
||||
map.get('charityRoundStep') ||
|
||||
'10000',
|
||||
);
|
||||
const charityDonationEnabled =
|
||||
map.get('CHARITY_DONATION_ENABLED') !== 'false' &&
|
||||
map.get('charity_donation_enabled') !== 'false' &&
|
||||
map.get('charityDonationEnabled') !== 'false';
|
||||
const walletWithdrawalEnabled =
|
||||
map.get('walletWithdrawalEnabled') === 'true';
|
||||
|
||||
@@ -354,6 +362,7 @@ export class SettingsService implements OnModuleInit {
|
||||
taxPercentage,
|
||||
b2bDiscountPercent,
|
||||
charityRoundStep,
|
||||
charityDonationEnabled,
|
||||
charityDonationOptions: [10000, 20000, 50000],
|
||||
walletWithdrawalEnabled,
|
||||
};
|
||||
@@ -397,6 +406,12 @@ export class SettingsService implements OnModuleInit {
|
||||
updates['charity_round_step'] = String(data.charityRoundStep);
|
||||
updates['charityRoundStep'] = String(data.charityRoundStep);
|
||||
}
|
||||
if (data.charityDonationEnabled !== undefined) {
|
||||
const boolStr = String(data.charityDonationEnabled);
|
||||
updates['CHARITY_DONATION_ENABLED'] = boolStr;
|
||||
updates['charity_donation_enabled'] = boolStr;
|
||||
updates['charityDonationEnabled'] = boolStr;
|
||||
}
|
||||
if (data.walletWithdrawalEnabled !== undefined) {
|
||||
updates['walletWithdrawalEnabled'] = String(data.walletWithdrawalEnabled);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user