@sportsbroker/firebase-structure 3.61.1 → 3.61.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,6 @@ import { MatchHeadToHeadStats } from "./match-h2h-stats";
5
5
  import { MatchLineup } from "./match-lineup";
6
6
  import { MatchStats } from "./match-stats";
7
7
  import { MatchSides, MatchTime } from "./match-common";
8
- import { AlgorithmCalculation } from "./algorithm-calculation";
9
8
 
10
9
  export type MatchDoc = Match & Doc;
11
10
 
@@ -27,9 +26,8 @@ export type Match = {
27
26
  headToHeadStats?: MatchHeadToHeadStats;
28
27
  lineup?: MatchLineup;
29
28
  shares?: MatchSides<TeamSharesData>;
30
- betting?: MatchBettingData;
29
+ betting?: EventBettingData;
31
30
  stats?: MatchStats;
32
- algorithmCalculations?: AlgorithmCalculation[];
33
31
  };
34
32
 
35
33
  export type BetEventStatus =
@@ -40,14 +38,46 @@ export type BetEventStatus =
40
38
 
41
39
  export type BetEventBettingStatus = "locked" | "unlocked";
42
40
 
43
- export type MatchBettingData = {
44
- betEventStatus?: BetEventStatus;
45
- bettingStatus?: BetEventBettingStatus;
46
- teamsBettingData?: {
47
- [key: string]: TeamBettingData;
48
- };
41
+ export type EventBettingData = {
42
+ betEventStatus: BetEventStatus;
43
+ bettingStatus: BetEventBettingStatus;
44
+ pools?: EventPools;
49
45
  };
50
46
 
47
+ export type EventPools = Record<Partial<PoolType>, Pool>;
48
+
49
+ export type Pool = {
50
+ winningOutcome: OutcomeType | null;
51
+ type: PoolType;
52
+ outcomes: PoolOutcomes;
53
+ };
54
+
55
+ export type PoolOutcomes = Record<Partial<OutcomeType>, Outcome>;
56
+
57
+ export type Outcome = {
58
+ poolType: PoolType;
59
+ outcomeType: OutcomeType;
60
+ stakeAmount: number;
61
+ odds: number;
62
+ };
63
+
64
+ export type PoolType = MatchPoolTypeEnum.HEAD_TO_HEAD;
65
+
66
+ export enum MatchPoolTypeEnum {
67
+ HEAD_TO_HEAD = "head-to-head",
68
+ }
69
+
70
+ export type OutcomeType =
71
+ | HeadToHeadOutcomeTypeEnum.AWAY_TEAM_WIN
72
+ | HeadToHeadOutcomeTypeEnum.DRAW
73
+ | HeadToHeadOutcomeTypeEnum.HOME_TEAM_WIN;
74
+
75
+ export enum HeadToHeadOutcomeTypeEnum {
76
+ HOME_TEAM_WIN = "home-team-win",
77
+ AWAY_TEAM_WIN = "away-team-win",
78
+ DRAW = "draw",
79
+ }
80
+
51
81
  export type TeamBettingData = {
52
82
  preMatchBettingPool?: number;
53
83
  postMatchBettingPool?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.61.1",
3
+ "version": "3.61.2",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {
@@ -1,26 +0,0 @@
1
- import { MatchSides, MatchTime } from './match-common';
2
-
3
- export type AlgorithmCalculation = {
4
- calculationId: number;
5
- bettingPools: BettingPools;
6
- gainLossPercentage: GainLossPercentage;
7
- matchTime: MatchTime;
8
- statsDiff: StatsDiff;
9
- matchPoints: MatchPoints;
10
- winningSide: 'home' | 'away' | null;
11
- timestamp: ISOString;
12
- }
13
-
14
- type BettingPools = MatchSides<number>;
15
-
16
- type GainLossPercentage = MatchSides<number>;
17
-
18
- type StatsDiff = MatchSides<GameStats>;
19
-
20
- type MatchPoints = MatchSides<number>;
21
-
22
- type GameStats = Record<StatsKey, number>;
23
-
24
- type StatsKey = string;
25
-
26
- type ISOString = string;