@sportsbroker/firebase-structure 5.0.1 → 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,4 +1,4 @@
1
- import { B2BBetEventPoolData } from "../b2b-pools";
1
+ import { B2BPool } from "../b2b-pools";
2
2
  import type { ISODate, UUID } from "../common";
3
3
  import type { MPQuestion } from "../match-predictor";
4
4
 
@@ -7,19 +7,20 @@ export type B2BBetEvent = {
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 enum GameKeyEnum {
20
+ export enum GameEngineEnum {
21
21
  MATCH_PREDICTOR = "match-predictor",
22
22
  SCORE_PREDICTOR = "score-predictor",
23
+ EDGE = "edge"
23
24
  }
24
25
 
25
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[];
@@ -1,4 +1,4 @@
1
- import { B2BBetEventStatusType, GameKeyEnum } from "../b2b-bet-events";
1
+ import { B2BBetEventStatusType, GameEngineEnum } from "../b2b-bet-events";
2
2
  import type { ISODate, UUID } from "../common";
3
3
 
4
4
  export type PoolPayoutStructure = { [position: string]: number };
@@ -9,7 +9,27 @@ export enum PrizeDistributionStrategyEnum {
9
9
  TOP_5 = "top-5",
10
10
  }
11
11
 
12
- export type B2BBetEventPoolData = {
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 = {
13
33
  id: UUID;
14
34
  betEventId: UUID;
15
35
  operatorId: UUID;
@@ -18,24 +38,8 @@ export type B2BBetEventPoolData = {
18
38
  participants: number; // active bets count
19
39
  entryFee: number;
20
40
  currency: string;
21
- event: {
22
- questionSetId: UUID;
23
- status: B2BBetEventStatusType;
24
- gameKey: GameKeyEnum;
25
- startDate?: ISODate;
26
- matchIds?: UUID[];
27
- leagueCodes?: string[];
28
- countryCodes?: string[];
29
- };
30
- leaderboard: {
31
- entries: {
32
- userId: UUID;
33
- displayName: string;
34
- position: number;
35
- score: number;
36
- prize: number | null;
37
- }[];
38
- };
41
+ event: B2BPoolEvent;
42
+ leaderboard: B2BPoolLeaderboard;
39
43
  payoutStructure: PoolPayoutStructure;
40
44
  prizeDistributionStrategy: PrizeDistributionStrategyEnum;
41
45
  createdAt: ISODate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "5.0.1",
3
+ "version": "5.1.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {