122 lines
3.4 KiB
JavaScript
122 lines
3.4 KiB
JavaScript
export const FINANCE_PERMISSIONS = {
|
|
auditApplication: "finance-application:audit",
|
|
auditWithdrawalApplications: "finance-withdrawal:audit",
|
|
createApplication: "finance-application:create",
|
|
createCoinSellerRechargeOrder: "finance-order:coin-seller-recharge:create",
|
|
grantCoinSellerRechargeOrder: "finance-order:coin-seller-recharge:grant",
|
|
verifyCoinSellerRechargeOrder: "finance-order:coin-seller-recharge:verify",
|
|
viewCoinSellerRechargeOrders: "finance-order:coin-seller-recharge:view",
|
|
viewAppRechargeDetails: "payment-bill:view",
|
|
viewWithdrawalApplications: "finance-withdrawal:view",
|
|
};
|
|
|
|
export const FINANCE_OPERATIONS = [
|
|
{
|
|
allowsZeroRechargeAmount: true,
|
|
label: "增加用户金币",
|
|
permissionCode: "finance-operation:user-coin-credit",
|
|
value: "user_coin_credit",
|
|
},
|
|
{
|
|
allowsZeroRechargeAmount: true,
|
|
label: "减少用户金币",
|
|
permissionCode: "finance-operation:user-coin-debit",
|
|
value: "user_coin_debit",
|
|
},
|
|
{
|
|
label: "用户钱包扣减",
|
|
permissionCode: "finance-operation:user-wallet-debit",
|
|
requiresWalletIdentity: true,
|
|
value: "user_wallet_debit",
|
|
},
|
|
{
|
|
label: "用户钱包增加",
|
|
permissionCode: "finance-operation:user-wallet-credit",
|
|
requiresWalletIdentity: true,
|
|
value: "user_wallet_credit",
|
|
},
|
|
{
|
|
label: "增加币商金币",
|
|
permissionCode: "finance-operation:coin-seller-coin-credit",
|
|
value: "coin_seller_coin_credit",
|
|
},
|
|
{
|
|
label: "减少币商金币",
|
|
permissionCode: "finance-operation:coin-seller-coin-debit",
|
|
value: "coin_seller_coin_debit",
|
|
},
|
|
];
|
|
|
|
export const WALLET_IDENTITIES = [
|
|
["host", "Host 钱包"],
|
|
["agency", "Agency 钱包"],
|
|
["bd", "BD 钱包"],
|
|
];
|
|
|
|
export const APPLICATION_STATUS = [
|
|
["pending", "待审核"],
|
|
["approved", "已通过"],
|
|
["rejected", "已拒绝"],
|
|
];
|
|
|
|
export const COIN_SELLER_RECHARGE_PROVIDERS = [
|
|
["mifapay", "MiFaPay"],
|
|
["v5pay", "V5Pay"],
|
|
["usdt", "USDT"],
|
|
];
|
|
|
|
export const COIN_SELLER_RECHARGE_CHAINS = [
|
|
["TRON", "TRON"],
|
|
["BSC", "BSC"],
|
|
];
|
|
|
|
export const COIN_SELLER_RECHARGE_STATUS = [
|
|
["pending", "待处理"],
|
|
["verified", "已校验"],
|
|
["granted", "已发放"],
|
|
["failed", "失败"],
|
|
["canceled", "已取消"],
|
|
];
|
|
|
|
export const COIN_SELLER_RECHARGE_VERIFY_STATUS = [
|
|
["pending", "待校验"],
|
|
["verified", "校验通过"],
|
|
["failed", "校验失败"],
|
|
];
|
|
|
|
export const COIN_SELLER_RECHARGE_GRANT_STATUS = [
|
|
["pending", "待发放"],
|
|
["granted", "已发放"],
|
|
["failed", "发放失败"],
|
|
];
|
|
|
|
export const DEFAULT_APPLICATION_FORM = {
|
|
appCode: "",
|
|
coinAmount: "",
|
|
credentialImageUrl: "",
|
|
credentialText: "",
|
|
operation: "",
|
|
rechargeAmount: "",
|
|
targetUserId: "",
|
|
walletIdentity: "",
|
|
};
|
|
|
|
export const DEFAULT_COIN_SELLER_RECHARGE_ORDER_FORM = {
|
|
appCode: "",
|
|
chain: "",
|
|
coinAmount: "",
|
|
externalOrderNo: "",
|
|
providerCode: "mifapay",
|
|
remark: "",
|
|
targetUserId: "",
|
|
usdAmount: "",
|
|
};
|
|
|
|
export function operationRequiresWalletIdentity(operation) {
|
|
return FINANCE_OPERATIONS.some((item) => item.value === operation && item.requiresWalletIdentity);
|
|
}
|
|
|
|
export function operationAllowsZeroRechargeAmount(operation) {
|
|
return FINANCE_OPERATIONS.some((item) => item.value === operation && item.allowsZeroRechargeAmount);
|
|
}
|