@sportsbroker/firebase-structure 3.73.0 → 3.73.2

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,3 +1 @@
1
- export * from "./b2b-match-predictor";
2
- export * from "./match-predictor-question";
3
1
  export * from "./b2b-bet-events";
@@ -1,14 +1,69 @@
1
+ import { GameKeyEnum } from "../b2b-bet-events";
1
2
  import { ISODate, UUID } from "../common";
2
3
 
3
- export type B2BBets = {
4
- id: string; // organisationId-userId
4
+ export type B2BBet = {
5
+ id: string;
5
6
  userId: UUID;
6
- organisationId: UUID;
7
- // betting: { activeBettingEvents: UserActiveBettingEvents };
7
+ gameKey: GameKeyEnum;
8
+ predictions: BetPredictionType[];
8
9
  createdAt: ISODate;
9
10
  updatedAt: ISODate;
10
11
  };
11
12
 
12
- // export type UserActiveBettingEvents = {
13
- // mpEvents: UUID[];
14
- // };
13
+ export type BetPredictionType = MPPrediction;
14
+
15
+ export type MPPrediction = {
16
+ questionKey: MPQuestionKeyType;
17
+ predictionValue: MPQuestionResultTypeValueType[MPQuestionResultTypeEnum];
18
+ };
19
+
20
+ export enum MPQuestionKeyEnum {
21
+ MATCH_SCORE = "match-score",
22
+ TOTAL_SHOTS_ON_TARGET = "total-shots-on-target",
23
+ TOTAL_CARDS = "total-cards",
24
+ // MATCH_RESULT = 'match-result',
25
+ RED_CARD_IS_GIVEN = "red-card-is-given",
26
+ PENALTY_AWARDED = "penalty-awarded",
27
+ // BOTH_TEAM_SCORE = 'both-team-score',
28
+ // GOAL_IN_BOTH_HALVES = 'goal-in-both-halves',
29
+ GOAL_IN_FIRST_15 = "goal-in-first-15",
30
+ MOST_TACKLES_WON = "most-tackles-won",
31
+ CORNERS_10_OR_MORE = "corners-10-or-more",
32
+ }
33
+
34
+ export type MPQuestionKeyType = keyof typeof MPQuestionKeyEnum;
35
+
36
+ export enum MatchSideResultEnum {
37
+ HOME = "home",
38
+ AWAY = "away",
39
+ DRAW = "draw",
40
+ }
41
+ export enum YesNoResultEnum {
42
+ YES = "yes",
43
+ NO = "no",
44
+ }
45
+ export type BothSidesPositiveInteger = { home: number; away: number };
46
+ export type PositiveInteger = number;
47
+
48
+ export enum MPQuestionResultTypeEnum {
49
+ BOTH_SIDES_POSITIVE_INTEGER = "both-sides-positive-integer",
50
+ POSITIVE_INTEGER = "positive-integer",
51
+ MATCH_SIDE_RESULT = "match-side-result",
52
+ YES_NO = "yes-no",
53
+ }
54
+
55
+ export type MPQuestionResultTypeType = keyof typeof MPQuestionResultTypeEnum;
56
+
57
+ export type MPQuestion = {
58
+ key: MPQuestionKeyEnum;
59
+ points: number;
60
+ resultValueType: MPQuestionResultTypeEnum;
61
+ displayOrder: number;
62
+ };
63
+
64
+ export type MPQuestionResultTypeValueType = {
65
+ [MPQuestionResultTypeEnum.BOTH_SIDES_POSITIVE_INTEGER]: BothSidesPositiveInteger;
66
+ [MPQuestionResultTypeEnum.POSITIVE_INTEGER]: PositiveInteger;
67
+ [MPQuestionResultTypeEnum.MATCH_SIDE_RESULT]: MatchSideResultEnum;
68
+ [MPQuestionResultTypeEnum.YES_NO]: YesNoResultEnum;
69
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.73.0",
3
+ "version": "3.73.2",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {