@sportsbroker/firebase-structure 3.73.5 → 3.73.8

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.
@@ -9,14 +9,18 @@ export type B2BBetEvent = {
9
9
  bettingStatus: B2BBetEventBettingStatusType;
10
10
  gameKey: GameKeyEnum;
11
11
  gameSpecificData: B2BMPEventGameSpecificData;
12
+ resultsData: ResultsData;
12
13
  poolData: B2BBetEventPoolData;
13
14
  createdAt: ISODate;
14
15
  updatedAt: ISODate;
15
16
  };
16
17
 
18
+ export type ResultsData = B2BMPEventResultsData;
19
+
17
20
  export type B2BBetEventPoolData = {
18
21
  id: UUID;
19
- potAmount: number; // gross pool entries sum
22
+ potAmount?: number; // deprecated
23
+ payoutAmount?: number; // this should be used
20
24
  participants: number; // active bets count
21
25
  entryFee: number;
22
26
  leaderboard: {
@@ -48,7 +52,64 @@ export type B2BBetEventStatusType =
48
52
  | "finished" // event is finished and settled
49
53
  | "canceled"; // event is canceled
50
54
 
55
+ ////////////////////////////////////// MATCH PREDICTOR SPECIFIC TYPES //////////////////////////////////////
56
+
51
57
  export type B2BMPEventGameSpecificData = {
52
58
  matchId: UUID;
53
59
  questions: MPQuestion[];
54
60
  };
61
+
62
+ export type B2BMPEventResultsData = {
63
+ [mpQuestionKey: MPQuestionKeyType]: B2BMPEventResultData;
64
+ };
65
+
66
+ export type MPQuestionKeyType = `${MPQuestionKeyEnum}` | string;
67
+
68
+ export enum MPQuestionKeyEnum {
69
+ MATCH_SCORE = "match-score",
70
+ TOTAL_SHOTS_ON_TARGET = "total-shots-on-target",
71
+ TOTAL_CARDS = "total-cards",
72
+ // MATCH_RESULT = 'match-result',
73
+ RED_CARD_IS_GIVEN = "red-card-is-given",
74
+ PENALTY_AWARDED = "penalty-awarded",
75
+ // BOTH_TEAM_SCORE = 'both-team-score',
76
+ // GOAL_IN_BOTH_HALVES = 'goal-in-both-halves',
77
+ GOAL_IN_FIRST_15 = "goal-in-first-15",
78
+ MOST_TACKLES_WON = "most-tackles-won",
79
+ CORNERS_10_OR_MORE = "corners-10-or-more",
80
+ }
81
+
82
+ export type B2BMPEventResultData = MPQuestion & {
83
+ result: {
84
+ isFinal: boolean;
85
+ value: MPQuestionResultTypeValueType[MPQuestionResultTypeEnum];
86
+ };
87
+ };
88
+
89
+ export type MPQuestionResultTypeValueType = {
90
+ [MPQuestionResultTypeEnum.BOTH_SIDES_POSITIVE_INTEGER]: BothSidesPositiveInteger;
91
+ [MPQuestionResultTypeEnum.POSITIVE_INTEGER]: PositiveInteger;
92
+ [MPQuestionResultTypeEnum.MATCH_SIDE_RESULT]: MatchSideResultEnum;
93
+ [MPQuestionResultTypeEnum.YES_NO]: YesNoResultEnum;
94
+ };
95
+
96
+ export enum MatchSideResultEnum {
97
+ HOME = "home",
98
+ AWAY = "away",
99
+ DRAW = "draw",
100
+ }
101
+ export enum YesNoResultEnum {
102
+ YES = "yes",
103
+ NO = "no",
104
+ }
105
+ export type BothSidesPositiveInteger = { home: number; away: number };
106
+ export type PositiveInteger = number;
107
+
108
+ export enum MPQuestionResultTypeEnum {
109
+ BOTH_SIDES_POSITIVE_INTEGER = "both-sides-positive-integer",
110
+ POSITIVE_INTEGER = "positive-integer",
111
+ MATCH_SIDE_RESULT = "match-side-result",
112
+ YES_NO = "yes-no",
113
+ }
114
+
115
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.73.5",
3
+ "version": "3.73.8",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {