Files
lotteryAdmin/src/api/admin-wallet.ts
kang b15e377187 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.
2026-06-02 14:37:08 +08:00

105 lines
2.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { adminRequest } from "@/lib/admin-http";
import type {
AdminPlayerWalletsData,
AdminTransferOrderListData,
AdminWalletTxnListData,
} from "@/types/api/admin-wallet";
const A = `/admin`;
export type TransferOrderListQuery = {
page?: number;
per_page?: number;
player_id?: number;
/** 模糊site_player_id / username */
player_account?: string;
transfer_no?: string;
external_ref_no?: string;
created_from?: string;
created_to?: string;
status?: string;
/** 仅异常processing / failed / pending_reconcile */
abnormal?: boolean;
site_code?: string;
agent_node_id?: number;
};
export async function getAdminTransferOrders(
q: TransferOrderListQuery = {},
): Promise<AdminTransferOrderListData> {
return adminRequest.get<AdminTransferOrderListData>(
`${A}/wallet/transfer-orders`,
{ params: q },
);
}
export type WalletTransactionListQuery = {
page?: number;
per_page?: number;
player_id?: number;
player_account?: string;
txn_no?: string;
external_ref_no?: string;
created_from?: string;
created_to?: string;
biz_type?: string;
status?: string;
abnormal?: boolean;
site_code?: string;
agent_node_id?: number;
};
export async function getAdminWalletTransactions(
q: WalletTransactionListQuery = {},
): Promise<AdminWalletTxnListData> {
return adminRequest.get<AdminWalletTxnListData>(
`${A}/wallet/transactions`,
{ params: q },
);
}
export async function getAdminPlayerWallets(
playerId: number,
): Promise<AdminPlayerWalletsData> {
return adminRequest.get<AdminPlayerWalletsData>(
`${A}/players/${playerId}/wallets`,
);
}
export type TransferOrderActionResult = {
transfer_no: string;
status: string;
};
export async function reverseTransferOrder(
transferNo: string,
remark?: string,
): Promise<TransferOrderActionResult> {
return adminRequest.post<TransferOrderActionResult>(
`${A}/wallet/transfer-orders/${transferNo}/reverse`,
remark ? { remark } : {},
);
}
export async function manuallyProcessTransferOrder(
transferNo: string,
remark?: string,
): Promise<TransferOrderActionResult> {
return adminRequest.post<TransferOrderActionResult>(
`${A}/wallet/transfer-orders/${transferNo}/manually-process`,
remark ? { remark } : {},
);
}
export async function completeTransferInCredit(
transferNo: string,
remark?: string,
): Promise<TransferOrderActionResult> {
return adminRequest.post<TransferOrderActionResult>(
`${A}/wallet/transfer-orders/${transferNo}/complete-credit`,
remark ? { remark } : {},
);
}