@sportsbroker/firebase-structure 5.0.0 → 5.1.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.
@@ -1,59 +1,26 @@
1
+ import { B2BPool } from "../b2b-pools";
1
2
  import type { ISODate, UUID } from "../common";
2
3
  import type { MPQuestion } from "../match-predictor";
3
4
 
4
5
  export type B2BBetEvent = {
5
6
  id: string;
6
- organizationId: UUID;
7
7
  startDate: ISODate;
8
8
  status: B2BBetEventStatusType;
9
9
  bettingStatus: B2BBetEventBettingStatusType;
10
- gameKey: GameKeyEnum;
10
+ engine: GameEngineEnum;
11
11
  gameSpecificData: B2BMPEventGameSpecificData;
12
12
  resultsData: ResultsData;
13
- poolData: B2BBetEventPoolData;
13
+ poolData: B2BPool;
14
14
  createdAt: ISODate;
15
15
  updatedAt: ISODate;
16
16
  };
17
17
 
18
18
  export type ResultsData = B2BMPEventResultsData;
19
19
 
20
- export type B2BBetEventPoolData = {
21
- id: UUID;
22
- betEventId: UUID;
23
- operatorId: UUID;
24
- operatorCode: string;
25
- payoutAmount?: number;
26
- participants: number; // active bets count
27
- entryFee: number;
28
- currency: string;
29
- event: {
30
- questionSetId: UUID;
31
- status: B2BBetEventStatusType;
32
- gameKey: GameKeyEnum;
33
- startDate?: ISODate;
34
- matchIds?: UUID[];
35
- leagueCodes?: string[];
36
- countryCodes?: string[];
37
- };
38
- leaderboard: {
39
- entries: {
40
- userId: UUID;
41
- displayName: string;
42
- position: number;
43
- score: number;
44
- prize: number | null;
45
- }[];
46
- };
47
- payoutStructure: PoolPayoutStructure;
48
- createdAt: ISODate;
49
- updatedAt: ISODate;
50
- };
51
-
52
- export type PoolPayoutStructure = { [position: string]: number };
53
-
54
- export enum GameKeyEnum {
20
+ export enum GameEngineEnum {
55
21
  MATCH_PREDICTOR = "match-predictor",
56
22
  SCORE_PREDICTOR = "score-predictor",
23
+ EDGE = "edge"
57
24
  }
58
25
 
59
26
  export type B2BBetEventBettingStatusType = "locked" | "unlocked" | "settled";
@@ -1,11 +1,11 @@
1
- import type { GameKeyEnum } from "../b2b-bet-events";
1
+ import type { GameEngineEnum } from "../b2b-bet-events";
2
2
  import type { QuestionResultValue } from "../b2b-events";
3
3
  import type { ISODate, UUID } from "../common";
4
4
 
5
5
  export type B2BBet = {
6
6
  id: string;
7
7
  userId: UUID;
8
- gameKey: GameKeyEnum;
8
+ engine: GameEngineEnum;
9
9
  questionSetId: UUID;
10
10
  status: BetStatusEnum;
11
11
  betEventId: UUID;
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  B2BBetEventBettingStatusType,
3
3
  B2BBetEventStatusType,
4
- GameKeyEnum,
4
+ GameEngineEnum,
5
5
  } from "../b2b-bet-events";
6
6
  import type { ISODate, UUID } from "../common";
7
7
 
@@ -10,7 +10,7 @@ export type B2BEvent = {
10
10
  startDate: ISODate;
11
11
  status: B2BBetEventStatusType;
12
12
  bettingStatus: B2BBetEventBettingStatusType;
13
- gameKey: GameKeyEnum;
13
+ engine: GameEngineEnum;
14
14
  questionSetId: UUID;
15
15
  name: string;
16
16
  questions: EventQuestion[];
@@ -91,8 +91,3 @@ export enum InGameEventKey {
91
91
  SAVES = "saves",
92
92
  SAVES_TOTAL = "saves_total",
93
93
  }
94
-
95
- export enum PrizeDistributionStrategyEnum {
96
- WINNER_TAKES_ALL = "winner-takes-all",
97
- TOP_3 = "top-3",
98
- }
@@ -1,9 +1,47 @@
1
- import type { B2BBetEventPoolData } from "../b2b-bet-events";
1
+ import { B2BBetEventStatusType, GameEngineEnum } from "../b2b-bet-events";
2
2
  import type { ISODate, UUID } from "../common";
3
3
 
4
- export type B2BPool = B2BBetEventPoolData & {
4
+ export type PoolPayoutStructure = { [position: string]: number };
5
+
6
+ export enum PrizeDistributionStrategyEnum {
7
+ WINNER_TAKES_ALL = "winner-takes-all",
8
+ TOP_3 = "top-3",
9
+ TOP_5 = "top-5",
10
+ }
11
+
12
+ export type B2BPoolEvent = {
13
+ questionSetId: UUID;
14
+ status: B2BBetEventStatusType;
15
+ engine: GameEngineEnum;
16
+ startDate?: ISODate;
17
+ matchIds?: UUID[];
18
+ leagueCodes?: string[];
19
+ countryCodes?: string[];
20
+ };
21
+
22
+ export type B2BPoolLeaderboard = {
23
+ entries: {
24
+ userId: UUID;
25
+ displayName: string;
26
+ position: number;
27
+ score: number;
28
+ prize: number | null;
29
+ }[];
30
+ };
31
+
32
+ export type B2BPool = {
33
+ id: UUID;
5
34
  betEventId: UUID;
6
- organizationId: UUID;
35
+ operatorId: UUID;
36
+ operatorCode: string;
37
+ payoutAmount?: number;
38
+ participants: number; // active bets count
39
+ entryFee: number;
40
+ currency: string;
41
+ event: B2BPoolEvent;
42
+ leaderboard: B2BPoolLeaderboard;
43
+ payoutStructure: PoolPayoutStructure;
44
+ prizeDistributionStrategy: PrizeDistributionStrategyEnum;
7
45
  createdAt: ISODate;
8
46
  updatedAt: ISODate;
9
- };
47
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {