@sportsbroker/firebase-structure 5.3.0 → 5.5.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.
Files changed (33) hide show
  1. package/firestore/bet-events/bet-events.d.ts +1 -0
  2. package/firestore/{b2b-bet-events/b2b-bet-events.model.ts → bet-events/bet-events.model.ts} +14 -14
  3. package/firestore/bet-events/index.ts +1 -0
  4. package/firestore/bets/bets.d.ts +1 -0
  5. package/firestore/{b2b-bets/b2b-bets.model.ts → bets/bets.model.ts} +3 -3
  6. package/firestore/bets/index.ts +1 -0
  7. package/firestore/events/events.d.ts +1 -0
  8. package/firestore/{b2b-events/b2b-events.model.ts → events/events.model.ts} +6 -6
  9. package/firestore/events/index.ts +1 -0
  10. package/firestore/fixtures/fixtures.d.ts +1 -0
  11. package/firestore/{b2b-matches/b2b-match.model.ts → fixtures/fixtures.model.ts} +7 -7
  12. package/firestore/fixtures/index.ts +1 -0
  13. package/firestore/index.d.ts +1 -1
  14. package/firestore/pools/index.ts +1 -0
  15. package/firestore/{b2b-pools/b2b-pools.model.ts → pools/pools.model.ts} +9 -7
  16. package/firestore/question-sets/index.ts +2 -0
  17. package/firestore/question-sets/question-sets.d.ts +1 -0
  18. package/firestore/{b2b-question-sets/b2b-question-sets.model.ts → question-sets/question-sets.model.ts} +6 -6
  19. package/firestore/question-sets/question.d.ts +1 -0
  20. package/package.json +1 -1
  21. package/firestore/b2b-bet-events/b2b-bet-events.d.ts +0 -1
  22. package/firestore/b2b-bet-events/index.ts +0 -1
  23. package/firestore/b2b-bets/b2b-bets.d.ts +0 -1
  24. package/firestore/b2b-bets/index.ts +0 -1
  25. package/firestore/b2b-events/b2b-events.d.ts +0 -1
  26. package/firestore/b2b-events/index.ts +0 -1
  27. package/firestore/b2b-matches/b2b-match.d.ts +0 -1
  28. package/firestore/b2b-matches/index.ts +0 -1
  29. package/firestore/b2b-pools/index.ts +0 -1
  30. package/firestore/b2b-question-sets/b2b-question-sets.d.ts +0 -1
  31. package/firestore/b2b-question-sets/b2b-question.d.ts +0 -1
  32. package/firestore/b2b-question-sets/index.ts +0 -2
  33. /package/firestore/{b2b-question-sets/b2b-question.model.ts → question-sets/question.model.ts} +0 -0
@@ -0,0 +1 @@
1
+ export * from "./bet-events.model";
@@ -1,30 +1,30 @@
1
- import { B2BPool } from "../b2b-pools";
2
- import { Question } from "../b2b-question-sets";
1
+ import { Pool } from "../pools";
2
+ import { Question } from "../question-sets";
3
3
  import type { ISODate, UUID } from "../common";
4
4
 
5
- export type B2BBetEvent = {
5
+ export type BetEvent = {
6
6
  id: string;
7
7
  startDate: ISODate;
8
- status: B2BBetEventStatusType;
9
- bettingStatus: B2BBetEventBettingStatusType;
8
+ status: BetEventStatusType;
9
+ bettingStatus: BetEventBettingStatusType;
10
10
  engine: GameEngineEnum;
11
- gameSpecificData: B2BEventGameSpecificData;
11
+ gameSpecificData: EventGameSpecificData;
12
12
  resultsData: ResultsData;
13
- poolData: B2BPool;
13
+ poolData: Pool;
14
14
  createdAt: ISODate;
15
15
  updatedAt: ISODate;
16
16
  };
17
17
 
18
- export type ResultsData = B2BEventResultsData;
18
+ export type ResultsData = EventResultsData;
19
19
 
20
20
  export enum GameEngineEnum {
21
21
  MATCH_PREDICTOR = "match-predictor",
22
22
  EDGE = "edge"
23
23
  }
24
24
 
25
- export type B2BBetEventBettingStatusType = "locked" | "unlocked" | "settled";
25
+ export type BetEventBettingStatusType = "locked" | "unlocked" | "settled";
26
26
 
27
- export type B2BBetEventStatusType =
27
+ export type BetEventStatusType =
28
28
  | "pending" // before we start display event ald at this time betting is locked
29
29
  | "open" // now we can place bets on event but match did not start yet
30
30
  | "event-in-progress" // match already started betting is locked again
@@ -33,13 +33,13 @@ export type B2BBetEventStatusType =
33
33
  | "finished" // event is finished and settled
34
34
  | "cancelled"; // event is cancelled
35
35
 
36
- export type B2BEventGameSpecificData = {
36
+ export type EventGameSpecificData = {
37
37
  matchId: UUID;
38
38
  questions: Question[];
39
39
  };
40
40
 
41
- export type B2BEventResultsData = {
42
- [questionKey: QuestionKey]: B2BEventResultData;
41
+ export type EventResultsData = {
42
+ [questionKey: QuestionKey]: EventResultData;
43
43
  };
44
44
 
45
45
  export type QuestionKey = `${QuestionKeyEnum}` | string;
@@ -58,7 +58,7 @@ export enum QuestionKeyEnum {
58
58
  CORNERS_10_OR_MORE = "corners-10-or-more",
59
59
  }
60
60
 
61
- export type B2BEventResultData = Question & {
61
+ export type EventResultData = Question & {
62
62
  result: {
63
63
  isFinal: boolean;
64
64
  value: QuestionResultTypeValueType[QuestionResultTypeEnum];
@@ -0,0 +1 @@
1
+ export * from "./bet-events.model";
@@ -0,0 +1 @@
1
+ export * from "./bets.model";
@@ -1,8 +1,8 @@
1
- import type { GameEngineEnum } from "../b2b-bet-events";
2
- import type { QuestionResultValue } from "../b2b-events";
1
+ import type { GameEngineEnum } from "../bet-events";
2
+ import type { QuestionResultValue } from "../events";
3
3
  import type { ISODate, UUID } from "../common";
4
4
 
5
- export type B2BBet = {
5
+ export type Bet = {
6
6
  id: string;
7
7
  userId: UUID;
8
8
  engine: GameEngineEnum;
@@ -0,0 +1 @@
1
+ export * from "./bets.model";
@@ -0,0 +1 @@
1
+ export * from "./events.model";
@@ -1,15 +1,15 @@
1
1
  import type {
2
- B2BBetEventBettingStatusType,
3
- B2BBetEventStatusType,
2
+ BetEventBettingStatusType,
3
+ BetEventStatusType,
4
4
  GameEngineEnum,
5
- } from "../b2b-bet-events";
5
+ } from "../bet-events";
6
6
  import type { ISODate, UUID } from "../common";
7
7
 
8
- export type B2BEvent = {
8
+ export type Event = {
9
9
  id: UUID;
10
10
  startDate: ISODate;
11
- status: B2BBetEventStatusType;
12
- bettingStatus: B2BBetEventBettingStatusType;
11
+ status: BetEventStatusType;
12
+ bettingStatus: BetEventBettingStatusType;
13
13
  engine: GameEngineEnum;
14
14
  questionSetId: UUID;
15
15
  name: string;
@@ -0,0 +1 @@
1
+ export * from "./events.model";
@@ -0,0 +1 @@
1
+ export * from "./fixtures.model";
@@ -1,11 +1,11 @@
1
1
  import type { ISODate, UUID } from "../common";
2
2
 
3
- export type B2BMatch = {
3
+ export type Fixture = {
4
4
  id: UUID;
5
5
  startDate: ISODate;
6
6
  homeTeam: MatchTeam;
7
7
  awayTeam: MatchTeam;
8
- status: B2BMatchStatus;
8
+ status: FixtureStatus;
9
9
  createdAt: ISODate;
10
10
  updatedAt: ISODate;
11
11
  };
@@ -17,17 +17,17 @@ export type MatchTeam = {
17
17
  score: number;
18
18
  };
19
19
 
20
- export type B2BMatchStatus = {
21
- matchStatus: B2BMatchStatusType;
20
+ export type FixtureStatus = {
21
+ matchStatus: FixtureStatusType;
22
22
  isActive: boolean;
23
- period: B2BMatchPeriod;
23
+ period: FixturePeriod;
24
24
  periodId: number;
25
25
  minutes: number;
26
26
  additionalMinutes: number;
27
27
  fullTimeFinished: boolean;
28
28
  };
29
29
 
30
- export type B2BMatchPeriod =
30
+ export type FixturePeriod =
31
31
  | "PRE_MATCH"
32
32
  | "FIRST_HALF"
33
33
  | "SECOND_HALF"
@@ -35,7 +35,7 @@ export type B2BMatchPeriod =
35
35
  | "SECOND_OVERTIME_HALF"
36
36
  | "SHOOTOUT";
37
37
 
38
- export type B2BMatchStatusType =
38
+ export type FixtureStatusType =
39
39
  | "finished"
40
40
  | "preMatch"
41
41
  | "live"
@@ -0,0 +1 @@
1
+ export * from "./fixtures.model";
@@ -1,3 +1,3 @@
1
1
  export * from "./common";
2
2
  export * from "./user-status";
3
- export * from "./b2b-pools";
3
+ export * from "./pools";
@@ -0,0 +1 @@
1
+ export * from "./pools.model";
@@ -1,4 +1,4 @@
1
- import { B2BBetEventStatusType, GameEngineEnum } from "../b2b-bet-events";
1
+ import { BetEventStatusType, GameEngineEnum } from "../bet-events";
2
2
  import type { ISODate, UUID } from "../common";
3
3
 
4
4
  export type PoolPayoutStructure = { [position: string]: number };
@@ -9,9 +9,9 @@ export enum PrizeDistributionStrategyEnum {
9
9
  TOP_5 = "top-5",
10
10
  }
11
11
 
12
- export type B2BPoolEvent = {
12
+ export type PoolEvent = {
13
13
  questionSetId: UUID;
14
- status: B2BBetEventStatusType;
14
+ status: BetEventStatusType;
15
15
  engine: GameEngineEnum;
16
16
  startDate?: ISODate;
17
17
  matchIds?: UUID[];
@@ -19,7 +19,7 @@ export type B2BPoolEvent = {
19
19
  countryCodes?: string[];
20
20
  };
21
21
 
22
- export type B2BPoolLeaderboard = {
22
+ export type PoolLeaderboard = {
23
23
  entries: {
24
24
  userId: UUID;
25
25
  displayName: string;
@@ -29,17 +29,19 @@ export type B2BPoolLeaderboard = {
29
29
  }[];
30
30
  };
31
31
 
32
- export type B2BPool = {
32
+ export type Pool = {
33
33
  id: UUID;
34
34
  betEventId: UUID;
35
+ /** Slug of the game this pool belongs to (sports-games `games.slug`). */
36
+ gameSlug: string;
35
37
  operatorId: UUID;
36
38
  operatorCode: string;
37
39
  payoutAmount?: number;
38
40
  participants: number; // active bets count
39
41
  entryFee: number;
40
42
  currency: string;
41
- event: B2BPoolEvent;
42
- leaderboard: B2BPoolLeaderboard;
43
+ event: PoolEvent;
44
+ leaderboard: PoolLeaderboard;
43
45
  payoutStructure: PoolPayoutStructure;
44
46
  prizeDistributionStrategy: PrizeDistributionStrategyEnum;
45
47
  createdAt: ISODate;
@@ -0,0 +1,2 @@
1
+ export * from "./question-sets.model";
2
+ export * from "./question.model";
@@ -0,0 +1 @@
1
+ export * from "./question-sets.model";
@@ -1,17 +1,17 @@
1
1
  import type { ISODate, UUID } from "../common";
2
- import type { InGameEventKey, QuestionTypeEnum } from "../b2b-events";
2
+ import type { InGameEventKey, QuestionTypeEnum } from "../events";
3
3
 
4
- export type B2BQuestionSet = {
4
+ export type QuestionSet = {
5
5
  id: UUID;
6
6
  displayName: string;
7
- questions: B2BQuestionTemplate[];
7
+ questions: QuestionTemplate[];
8
8
  rules: string;
9
- status: B2BQuestionSetStatusEnum;
9
+ status: QuestionSetStatusEnum;
10
10
  createdAt: ISODate;
11
11
  updatedAt: ISODate;
12
12
  };
13
13
 
14
- export type B2BQuestionTemplate = {
14
+ export type QuestionTemplate = {
15
15
  id: UUID;
16
16
  providerKey: string;
17
17
  displayOrder: number;
@@ -25,7 +25,7 @@ export type B2BQuestionTemplate = {
25
25
  pointsForWrongAnswer: number;
26
26
  };
27
27
 
28
- export enum B2BQuestionSetStatusEnum {
28
+ export enum QuestionSetStatusEnum {
29
29
  DRAFT = "draft",
30
30
  PUBLISHED = "published",
31
31
  ARCHIVED = "archived",
@@ -0,0 +1 @@
1
+ export * from "./question.model";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "5.3.0",
3
+ "version": "5.5.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- export * from "./b2b-bet-events.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-bet-events.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-bets.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-bets.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-events.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-events.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-match.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-match.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-pools.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-question-sets.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-question.model";
@@ -1,2 +0,0 @@
1
- export * from "./b2b-question-sets.model";
2
- export * from "./b2b-question.model";