@sportsbroker/firebase-structure 3.55.8 → 3.57.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.
@@ -13,3 +13,6 @@ export interface Image {
13
13
  }
14
14
 
15
15
  export type Sport = "soccer" | "nfl";
16
+
17
+ export type PlayerId = string;
18
+ export type TeamId = string;
@@ -0,0 +1,19 @@
1
+ import { MatchSides, MatchTime } from './match-common';
2
+
3
+ export type AlgorithmCalculationEvent = {
4
+ calculationId: number;
5
+ bettingPools: BettingPools;
6
+ gainLossPercentage: GainLossPercentage;
7
+ matchTime: MatchTime;
8
+ statsDiff: StatsDiff;
9
+ }
10
+
11
+ type BettingPools = MatchSides<number>;
12
+
13
+ type GainLossPercentage = MatchSides<number>;
14
+
15
+ type StatsDiff = MatchSides<GameStats>;
16
+
17
+ type GameStats = Record<StatsKey, number>;
18
+
19
+ type StatsKey = string;
@@ -1,6 +1,8 @@
1
+ export * from "./match-common";
1
2
  export * from "./match";
2
3
  export * from "./match-commentary";
3
4
  export * from "./match-event";
4
5
  export * from "./match-h2h-stats";
5
6
  export * from "./match-lineup";
6
7
  export * from "./match-stats";
8
+ export * from "./algorithm-calculation-event";
@@ -0,0 +1,10 @@
1
+ export interface MatchSides<T> {
2
+ home?: T;
3
+ away?: T;
4
+ }
5
+
6
+ export type MatchTime = {
7
+ minutes: number;
8
+ additionalMinutes: number;
9
+ periodId: number;
10
+ };
@@ -1,5 +1,5 @@
1
- import { PlayerID, TeamID } from "..";
2
1
  import { MatchPeriod } from "./match";
2
+ import { PlayerId, TeamId } from '../common';
3
3
 
4
4
  export type MatchEvent =
5
5
  | YellowCardEvent
@@ -27,7 +27,7 @@ export type EventTime = {
27
27
  type BaseEvent = {
28
28
  type: EventType;
29
29
  time: EventTime;
30
- teamId: TeamID;
30
+ teamId: TeamId;
31
31
  period: MatchPeriod;
32
32
  };
33
33
 
@@ -48,7 +48,7 @@ export type YellowCardEvent = BaseEvent & {
48
48
 
49
49
  export type GoalEvent = BaseEvent & {
50
50
  type: "GOAL";
51
- assistingPlayerId?: PlayerID;
51
+ assistingPlayerId?: PlayerId;
52
52
  assistingPlayerName?: string;
53
53
  assistingPlayerShirtName?: string;
54
54
  assistingPlayerUniform?: string;
@@ -77,11 +77,11 @@ export type MissedPenaltyEvent = BaseEvent & {
77
77
 
78
78
  export type SubstitutionEvent = BaseEvent & {
79
79
  type: "SUBSTITUTION";
80
- playerInId?: PlayerID;
80
+ playerInId?: PlayerId;
81
81
  playerInName?: string;
82
82
  playerInShirtName?: string;
83
83
  playerInUniform?: string;
84
- playerOutId: PlayerID;
84
+ playerOutId: PlayerId;
85
85
  playerOutName: string;
86
86
  playerOutShirtName: string;
87
87
  playerOutUniform: string;
@@ -1,4 +1,4 @@
1
- import { UUID } from "./common";
1
+ import { UUID } from '../common';
2
2
 
3
3
  export type MatchLineup = {
4
4
  [teamId: string]: TeamLineup;
@@ -1,4 +1,4 @@
1
- import { MatchSides } from "./match";
1
+ import { MatchSides } from './match-common';
2
2
 
3
3
  /**
4
4
  * @see: https://sportsbroker.slite.com/app/channels/VOZ0prjzHu/notes/tOQ3uR_FUT
@@ -1,9 +1,11 @@
1
- import { ISODate, UUID, Image, Doc, Sport } from "./../common";
1
+ import { ISODate, UUID, Image, Doc, Sport } from "../common";
2
2
  import { MatchCommentary } from "./match-commentary";
3
3
  import { MatchEvent } from "./match-event";
4
4
  import { MatchHeadToHeadStats } from "./match-h2h-stats";
5
5
  import { MatchLineup } from "./match-lineup";
6
6
  import { MatchStats } from "./match-stats";
7
+ import { MatchSides, MatchTime } from './match-common';
8
+ import { AlgorithmCalculationEvent } from './algorithm-calculation-event';
7
9
 
8
10
  export type MatchDoc = Match & Doc;
9
11
 
@@ -25,7 +27,18 @@ export type Match = {
25
27
  headToHeadStats?: MatchHeadToHeadStats;
26
28
  lineup?: MatchLineup;
27
29
  shares?: MatchSides<TeamSharesData>;
30
+ betting?: MatchBettingData;
28
31
  stats?: MatchStats;
32
+ algorithmEvents?: AlgorithmCalculationEvent[];
33
+ };
34
+
35
+ export type MatchBettingData = {
36
+ [key: string]: TeamBettingData;
37
+ };
38
+
39
+ export type TeamBettingData = {
40
+ preMatchBettingPool?: number;
41
+ postMatchBettingPool?: number;
29
42
  };
30
43
 
31
44
  export type TeamSharesData = {
@@ -58,11 +71,6 @@ export type PreviousMatch = {
58
71
  startDate: ISODate;
59
72
  };
60
73
 
61
- export interface MatchSides<T> {
62
- home?: T;
63
- away?: T;
64
- }
65
-
66
74
  export type MatchStage = {
67
75
  stageId: UUID;
68
76
  name?: string;
@@ -99,12 +107,6 @@ export type MatchPeriod =
99
107
 
100
108
  export type MatchStatusType = "PENDING" | "STARTED" | "FINISHED" | "POSTPONED";
101
109
 
102
- export type MatchTime = {
103
- minutes: number;
104
- additionalMinutes: number;
105
- periodId: number;
106
- };
107
-
108
110
  export type Opponent = {
109
111
  score: number;
110
112
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.55.8",
3
+ "version": "3.57.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {
@@ -12,11 +12,9 @@
12
12
  },
13
13
  "author": "SportsBroker",
14
14
  "license": "ISC",
15
- "bugs": {
16
- "url": "https://github.com/BonFireITLTD/firebase-structure/issues"
17
- },
18
- "homepage": "https://github.com/BonFireITLTD/firebase-structure#readme",
15
+ "homepage": "https://github.com/SportsBroker-HQ/firebase-structure",
19
16
  "devDependencies": {
20
- "typescript": "^3.7.5"
17
+ "typescript": "4.9.4",
18
+ "standard-version": "9.5.0"
21
19
  }
22
20
  }
@@ -1,22 +0,0 @@
1
- {
2
- "workbench.colorCustomizations": {
3
- "activityBar.activeBackground": "#1f6fd0",
4
- "activityBar.background": "#1f6fd0",
5
- "activityBar.foreground": "#e7e7e7",
6
- "activityBar.inactiveForeground": "#e7e7e799",
7
- "activityBarBadge.background": "#ee90bb",
8
- "activityBarBadge.foreground": "#15202b",
9
- "commandCenter.border": "#e7e7e799",
10
- "sash.hoverBorder": "#1f6fd0",
11
- "statusBar.background": "#1857a4",
12
- "statusBar.foreground": "#e7e7e7",
13
- "statusBarItem.hoverBackground": "#1f6fd0",
14
- "statusBarItem.remoteBackground": "#1857a4",
15
- "statusBarItem.remoteForeground": "#e7e7e7",
16
- "titleBar.activeBackground": "#1857a4",
17
- "titleBar.activeForeground": "#e7e7e7",
18
- "titleBar.inactiveBackground": "#1857a499",
19
- "titleBar.inactiveForeground": "#e7e7e799"
20
- },
21
- "peacock.color": "#1857a4"
22
- }