@sportsbroker/firebase-structure 3.80.1 → 5.0.1

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,9 +1,9 @@
1
+ import { B2BBetEventPoolData } 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;
@@ -17,40 +17,6 @@ export type B2BBetEvent = {
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
- gameTypeId: 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
20
  export enum GameKeyEnum {
55
21
  MATCH_PREDICTOR = "match-predictor",
56
22
  SCORE_PREDICTOR = "score-predictor",
@@ -1,12 +1,12 @@
1
1
  import type { GameKeyEnum } from "../b2b-bet-events";
2
- import type { GFQuestionResultValue } from "../b2b-gf-events";
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
8
  gameKey: GameKeyEnum;
9
- gameTypeId: UUID;
9
+ questionSetId: UUID;
10
10
  status: BetStatusEnum;
11
11
  betEventId: UUID;
12
12
  predictions: BetPredictionType[];
@@ -23,16 +23,16 @@ export enum BetStatusEnum {
23
23
  LOCKED = "locked",
24
24
  }
25
25
 
26
- export type BetPredictionType = MPPrediction | GFPrediction;
26
+ export type BetPredictionType = MPPrediction | Prediction;
27
27
 
28
28
  export type MPPrediction = {
29
29
  questionKey: MPQuestionKeyEnum;
30
30
  predictionValue: MPQuestionResultTypeValueType[MPQuestionResultTypeEnum];
31
31
  };
32
32
 
33
- export type GFPrediction = {
33
+ export type Prediction = {
34
34
  eventQuestionId: UUID;
35
- predictionValue: GFQuestionResultValue;
35
+ predictionValue: QuestionResultValue;
36
36
  };
37
37
 
38
38
  export enum MPQuestionKeyEnum {
@@ -0,0 +1 @@
1
+ export * from "./b2b-events.model";
@@ -5,25 +5,25 @@ import type {
5
5
  } from "../b2b-bet-events";
6
6
  import type { ISODate, UUID } from "../common";
7
7
 
8
- export type B2BGFEvent = {
8
+ export type B2BEvent = {
9
9
  id: UUID;
10
10
  startDate: ISODate;
11
11
  status: B2BBetEventStatusType;
12
12
  bettingStatus: B2BBetEventBettingStatusType;
13
13
  gameKey: GameKeyEnum;
14
- gameTypeId: UUID;
14
+ questionSetId: UUID;
15
15
  name: string;
16
- questions: GFEventQuestion[];
17
- resultsData: GFEventResultsData;
16
+ questions: EventQuestion[];
17
+ resultsData: EventResultsData;
18
18
  resultsUpdateReason: string | null;
19
19
  createdAt: ISODate;
20
20
  updatedAt: ISODate;
21
21
  matchIds?: UUID[];
22
22
  };
23
23
 
24
- export type GFEventQuestion = {
24
+ export type EventQuestion = {
25
25
  eventQuestionId: UUID;
26
- questionType: GFQuestionTypeEnum;
26
+ questionType: QuestionTypeEnum;
27
27
  text: string;
28
28
  matchId: UUID;
29
29
  gameTypeQuestionId?: UUID;
@@ -32,40 +32,40 @@ export type GFEventQuestion = {
32
32
  helperText?: string;
33
33
  label: string;
34
34
  sport: string;
35
- inGameEventKey: GFInGameEventKey;
35
+ inGameEventKey: InGameEventKey;
36
36
  pointsForExactHit: number;
37
37
  pointsForCorrectResult: number;
38
38
  pointsForWrongAnswer: number;
39
39
  };
40
40
 
41
- export type GFEventResultsData = {
42
- [eventQuestionId: UUID]: GFEventResultData;
41
+ export type EventResultsData = {
42
+ [eventQuestionId: UUID]: EventResultData;
43
43
  } | null;
44
44
 
45
- export type GFEventResultData = {
45
+ export type EventResultData = {
46
46
  matchId: UUID;
47
47
  isMatchFinished?: boolean;
48
48
  result: {
49
49
  isFinal: boolean;
50
- value: GFQuestionResultValue;
50
+ value: QuestionResultValue;
51
51
  };
52
52
  };
53
53
 
54
- export type GFOccurrenceCountForSides = {
54
+ export type OccurrenceCountForSides = {
55
55
  home: number;
56
56
  away: number;
57
57
  };
58
58
 
59
- export type GFQuestionResultValue = string | number | boolean | GFOccurrenceCountForSides;
59
+ export type QuestionResultValue = string | number | boolean | OccurrenceCountForSides;
60
60
 
61
- export enum GFQuestionTypeEnum {
61
+ export enum QuestionTypeEnum {
62
62
  OCCURRENCE_COUNT_FOR_SIDES = "occurrence-count-for-sides",
63
63
  MOST_OCCURRENCE_RESULT = "most-occurrence-result",
64
64
  TOTAL_OCCURRENCE_COUNT = "total-occurrence-count",
65
65
  OCCURRED_OR_NOT = "occurred-or-not",
66
66
  }
67
67
 
68
- export enum GFInGameEventKey {
68
+ export enum InGameEventKey {
69
69
  SCORE = "score",
70
70
  GOAL = "goal",
71
71
  CORNERS = "corners",
@@ -91,8 +91,3 @@ export enum GFInGameEventKey {
91
91
  SAVES = "saves",
92
92
  SAVES_TOTAL = "saves_total",
93
93
  }
94
-
95
- export enum GFPrizeDistributionStrategyEnum {
96
- WINNER_TAKES_ALL = "winner-takes-all",
97
- TOP_3 = "top-3",
98
- }
@@ -0,0 +1 @@
1
+ export * from "./b2b-events.model";
@@ -0,0 +1,43 @@
1
+ import { B2BBetEventStatusType, GameKeyEnum } from "../b2b-bet-events";
2
+ import type { ISODate, UUID } from "../common";
3
+
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 B2BBetEventPoolData = {
13
+ id: UUID;
14
+ betEventId: UUID;
15
+ operatorId: UUID;
16
+ operatorCode: string;
17
+ payoutAmount?: number;
18
+ participants: number; // active bets count
19
+ entryFee: number;
20
+ 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
+ };
39
+ payoutStructure: PoolPayoutStructure;
40
+ prizeDistributionStrategy: PrizeDistributionStrategyEnum;
41
+ createdAt: ISODate;
42
+ updatedAt: ISODate;
43
+ };
@@ -0,0 +1 @@
1
+ export * from "./b2b-pools.model";
@@ -0,0 +1 @@
1
+ export * from "./b2b-question-sets.model";
@@ -1,31 +1,31 @@
1
1
  import type { ISODate, UUID } from "../common";
2
- import type { GFInGameEventKey, GFQuestionTypeEnum } from "../b2b-gf-events";
2
+ import type { InGameEventKey, QuestionTypeEnum } from "../b2b-events";
3
3
 
4
- export type B2BGFGameTemplate = {
4
+ export type B2BQuestionSet = {
5
5
  id: UUID;
6
6
  displayName: string;
7
- questionsTemplates: B2BGFQuestionTemplate[];
7
+ questions: B2BQuestionTemplate[];
8
8
  rules: string;
9
- status: B2BGFGameTemplateStatusEnum;
9
+ status: B2BQuestionSetStatusEnum;
10
10
  createdAt: ISODate;
11
11
  updatedAt: ISODate;
12
12
  };
13
13
 
14
- export type B2BGFQuestionTemplate = {
14
+ export type B2BQuestionTemplate = {
15
15
  id: UUID;
16
16
  providerKey: string;
17
17
  displayOrder: number;
18
18
  helperText?: string;
19
19
  label: string;
20
20
  sport: string;
21
- inGameEventKey: GFInGameEventKey;
22
- type: GFQuestionTypeEnum;
21
+ inGameEventKey: InGameEventKey;
22
+ type: QuestionTypeEnum;
23
23
  pointsForExactHit: number;
24
24
  pointsForCorrectResult: number;
25
25
  pointsForWrongAnswer: number;
26
26
  };
27
27
 
28
- export enum B2BGFGameTemplateStatusEnum {
28
+ export enum B2BQuestionSetStatusEnum {
29
29
  DRAFT = "draft",
30
30
  PUBLISHED = "published",
31
31
  ARCHIVED = "archived",
@@ -0,0 +1 @@
1
+ export * from "./b2b-question-sets.model";
@@ -1,3 +1,3 @@
1
1
  export * from "./common";
2
2
  export * from "./user-status";
3
- export * from "./b2b-gf-pools";
3
+ export * from "./b2b-pools";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.80.1",
3
+ "version": "5.0.1",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- export * from "./b2b-gf-events.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-gf-events.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-gf-game-templates.model";
@@ -1 +0,0 @@
1
- export * from "./b2b-gf-game-templates.model";
@@ -1,9 +0,0 @@
1
- import type { B2BBetEventPoolData } from "../b2b-bet-events";
2
- import type { ISODate, UUID } from "../common";
3
-
4
- export type B2BGFPool = B2BBetEventPoolData & {
5
- betEventId: UUID;
6
- organizationId: UUID;
7
- createdAt: ISODate;
8
- updatedAt: ISODate;
9
- };
@@ -1 +0,0 @@
1
- export * from "./b2b-gf-pools.model";