feat(admin+api+player): 优胜赛结算态、禁止新增单场与钱包流水展示优化
- API/管理端:优胜赛 SETTLED 后禁止新增单场,列表与子页展示结算状态 - 玩家端:已结算 outright 只读展示并高亮冠军 - 管理端:结算后 stale 标记驱动列表刷新;财务流水时间与备注 i18n 优化 - shared:txDisplayAmount 与 LEAGUE_OUTRIGHT_SETTLED 错误码
This commit is contained in:
@@ -112,6 +112,11 @@ export const API_ERROR_MESSAGES = {
|
||||
'en-US': 'Cannot unpublish league after outright market is settled',
|
||||
'ms-MY': 'Liga tidak boleh ditarik selepas pasaran juara diselesaikan',
|
||||
},
|
||||
LEAGUE_OUTRIGHT_SETTLED: {
|
||||
'zh-CN': '优胜赛已结算,不可再新增单场',
|
||||
'en-US': 'Outright market is settled; new fixtures cannot be added',
|
||||
'ms-MY': 'Pasaran juara telah diselesaikan; perlawanan baharu tidak boleh ditambah',
|
||||
},
|
||||
MATCH_UNPUBLISH_FORBIDDEN: {
|
||||
'zh-CN': '当前状态不可下架',
|
||||
'en-US': 'Match cannot be unpublished in current status',
|
||||
|
||||
@@ -114,6 +114,11 @@ export const API_ERROR_MESSAGES = {
|
||||
'en-US': 'Cannot unpublish league after outright market is settled',
|
||||
'ms-MY': 'Liga tidak boleh ditarik selepas pasaran juara diselesaikan',
|
||||
},
|
||||
LEAGUE_OUTRIGHT_SETTLED: {
|
||||
'zh-CN': '优胜赛已结算,不可再新增单场',
|
||||
'en-US': 'Outright market is settled; new fixtures cannot be added',
|
||||
'ms-MY': 'Pasaran juara telah diselesaikan; perlawanan baharu tidak boleh ditambah',
|
||||
},
|
||||
MATCH_UNPUBLISH_FORBIDDEN: {
|
||||
'zh-CN': '当前状态不可下架',
|
||||
'en-US': 'Match cannot be unpublished in current status',
|
||||
|
||||
@@ -126,4 +126,5 @@ export * from './playerUsername';
|
||||
export * from './initial-depositRemark';
|
||||
export * from './phone-countries';
|
||||
export * from './match-time';
|
||||
export * from './walletTx';
|
||||
export * from './api-errors';
|
||||
|
||||
@@ -130,6 +130,7 @@ export * from './playerUsername';
|
||||
export * from './initial-depositRemark';
|
||||
export * from './phone-countries';
|
||||
export * from './match-time';
|
||||
export * from './walletTx';
|
||||
|
||||
export interface ApiResponse<T = unknown> {
|
||||
success: boolean;
|
||||
|
||||
11
packages/shared/src/walletTx.js
Normal file
11
packages/shared/src/walletTx.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/** 钱包流水展示用金额:输单结算 amount 为 0(可用余额未变),用冻结差额表示亏损 */
|
||||
export function txDisplayAmount(tx) {
|
||||
const type = tx.transactionType.toUpperCase();
|
||||
const amt = parseFloat(tx.amount);
|
||||
if (type === 'BET_SETTLE_LOSE' && amt === 0 && tx.frozenBefore != null && tx.frozenAfter != null) {
|
||||
const frozenDelta = parseFloat(tx.frozenBefore) - parseFloat(tx.frozenAfter);
|
||||
if (frozenDelta > 0)
|
||||
return (-frozenDelta).toString();
|
||||
}
|
||||
return tx.amount;
|
||||
}
|
||||
15
packages/shared/src/walletTx.ts
Normal file
15
packages/shared/src/walletTx.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/** 钱包流水展示用金额:输单结算 amount 为 0(可用余额未变),用冻结差额表示亏损 */
|
||||
export function txDisplayAmount(tx: {
|
||||
transactionType: string;
|
||||
amount: string;
|
||||
frozenBefore?: string;
|
||||
frozenAfter?: string;
|
||||
}): string {
|
||||
const type = tx.transactionType.toUpperCase();
|
||||
const amt = parseFloat(tx.amount);
|
||||
if (type === 'BET_SETTLE_LOSE' && amt === 0 && tx.frozenBefore != null && tx.frozenAfter != null) {
|
||||
const frozenDelta = parseFloat(tx.frozenBefore) - parseFloat(tx.frozenAfter);
|
||||
if (frozenDelta > 0) return (-frozenDelta).toString();
|
||||
}
|
||||
return tx.amount;
|
||||
}
|
||||
Reference in New Issue
Block a user