@sportsbroker/firebase-structure 3.73.8 → 3.74.0

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.
@@ -39,6 +39,7 @@ export type PoolPayoutStructure = { [position: string]: number };
39
39
 
40
40
  export enum GameKeyEnum {
41
41
  MATCH_PREDICTOR = "match-predictor",
42
+ GAME_FRAMEWORK = "game-framework",
42
43
  }
43
44
 
44
45
  export type B2BBetEventBettingStatusType = "locked" | "unlocked" | "settled";
@@ -1 +1 @@
1
- export * from "./b2b-bet-events";
1
+ export * from "./b2b-bet-events.d";
@@ -1,23 +1,40 @@
1
1
  import { GameKeyEnum } from "../b2b-bet-events";
2
+ import { GFQuestionResultValue } from "../b2b-gf-events";
2
3
  import { ISODate, UUID } from "../common";
3
4
 
4
5
  export type B2BBet = {
5
6
  id: string;
6
7
  userId: UUID;
7
8
  gameKey: GameKeyEnum;
9
+ gameTypeId: UUID;
10
+ status: BetStatusEnum;
8
11
  betEventId: UUID;
9
12
  predictions: BetPredictionType[];
10
13
  createdAt: ISODate;
11
14
  updatedAt: ISODate;
12
15
  };
13
16
 
14
- export type BetPredictionType = MPPrediction;
17
+ export enum BetStatusEnum {
18
+ OPEN = "open",
19
+ PENDING = "pending",
20
+ WON = "won",
21
+ LOST = "lost",
22
+ CANCELED = "cancelled",
23
+ LOCKED = "locked",
24
+ }
25
+
26
+ export type BetPredictionType = MPPrediction | GFPrediction;
15
27
 
16
28
  export type MPPrediction = {
17
29
  questionKey: MPQuestionKeyEnum;
18
30
  predictionValue: MPQuestionResultTypeValueType[MPQuestionResultTypeEnum];
19
31
  };
20
32
 
33
+ export type GFPrediction = {
34
+ eventQuestionId: UUID;
35
+ predictionValue: GFQuestionResultValue;
36
+ };
37
+
21
38
  export enum MPQuestionKeyEnum {
22
39
  MATCH_SCORE = "match-score",
23
40
  TOTAL_SHOTS_ON_TARGET = "total-shots-on-target",
@@ -1 +1 @@
1
- export * from "./b2b-bets";
1
+ export * from "./b2b-bets.d";
@@ -0,0 +1,104 @@
1
+ import {
2
+ B2BBetEventBettingStatusType,
3
+ B2BBetEventPoolData,
4
+ B2BBetEventStatusType,
5
+ GameKeyEnum,
6
+ } from "../b2b-bet-events";
7
+ import { ISODate, UUID } from "../common";
8
+
9
+ export type B2BGFEvent = {
10
+ id: UUID;
11
+ organizationId: UUID;
12
+ startDate: ISODate;
13
+ status: B2BBetEventStatusType;
14
+ bettingStatus: B2BBetEventBettingStatusType;
15
+ gameKey: GameKeyEnum;
16
+ gameTypeId: UUID;
17
+ name: string;
18
+ entryFeeAmount: number;
19
+ commissionPercent: number;
20
+ prizeDistributionStrategy: GFPrizeDistributionStrategyEnum;
21
+ seedValue: number;
22
+ questions: GFEventQuestion[];
23
+ resultsData: GFEventResultsData;
24
+ poolData: B2BBetEventPoolData;
25
+ resultsUpdateReason: string | null;
26
+ createdAt: ISODate;
27
+ updatedAt: ISODate;
28
+ };
29
+
30
+ export type GFEventQuestion = {
31
+ eventQuestionId: UUID;
32
+ questionType: GFQuestionTypeEnum;
33
+ text: string;
34
+ matchId: UUID;
35
+ gameTypeQuestionId?: UUID;
36
+ providerKey: string;
37
+ displayOrder: number;
38
+ helperText?: string;
39
+ label: string;
40
+ sport: string;
41
+ inGameEventKey: GFInGameEventKey;
42
+ pointsForExactHit: number;
43
+ pointsForCorrectResult: number;
44
+ pointsForWrongAnswer: number;
45
+ };
46
+
47
+ export type GFEventResultsData = {
48
+ [eventQuestionId: UUID]: GFEventResultData;
49
+ } | null;
50
+
51
+ export type GFEventResultData = {
52
+ matchId: UUID;
53
+ isMatchFinished?: boolean;
54
+ result: {
55
+ isFinal: boolean;
56
+ value: GFQuestionResultValue;
57
+ };
58
+ };
59
+
60
+ export type GFOccurrenceCountForSides = {
61
+ home: number;
62
+ away: number;
63
+ };
64
+
65
+ export type GFQuestionResultValue = string | number | boolean | GFOccurrenceCountForSides;
66
+
67
+ export enum GFQuestionTypeEnum {
68
+ OCCURRENCE_COUNT_FOR_SIDES = "occurrence-count-for-sides",
69
+ MOST_OCCURRENCE_RESULT = "most-occurrence-result",
70
+ TOTAL_OCCURRENCE_COUNT = "total-occurrence-count",
71
+ OCCURRED_OR_NOT = "occurred-or-not",
72
+ }
73
+
74
+ export enum GFInGameEventKey {
75
+ SCORE = "score",
76
+ GOAL = "goal",
77
+ CORNERS = "corners",
78
+ CORNERS_TOTAL = "corners_total",
79
+ CORNERS_10_OR_MORE = "corners_10_or_more",
80
+ RED_CARD = "red_card",
81
+ RED_CARD_TOTAL = "red_card_total",
82
+ YELLOW_CARD = "yellow_card",
83
+ YELLOW_CARD_TOTAL = "yellow_card_total",
84
+ TOTAL_CARDS = "total_cards",
85
+ PENALTY = "penalty",
86
+ TOTAL_GOALS = "total_goals",
87
+ SHOTS_ON_TARGET = "shots_on_target",
88
+ SHOTS_TOTAL = "shots_total",
89
+ TACKLES = "tackles",
90
+ TACKLES_TOTAL = "tackles_total",
91
+ GOAL_IN_FIRST_15 = "goal_in_first_15",
92
+ OFFSIDES = "offsides",
93
+ OFFSIDES_TOTAL = "offsides_total",
94
+ FOULS = "fouls",
95
+ FOULS_TOTAL = "fouls_total",
96
+ POSSESSION = "possession",
97
+ SAVES = "saves",
98
+ SAVES_TOTAL = "saves_total",
99
+ }
100
+
101
+ export enum GFPrizeDistributionStrategyEnum {
102
+ WINNER_TAKES_ALL = "winner-takes-all",
103
+ TOP_3 = "top-3",
104
+ }
@@ -0,0 +1 @@
1
+ export * from "./b2b-gf-events.d";
@@ -0,0 +1,32 @@
1
+ import { ISODate, UUID } from "../common";
2
+ import { GFInGameEventKey, GFQuestionTypeEnum } from "../b2b-gf-events";
3
+
4
+ export type B2BGFGameTemplate = {
5
+ id: UUID;
6
+ displayName: string;
7
+ questionsTemplates: B2BGFQuestionTemplate[];
8
+ rules: string;
9
+ status: B2BGFGameTemplateStatusEnum;
10
+ createdAt: ISODate;
11
+ updatedAt: ISODate;
12
+ };
13
+
14
+ export type B2BGFQuestionTemplate = {
15
+ id: UUID;
16
+ providerKey: string;
17
+ displayOrder: number;
18
+ helperText?: string;
19
+ label: string;
20
+ sport: string;
21
+ inGameEventKey: GFInGameEventKey;
22
+ type: GFQuestionTypeEnum;
23
+ pointsForExactHit: number;
24
+ pointsForCorrectResult: number;
25
+ pointsForWrongAnswer: number;
26
+ };
27
+
28
+ export enum B2BGFGameTemplateStatusEnum {
29
+ DRAFT = "draft",
30
+ PUBLISHED = "published",
31
+ ARCHIVED = "archived",
32
+ }
@@ -0,0 +1 @@
1
+ export * from "./b2b-gf-game-templates.d";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.73.8",
3
+ "version": "3.74.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {
@@ -1,22 +0,0 @@
1
- {
2
- "workbench.colorCustomizations": {
3
- "activityBar.activeBackground": "#1f6fd0",
4
- "activityBar.background": "#1f6fd0",
5
- "activityBar.foreground": "#e7e7e7",
6
- "activityBar.inactiveForeground": "#e7e7e799",
7
- "activityBarBadge.background": "#ee90bb",
8
- "activityBarBadge.foreground": "#15202b",
9
- "commandCenter.border": "#e7e7e799",
10
- "sash.hoverBorder": "#1f6fd0",
11
- "statusBar.background": "#1857a4",
12
- "statusBar.foreground": "#e7e7e7",
13
- "statusBarItem.hoverBackground": "#1f6fd0",
14
- "statusBarItem.remoteBackground": "#1857a4",
15
- "statusBarItem.remoteForeground": "#e7e7e7",
16
- "titleBar.activeBackground": "#1857a4",
17
- "titleBar.activeForeground": "#e7e7e7",
18
- "titleBar.inactiveBackground": "#1857a499",
19
- "titleBar.inactiveForeground": "#e7e7e799"
20
- },
21
- "peacock.color": "#1857a4"
22
- }