feat(api, i18n): add agent_node_id to various admin queries and enhance multi-language support
Introduced the agent_node_id field in AdminDrawListQuery, AdminPlayerListQuery, AdminSettlementBatchListQuery, TicketItemsListQuery, and TransferOrderListQuery to improve filtering capabilities. Updated the admin-breadcrumb and admin-sidebar components to include new translations for agent-related terms in English, Nepali, and Chinese, enhancing the overall user experience and multi-language support across the admin interface.
This commit is contained in:
44
src/lib/admin-settlement-settings-cache.ts
Normal file
44
src/lib/admin-settlement-settings-cache.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { getAdminSettings } from "@/api/admin-settings";
|
||||
|
||||
const SETTLEMENT_GROUP = "settlement";
|
||||
const APPLY_REBATE_TO_PAYOUT_KEY = "settlement.apply_rebate_to_payout";
|
||||
|
||||
let cachedApplyRebateToPayout: boolean | null = null;
|
||||
let inflight: Promise<boolean> | null = null;
|
||||
|
||||
export function peekApplyRebateToPayoutSetting(): boolean | null {
|
||||
return cachedApplyRebateToPayout;
|
||||
}
|
||||
|
||||
export function setCachedApplyRebateToPayoutSetting(value: boolean): void {
|
||||
cachedApplyRebateToPayout = value;
|
||||
}
|
||||
|
||||
export function clearCachedSettlementSettings(): void {
|
||||
cachedApplyRebateToPayout = null;
|
||||
inflight = null;
|
||||
}
|
||||
|
||||
/** 读取「派彩时再扣回水」开关(模块级缓存,避免配置页重复 GET settings) */
|
||||
export async function loadApplyRebateToPayoutSetting(): Promise<boolean> {
|
||||
if (cachedApplyRebateToPayout !== null) {
|
||||
return cachedApplyRebateToPayout;
|
||||
}
|
||||
if (inflight !== null) {
|
||||
return inflight;
|
||||
}
|
||||
|
||||
inflight = getAdminSettings(SETTLEMENT_GROUP)
|
||||
.then((res) => {
|
||||
const hit = res.items.find((item) => item.key === APPLY_REBATE_TO_PAYOUT_KEY);
|
||||
const value = Boolean(hit?.value ?? false);
|
||||
cachedApplyRebateToPayout = value;
|
||||
return value;
|
||||
})
|
||||
.catch(() => false)
|
||||
.finally(() => {
|
||||
inflight = null;
|
||||
});
|
||||
|
||||
return inflight;
|
||||
}
|
||||
Reference in New Issue
Block a user