@sportsbroker/firebase-structure 5.0.1 → 5.2.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";
@@ -31,7 +32,7 @@ export type B2BBetEventStatusType =
31
32
  | "waiting-for-results-approval" // match is finished and we wait for CSA to approve match results
32
33
  | "results-approved" // results are approved and event is ready to be settled
33
34
  | "finished" // event is finished and settled
34
- | "canceled"; // event is canceled
35
+ | "cancelled"; // event is cancelled
35
36
 
36
37
  ////////////////////////////////////// MATCH PREDICTOR SPECIFIC TYPES //////////////////////////////////////
37
38
 
@@ -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;
@@ -19,7 +19,7 @@ export enum BetStatusEnum {
19
19
  PENDING = "pending",
20
20
  WON = "won",
21
21
  LOST = "lost",
22
- CANCELED = "cancelled",
22
+ CANCELLED = "cancelled",
23
23
  LOCKED = "locked",
24
24
  }
25
25
 
@@ -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;
@@ -19,7 +19,7 @@ export type MPEventMatchStatusType =
19
19
  | "pre-event"
20
20
  | "live"
21
21
  | "finished"
22
- | "canceled";
22
+ | "cancelled";
23
23
 
24
24
  export type MPMatchData = {
25
25
  matchId: UUID;
@@ -42,7 +42,7 @@ export type MPEventStatusType =
42
42
  | "waiting-for-results-approval"
43
43
  | "results-approved"
44
44
  | "finished"
45
- | "canceled";
45
+ | "cancelled";
46
46
 
47
47
  export type MPEventPool = {
48
48
  id: UUID;
@@ -19,7 +19,7 @@ export type SPEventMatchStatusType =
19
19
  | "pre-event"
20
20
  | "live"
21
21
  | "finished"
22
- | "canceled";
22
+ | "cancelled";
23
23
 
24
24
  export type SPMatchesData = {
25
25
  [matchId: string]: {
@@ -68,7 +68,7 @@ export type SPEventStatusType =
68
68
  | "waiting-for-results-approval"
69
69
  | "results-approved"
70
70
  | "finished"
71
- | "canceled";
71
+ | "cancelled";
72
72
 
73
73
  export type SPEventPool = {
74
74
  id: UUID;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "5.0.1",
3
+ "version": "5.2.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {