重构
This commit is contained in:
@@ -1,41 +1,24 @@
|
||||
import { DEFAULT_MARKET_TYPES } from './market-catalog';
|
||||
|
||||
/** 第一版仅足球;字段预留其他 sportType */
|
||||
export const SPORT_TYPE_FOOTBALL = 'FOOTBALL';
|
||||
|
||||
/** 常规赛事发布时生成的赛前盘口(手动维护,不含冠军盘) */
|
||||
export const STANDARD_PREMATCH_MARKET_TYPES = [
|
||||
'FT_1X2',
|
||||
'FT_HANDICAP',
|
||||
'FT_OVER_UNDER',
|
||||
'FT_ODD_EVEN',
|
||||
'HT_1X2',
|
||||
'HT_HANDICAP',
|
||||
'HT_OVER_UNDER',
|
||||
'FT_CORRECT_SCORE',
|
||||
'HT_CORRECT_SCORE',
|
||||
'SH_CORRECT_SCORE',
|
||||
] as const;
|
||||
export const STANDARD_PREMATCH_MARKET_TYPES = DEFAULT_MARKET_TYPES;
|
||||
|
||||
export const HANDICAP_TOTAL_MARKET_TYPES = [
|
||||
'FT_HANDICAP',
|
||||
'HT_HANDICAP',
|
||||
'FT_OVER_UNDER',
|
||||
'HT_OVER_UNDER',
|
||||
'FT_TEAM_TOTAL_HOME',
|
||||
'FT_TEAM_TOTAL_AWAY',
|
||||
'FT_CORNERS_HANDICAP',
|
||||
'FT_CORNERS_OVER_UNDER',
|
||||
'FT_CARDS_OVER_UNDER',
|
||||
] as const;
|
||||
|
||||
export type ParlayRejectReason = 'OUTRIGHT' | 'NOT_ALLOWED' | 'QUARTER_LINE' | 'SAME_MATCH';
|
||||
|
||||
export function hasDuplicateParlayMatch(
|
||||
matchIds: Array<string | bigint | null | undefined>,
|
||||
): boolean {
|
||||
const seen = new Set<string>();
|
||||
for (const id of matchIds) {
|
||||
if (id == null) continue;
|
||||
const key = String(id);
|
||||
if (seen.has(key)) return true;
|
||||
seen.add(key);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
export type ParlayRejectReason = 'OUTRIGHT' | 'NOT_ALLOWED' | 'QUARTER_LINE';
|
||||
|
||||
export function isQuarterLine(line: number | null | undefined): boolean {
|
||||
if (line == null || Number.isNaN(line)) return false;
|
||||
|
||||
Reference in New Issue
Block a user