@sportsbroker/firebase-structure 3.24.0-9 → 3.25.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,239 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [3.25.0](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-37...v3.25.0) (2021-09-17)
6
+
7
+
8
+ ### Features
9
+
10
+ * add bonus to wallet ([51d5acd](https://github.com/SportsBroker-HQ/firebase-structure/commit/51d5acd4f2fa0b91a0ee02e6ded1958ea802a198))
11
+ * add marketing offers to config ([c2b9e4e](https://github.com/SportsBroker-HQ/firebase-structure/commit/c2b9e4e00a9e52d197f3c5eeb594b3106eb46096))
12
+ * added wagering limits order abort reason ([#150](https://github.com/SportsBroker-HQ/firebase-structure/issues/150)) ([a752a99](https://github.com/SportsBroker-HQ/firebase-structure/commit/a752a997bef376e614362a14a8ecd44dde53e259))
13
+
14
+ ## [3.24.0](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-38...v3.24.0) (2021-09-01)
15
+
16
+
17
+ ### Features
18
+
19
+ * add marketing offers to config ([c2b9e4e](https://github.com/SportsBroker-HQ/firebase-structure/commit/c2b9e4e00a9e52d197f3c5eeb594b3106eb46096))
20
+
21
+ ## [3.24.0-38](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-37...v3.24.0-38) (2021-08-22)
22
+
23
+
24
+ ### Features
25
+
26
+ * add bonus to wallet ([51d5acd](https://github.com/SportsBroker-HQ/firebase-structure/commit/51d5acd4f2fa0b91a0ee02e6ded1958ea802a198))
27
+
28
+ ## [3.24.0-37](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-36...v3.24.0-37) (2021-08-17)
29
+
30
+ ## [3.24.0-36](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-35...v3.24.0-36) (2021-08-09)
31
+
32
+
33
+ ### Features
34
+
35
+ * add abortReason to orders ([260cdef](https://github.com/SportsBroker-HQ/firebase-structure/commit/260cdeff97656cfad4620230d65f6839fd47039d))
36
+
37
+ ## [3.24.0-35](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-34...v3.24.0-35) (2021-08-03)
38
+
39
+
40
+ ### Features
41
+
42
+ * add preciseSharesValue to order ([db2a0c3](https://github.com/SportsBroker-HQ/firebase-structure/commit/db2a0c35ca242ed8400c7bcf8680f3910976c444))
43
+
44
+ ## [3.24.0-34](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-32...v3.24.0-34) (2021-07-29)
45
+
46
+
47
+ ### Features
48
+
49
+ * adder totalPrice to order details ([01844f2](https://github.com/SportsBroker-HQ/firebase-structure/commit/01844f22fc90630f1d19f55f7b7ad5d71f96c6b7))
50
+
51
+ ## [3.24.0-33](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-32...v3.24.0-33) (2021-07-26)
52
+
53
+ ## [3.24.0-32](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-31...v3.24.0-32) (2021-07-12)
54
+
55
+
56
+ ### Features
57
+
58
+ * added ordering for seasons ([4ec93e8](https://github.com/SportsBroker-HQ/firebase-structure/commit/4ec93e816692d64056f7279232912fabd06dea5d))
59
+
60
+ ## [3.24.0-31](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-30...v3.24.0-31) (2021-06-21)
61
+
62
+
63
+ ### Features
64
+
65
+ * added temp goal to trading inactivity reasons ([98c7f35](https://github.com/SportsBroker-HQ/firebase-structure/commit/98c7f359294e56f08c84a5295de44f65ef8780e8))
66
+
67
+ ## [3.24.0-30](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-29...v3.24.0-30) (2021-06-16)
68
+
69
+
70
+ ### Features
71
+
72
+ * field position types ([#145](https://github.com/SportsBroker-HQ/firebase-structure/issues/145)) ([393e46c](https://github.com/SportsBroker-HQ/firebase-structure/commit/393e46cc97eced1624e4bbcaa82f12ea7f4a4f31))
73
+
74
+ ## [3.24.0-29](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-28...v3.24.0-29) (2021-05-28)
75
+
76
+
77
+ ### Features
78
+
79
+ * match score structure update - include penalties in periods ([3ae52f7](https://github.com/SportsBroker-HQ/firebase-structure/commit/3ae52f7d14554ce02b0cdc55c64bd4e146b9e33b))
80
+
81
+ ## [3.24.0-28](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-26...v3.24.0-28) (2021-05-27)
82
+
83
+
84
+ ### Features
85
+
86
+ * added penalty shootout events ([c62dba9](https://github.com/SportsBroker-HQ/firebase-structure/commit/c62dba96d138bd3215ab3b437b2d93ccdf272990))
87
+ * identify player by quasi unique id ([71f9554](https://github.com/SportsBroker-HQ/firebase-structure/commit/71f955447310c75d6ffa9f00dff3ba9a722aee6a))
88
+
89
+ ## [3.24.0-27](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-26...v3.24.0-27) (2021-05-20)
90
+
91
+
92
+ ### Features
93
+
94
+ * identify player by quasi unique id ([71f9554](https://github.com/SportsBroker-HQ/firebase-structure/commit/71f955447310c75d6ffa9f00dff3ba9a722aee6a))
95
+
96
+ ## [3.24.0-26](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-16...v3.24.0-26) (2021-05-20)
97
+
98
+
99
+ ### Features
100
+
101
+ * add missed penalty event, add period to events ([42293fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/42293feefc383900fa456d8dfef80ade0581c3b6))
102
+ * add short name to league table ([db3a43f](https://github.com/SportsBroker-HQ/firebase-structure/commit/db3a43f11484f3c6c42bc87261b7dbeebcca3a87))
103
+ * add temporaryTeams ([3e0c94b](https://github.com/SportsBroker-HQ/firebase-structure/commit/3e0c94b16db3f364555adf2bf53a7227db7efbab))
104
+ * add tournament type to match ([07a9531](https://github.com/SportsBroker-HQ/firebase-structure/commit/07a9531a80f4756a6264e87bb0c4c1c59f76943a))
105
+ * add tournament type to match ([f6bb925](https://github.com/SportsBroker-HQ/firebase-structure/commit/f6bb9257d6c2848a09cf06153c42a8209e0086ff))
106
+ * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
107
+ * added tournament stage ([2b189d7](https://github.com/SportsBroker-HQ/firebase-structure/commit/2b189d7bec15763309200736e8554fcbf98c656d))
108
+ * make sub player in optional ([2f66535](https://github.com/SportsBroker-HQ/firebase-structure/commit/2f66535bb82037854865ebd0d37bca5b7cb443b8))
109
+ * mark teams as optional ([98a7b6b](https://github.com/SportsBroker-HQ/firebase-structure/commit/98a7b6b9daabceb41f6450f6ff6e51054248b37f))
110
+ * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
111
+ * new match statistics [ch14445] ([e1b598e](https://github.com/SportsBroker-HQ/firebase-structure/commit/e1b598eaf702948e33c27d9e6fccf95e53c6cafa))
112
+
113
+
114
+ ### Bug Fixes
115
+
116
+ * converted commentary type from enum to strings union ([#144](https://github.com/SportsBroker-HQ/firebase-structure/issues/144)) ([97e0fbe](https://github.com/SportsBroker-HQ/firebase-structure/commit/97e0fbedea00b2e9a70b1ee41db7c6fd286f2b15))
117
+
118
+ ## [3.24.0-25](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-24...v3.24.0-25) (2021-05-19)
119
+
120
+
121
+ ### Features
122
+
123
+ * add tournament type to match ([f6bb925](https://github.com/SportsBroker-HQ/firebase-structure/commit/f6bb9257d6c2848a09cf06153c42a8209e0086ff))
124
+
125
+ ## [3.24.0-24](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-23...v3.24.0-24) (2021-05-17)
126
+
127
+
128
+ ### Features
129
+
130
+ * add tournament type to match ([07a9531](https://github.com/SportsBroker-HQ/firebase-structure/commit/07a9531a80f4756a6264e87bb0c4c1c59f76943a))
131
+
132
+ ## [3.24.0-23](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-22...v3.24.0-23) (2021-05-17)
133
+
134
+
135
+ ### Features
136
+
137
+ * add temporaryTeams ([3e0c94b](https://github.com/SportsBroker-HQ/firebase-structure/commit/3e0c94b16db3f364555adf2bf53a7227db7efbab))
138
+
139
+ ## [3.24.0-22](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-21...v3.24.0-22) (2021-05-14)
140
+
141
+
142
+ ### Features
143
+
144
+ * add missed penalty event, add period to events ([42293fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/42293feefc383900fa456d8dfef80ade0581c3b6))
145
+
146
+ ## [3.24.0-21](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-20...v3.24.0-21) (2021-05-12)
147
+
148
+
149
+ ### Features
150
+
151
+ * add short name to league table ([db3a43f](https://github.com/SportsBroker-HQ/firebase-structure/commit/db3a43f11484f3c6c42bc87261b7dbeebcca3a87))
152
+
153
+ ## [3.24.0-20](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-19...v3.24.0-20) (2021-05-11)
154
+
155
+
156
+ ### Features
157
+
158
+ * mark teams as optional ([98a7b6b](https://github.com/SportsBroker-HQ/firebase-structure/commit/98a7b6b9daabceb41f6450f6ff6e51054248b37f))
159
+
160
+ ## [3.24.0-19](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-17...v3.24.0-19) (2021-05-10)
161
+
162
+
163
+ ### Features
164
+
165
+ * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
166
+ * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
167
+
168
+
169
+ ### Bug Fixes
170
+
171
+ * converted commentary type from enum to strings union ([#144](https://github.com/SportsBroker-HQ/firebase-structure/issues/144)) ([97e0fbe](https://github.com/SportsBroker-HQ/firebase-structure/commit/97e0fbedea00b2e9a70b1ee41db7c6fd286f2b15))
172
+
173
+ ## [3.24.0-18](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-17...v3.24.0-18) (2021-05-10)
174
+
175
+
176
+ ### Features
177
+
178
+ * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
179
+ * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
180
+
181
+
182
+ ### Bug Fixes
183
+
184
+ * converted commentary type from enum to strings union ([#144](https://github.com/SportsBroker-HQ/firebase-structure/issues/144)) ([97e0fbe](https://github.com/SportsBroker-HQ/firebase-structure/commit/97e0fbedea00b2e9a70b1ee41db7c6fd286f2b15))
185
+
186
+ ## [3.24.0-17](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-16...v3.24.0-17) (2021-05-06)
187
+
188
+
189
+ ### Features
190
+
191
+ * make sub player in optional ([2f66535](https://github.com/SportsBroker-HQ/firebase-structure/commit/2f66535bb82037854865ebd0d37bca5b7cb443b8))
192
+ * new match statistics [ch14445] ([e1b598e](https://github.com/SportsBroker-HQ/firebase-structure/commit/e1b598eaf702948e33c27d9e6fccf95e53c6cafa))
193
+
194
+ ## [3.24.0-16](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-15...v3.24.0-16) (2021-04-23)
195
+
196
+
197
+ ### Features
198
+
199
+ * adjust head to head structure ([a9e03d0](https://github.com/SportsBroker-HQ/firebase-structure/commit/a9e03d09e5632b0a52ab0fd13559320a6ba62fda))
200
+
201
+ ## [3.24.0-15](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-14...v3.24.0-15) (2021-04-21)
202
+
203
+ ## [3.24.0-14](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-13...v3.24.0-14) (2021-04-21)
204
+
205
+
206
+ ### Bug Fixes
207
+
208
+ * prevent remove of stages/groups ([cf92497](https://github.com/SportsBroker-HQ/firebase-structure/commit/cf9249774fa323eb2317e70488593e9b2c162686))
209
+
210
+ ## [3.24.0-13](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-12...v3.24.0-13) (2021-04-21)
211
+
212
+
213
+ ### Features
214
+
215
+ * set prev/next match as optional ([fa64283](https://github.com/SportsBroker-HQ/firebase-structure/commit/fa64283cd8059db43baeefa4c75c04b97652125e))
216
+
217
+ ## [3.24.0-12](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-11...v3.24.0-12) (2021-04-21)
218
+
219
+
220
+ ### Features
221
+
222
+ * add stages, groups ([7e0bf8f](https://github.com/SportsBroker-HQ/firebase-structure/commit/7e0bf8f96d65e84abb4e463ef0dd0f2ca643467a))
223
+
224
+ ## [3.24.0-11](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-10...v3.24.0-11) (2021-04-19)
225
+
226
+
227
+ ### Features
228
+
229
+ * add match team predicate ([1b01393](https://github.com/SportsBroker-HQ/firebase-structure/commit/1b013931dd54e080569fd01b5a2f1a60cc982432))
230
+
231
+ ## [3.24.0-10](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-9...v3.24.0-10) (2021-04-19)
232
+
233
+
234
+ ### Bug Fixes
235
+
236
+ * revert snapshots structures ([4dffdbe](https://github.com/SportsBroker-HQ/firebase-structure/commit/4dffdbeadde47e7cd977be4d639c1b2a013015fc))
237
+
5
238
  ## [3.24.0-9](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-7...v3.24.0-9) (2021-04-16)
6
239
 
7
240
 
@@ -1,4 +1,4 @@
1
- import { Platforms, Percentage } from "../global";
1
+ import { Platforms, Percentage, MarketingOffers } from "../global";
2
2
 
3
3
  export interface Config {
4
4
  statusCheckRequired: boolean;
@@ -6,4 +6,5 @@ export interface Config {
6
6
  instantSellPriceFactor: Percentage;
7
7
  maximumOwnedCards: number;
8
8
  publisherId: Record<Platforms, string>;
9
+ marketingOffers: Record<MarketingOffers, boolean | null>;
9
10
  }
@@ -5,10 +5,11 @@ import { Shares } from "./shares";
5
5
  import { Stats } from "./stats";
6
6
  import { Teams } from "./teams";
7
7
  import { Lineups } from "./lineups";
8
- import { Referees } from "./referees";
9
8
  import { Stories } from "./stories";
10
9
  import { Commentaries } from "./commentaries";
11
10
  import { HeadToHeadStats } from "./h2h";
11
+ import { MatchTeamPredicates } from "./matchTeamPredicate";
12
+ import { MatchOfficials } from "./officials";
12
13
 
13
14
  export interface Matches {
14
15
  events: Events;
@@ -19,7 +20,8 @@ export interface Matches {
19
20
  teams: Teams;
20
21
  h2h?: HeadToHeadStats;
21
22
  lineups?: Lineups;
22
- referees?: Referees;
23
+ officials?: MatchOfficials;
23
24
  stories?: Stories;
24
25
  commentaries?: Commentaries;
26
+ predicates?: MatchTeamPredicates;
25
27
  }
@@ -1,6 +1,7 @@
1
1
  export interface CommentaryItem {
2
2
  period: number;
3
3
  content: string;
4
+ type: CommentaryType;
4
5
  time: {
5
6
  minutes: number;
6
7
  seconds: number;
@@ -8,10 +9,24 @@ export interface CommentaryItem {
8
9
  };
9
10
  }
10
11
 
12
+ export type CommentaryType =
13
+ | 'assist'
14
+ | 'comment'
15
+ | 'full time'
16
+ | 'goal'
17
+ | 'half time'
18
+ | 'comment_important'
19
+ | 'kick off'
20
+ | 'penalty'
21
+ | 'red card'
22
+ | 'second_yellow red card'
23
+ | 'secondyellow card'
24
+ | 'substitution'
25
+ | 'var'
26
+ | 'yellow card';
27
+
11
28
  export interface Commentaries {
12
29
  [sportID: string]: {
13
- [matchID: string]: {
14
- [commentaryID: string]: CommentaryItem;
15
- };
30
+ [matchID: string]: CommentaryItem[];
16
31
  };
17
32
  }
@@ -1,6 +1,13 @@
1
- import { NumericID, TeamSide, TeamID } from "../../global";
1
+ import { TeamSide, PlayerID, TeamID, MatchPeriod } from "../../global";
2
2
 
3
- type EventType = "YELLOW_CARD" | "RED_CARD" | "GOAL" | "SUBSTITUTION";
3
+ type EventType =
4
+ | "YELLOW_CARD"
5
+ | "RED_CARD"
6
+ | "GOAL"
7
+ | "SUBSTITUTION"
8
+ | "MISSED_PENALTY"
9
+ | "PENALTY_SHOOTOUT_GOAL"
10
+ | "PENALTY_SHOOTOUT_MISS";
4
11
 
5
12
  interface EventTime {
6
13
  minutes: number;
@@ -13,12 +20,13 @@ interface BaseEvent {
13
20
  time: EventTime;
14
21
  teamType: TeamSide;
15
22
  teamId: TeamID;
23
+ period: MatchPeriod;
16
24
  }
17
25
 
18
26
  interface RedCardEvent extends BaseEvent {
19
27
  type: "RED_CARD";
20
28
  isSecondYellow?: boolean;
21
- playerId: NumericID;
29
+ playerId: PlayerID;
22
30
  playerName: string;
23
31
  playerShirtName: string;
24
32
  playerUniform: string;
@@ -26,7 +34,7 @@ interface RedCardEvent extends BaseEvent {
26
34
 
27
35
  interface YellowCardEvent extends BaseEvent {
28
36
  type: "YELLOW_CARD";
29
- playerId: NumericID;
37
+ playerId: PlayerID;
30
38
  playerName: string;
31
39
  playerShirtName: string;
32
40
  playerUniform: string;
@@ -34,14 +42,31 @@ interface YellowCardEvent extends BaseEvent {
34
42
 
35
43
  interface GoalEvent extends BaseEvent {
36
44
  type: "GOAL";
37
- assistingPlayerId?: NumericID;
45
+ assistingPlayerId?: PlayerID;
38
46
  assistingPlayerName?: string;
39
47
  assistingPlayerShirtName?: string;
40
48
  assistingPlayerUniform?: string;
41
49
  goalNumber: number;
42
50
  penalty?: boolean;
43
51
  ownGoal?: boolean;
44
- playerId: NumericID;
52
+ playerId: PlayerID;
53
+ playerName: string;
54
+ playerShirtName: string;
55
+ playerUniform: string;
56
+ }
57
+
58
+ interface PenaltyShootoutShotEvent extends BaseEvent {
59
+ type: "PENALTY_SHOOTOUT_GOAL" | "PENALTY_SHOOTOUT_MISS";
60
+ playerId: PlayerID;
61
+ playerName: string;
62
+ playerShirtName: string;
63
+ playerUniform: string;
64
+ teamPenaltyNumber: number;
65
+ }
66
+
67
+ interface MissedPenaltyEvent extends BaseEvent {
68
+ type: "MISSED_PENALTY";
69
+ playerId: PlayerID;
45
70
  playerName: string;
46
71
  playerShirtName: string;
47
72
  playerUniform: string;
@@ -49,11 +74,11 @@ interface GoalEvent extends BaseEvent {
49
74
 
50
75
  interface SubstitutionEvent extends BaseEvent {
51
76
  type: "SUBSTITUTION";
52
- playerInId: NumericID;
53
- playerInName: string;
54
- playerInShirtName: string;
55
- playerInUniform: string;
56
- playerOutId: NumericID;
77
+ playerInId?: PlayerID;
78
+ playerInName?: string;
79
+ playerInShirtName?: string;
80
+ playerInUniform?: string;
81
+ playerOutId: PlayerID;
57
82
  playerOutName: string;
58
83
  playerOutShirtName: string;
59
84
  playerOutUniform: string;
@@ -66,7 +91,9 @@ export interface Events {
66
91
  | YellowCardEvent
67
92
  | RedCardEvent
68
93
  | GoalEvent
69
- | SubstitutionEvent;
94
+ | MissedPenaltyEvent
95
+ | SubstitutionEvent
96
+ | PenaltyShootoutShotEvent;
70
97
  };
71
98
  };
72
99
  }
@@ -1,11 +1,21 @@
1
- export interface HeadToHeadTeamStats {
2
- goals: number;
1
+ export interface TeamHeadToHeadStats {
3
2
  wins: number;
3
+ goals: number;
4
+ }
5
+
6
+ export interface TeamsHeadToHeadStats {
7
+ [teamId: string]: TeamHeadToHeadStats;
4
8
  }
5
9
 
6
10
  export interface HeadToHeadStats {
7
- stats: {
8
- [teamId: string]: HeadToHeadTeamStats;
9
- };
11
+ teamsData: TeamsHeadToHeadStats;
10
12
  draws: number;
11
13
  }
14
+
15
+ // h2hId - "<teamAId>_<teamBId>" or "<teamBId>_<teamAId>"
16
+
17
+ export interface HeadToHead {
18
+ [sportId: string]: {
19
+ [h2hId: string]: HeadToHeadStats,
20
+ }
21
+ }
@@ -1,9 +1,18 @@
1
+ import { PlayerID } from '../../global';
2
+
3
+ export type FieldPosition =
4
+ | 'attacker'
5
+ | 'midfielder'
6
+ | 'defender'
7
+ | 'goalkeeper'
8
+ | 'unknown';
9
+
1
10
  export interface Player {
2
- playerId: number;
11
+ playerId: PlayerID;
3
12
  displayName: string;
4
13
  shirtName: string;
5
14
  uniform: string;
6
- position?: string | null;
15
+ position: FieldPosition;
7
16
  startingLineup: boolean;
8
17
  isOnPitch: boolean;
9
18
  formation?: number | null;
@@ -0,0 +1,10 @@
1
+ export interface MatchTeamPredicate {
2
+ // Winner of the current match will go to nextMatchWinnerId match
3
+ nextMatchWinnerId: string;
4
+ }
5
+
6
+ export interface MatchTeamPredicates {
7
+ [sportID: string]: {
8
+ [matchID: string]: MatchTeamPredicate;
9
+ }
10
+ }
@@ -0,0 +1,18 @@
1
+ export enum MatchOfficialType {
2
+ FourthOfficial = 'Fourth official',
3
+ Lineman1 = 'Lineman 1',
4
+ Lineman2 = 'Lineman 2',
5
+ Main = 'Main',
6
+ }
7
+
8
+ export interface MatchOfficial {
9
+ firstName: string;
10
+ lastName: string;
11
+ officialType: MatchOfficialType;
12
+ }
13
+
14
+ export interface MatchOfficials {
15
+ [sportID: string]: {
16
+ [matchID: string]: MatchOfficial[];
17
+ };
18
+ }
@@ -1,4 +1,4 @@
1
- import {ISODate, MatchID, MatchPeriod, MatchStatus, SeasonID} from "../../global";
1
+ import {Group, ISODate, MatchID, MatchPeriod, MatchStatus, SeasonID, Stage} from "../../global";
2
2
 
3
3
  export interface MatchTime {
4
4
  minutes: number;
@@ -18,8 +18,11 @@ export interface MatchOverview {
18
18
  roundNb: number;
19
19
  originalRoundNb: number;
20
20
  isTba: boolean;
21
+ stage?: Stage;
22
+ group?: Group;
21
23
  eventStatus: EventStatus;
22
24
  season: SeasonID;
25
+ tournamentType: 'DOMESTIC' | 'INTERNATIONAL';
23
26
  }
24
27
 
25
28
  export interface Overviews {
@@ -3,18 +3,17 @@ export interface Score {
3
3
  away: number | null;
4
4
  }
5
5
 
6
- // @TODO: change to firstHalf, fullTime, overtime
7
- export interface MatchPeriods{
8
- firstHalf: Score;
6
+ export interface MatchScore {
7
+ home: number | null; // total without penalties
8
+ away: number | null; // total without penalties
9
+ periods: MatchPeriods;
10
+ }
11
+
12
+ export interface MatchPeriods {
13
+ firstHalf?: Score;
9
14
  secondHalf?: Score;
10
15
  firstOvertime?: Score;
11
16
  secondOvertime?: Score;
12
- }
13
-
14
- export interface MatchScore {
15
- home: number | null;
16
- away: number | null;
17
- periods: MatchPeriods;
18
17
  shootoutPenalties?: Score;
19
18
  }
20
19
 
@@ -3,36 +3,78 @@ export interface TeamsStats {
3
3
  away: number;
4
4
  }
5
5
 
6
- export interface MatchStats {
6
+ /**
7
+ * @see: https://sportsbroker.slite.com/app/channels/VOZ0prjzHu/notes/tOQ3uR_FUT
8
+ */
9
+ export interface MatchStats {
10
+ // possession
11
+ possessionPercentageLast15: TeamsStats,
12
+ possessionPercentageLast30: TeamsStats,
7
13
  possession: TeamsStats,
8
- attackingThirdPossession: TeamsStats,
9
- ownThirdPossession: TeamsStats,
10
- shotsOnTarget: TeamsStats,
14
+ possessionLosses: TeamsStats,
15
+ possessionWonAttThird: TeamsStats,
16
+ possessionWonDefThird: TeamsStats,
17
+ possessionWonMidThird: TeamsStats,
18
+
19
+ // shots
20
+ bigChanceCreated: TeamsStats,
21
+ bigChanceMissed: TeamsStats,
22
+ bigChanceScored: TeamsStats,
23
+ crossbarHits: TeamsStats,
24
+ postHitsLeft: TeamsStats,
25
+ postHitsRight: TeamsStats,
26
+ shots: TeamsStats,
11
27
  shotsOffTarget: TeamsStats,
12
- clearances: TeamsStats,
28
+ shotsOnTarget: TeamsStats,
29
+ woodwork: TeamsStats,
30
+
31
+ // attacking
32
+ goalAssists: TeamsStats,
33
+ freeKickAwarded: TeamsStats,
34
+ fastbreak: TeamsStats,
13
35
  corners: TeamsStats,
36
+ throws: TeamsStats,
14
37
  offsides: TeamsStats,
15
- passes: TeamsStats,
16
- interceptions: TeamsStats,
17
- penalties: TeamsStats,
18
- shots: TeamsStats,
19
- ownGoals: TeamsStats,
38
+
39
+ // defensive
40
+ fouls: TeamsStats,
20
41
  saves: TeamsStats,
21
- freeKickAwarded: TeamsStats,
22
- freeKickConceded: TeamsStats,
42
+ penaltySave: TeamsStats,
43
+ ownGoals: TeamsStats,
44
+ interceptionsInBox: TeamsStats,
45
+ clearance: TeamsStats,
46
+ interceptions: TeamsStats,
23
47
  crossBlocked: TeamsStats,
48
+ shotBlocked: TeamsStats,
24
49
  tackles: TeamsStats,
25
- touches: TeamsStats,
26
- yellowCards: TeamsStats,
27
- redCards: TeamsStats,
28
- foulsConceded: TeamsStats,
29
- groundDuelsWon: TeamsStats,
30
- aerialDuelsWon: TeamsStats,
31
- punches: TeamsStats,
32
- cornerKicks: TeamsStats,
33
- successfulPasses: TeamsStats,
50
+
51
+ //passing
52
+ passes: TeamsStats,
53
+ backwardPass: TeamsStats,
54
+ forwardPass: TeamsStats,
34
55
  successfulCrosses: TeamsStats,
56
+ unsuccessfulCrosses: TeamsStats,
57
+ successfulPasses: TeamsStats,
35
58
  unsuccessfulPasses: TeamsStats,
59
+ successfulLongBalls: TeamsStats,
60
+ unsuccessfulLongBalls: TeamsStats,
61
+ penaltyAreaEntries: TeamsStats,
62
+
63
+ // 1vs1
64
+ duelsWon: TeamsStats,
65
+ duelsLost: TeamsStats,
66
+ groundDuelsWon: TeamsStats,
67
+ groundDuelsLost: TeamsStats,
68
+ aerialDuelsWon: TeamsStats,
69
+ aerialDuelsLost: TeamsStats,
70
+ oneOnOneShotAttempt: TeamsStats,
71
+
72
+ // discipline
73
+ yellowCards: TeamsStats,
74
+ redCards: TeamsStats,
75
+ penaltyGoal: TeamsStats,
76
+ penaltyConceded: TeamsStats,
77
+ penaltyTaken: TeamsStats,
36
78
  }
37
79
 
38
80
  export interface Stats {
@@ -3,6 +3,7 @@ import { Image, TeamID } from "../../global";
3
3
  export interface MatchTeam {
4
4
  id: TeamID;
5
5
  name: string;
6
+ shortName: string;
6
7
  abbreviation: string;
7
8
  logo?: Image;
8
9
  }
@@ -10,8 +11,8 @@ export interface MatchTeam {
10
11
  export interface Teams {
11
12
  [sportID: string]: {
12
13
  [matchID: string]: {
13
- home: MatchTeam;
14
- away: MatchTeam;
14
+ home?: MatchTeam;
15
+ away?: MatchTeam;
15
16
  };
16
17
  };
17
18
  }
@@ -1,5 +1,6 @@
1
1
  import { Overviews } from "./overviews";
2
2
  import { TeamsInSeasons } from "./teams";
3
+ import { Stages } from "./stages";
3
4
 
4
5
  export interface Seasons {
5
6
  overviews: Overviews;
@@ -1,7 +1,10 @@
1
1
  import { ISODate, Image, SeasonID } from "../../global";
2
+ import {Stages} from "./stages";
2
3
 
3
4
  export type SeasonState = 'UPCOMING' | 'ACTIVE' | 'FINISHED';
4
5
  export type SeasonType = 'DOMESTIC' | 'INTERNATIONAL';
6
+ export type TournamentStage = 'group' | 'knockout';
7
+
5
8
 
6
9
  export interface SeasonOverview {
7
10
  endDate: ISODate;
@@ -14,6 +17,9 @@ export interface SeasonOverview {
14
17
  logo?: Image;
15
18
  type: SeasonType;
16
19
  countryCode?: string;
20
+ stages?: Stages;
21
+ stage?: TournamentStage;
22
+ order?: number;
17
23
  }
18
24
 
19
25
  /**
@@ -0,0 +1,12 @@
1
+ export interface Stage {
2
+ name: string;
3
+ matchesIds: { [matchId: string]: true };
4
+ }
5
+
6
+ export interface Stages {
7
+ [sportId: string]: {
8
+ [seasonId: string]: {
9
+ [stageId: string]: Stage;
10
+ }
11
+ }
12
+ }
@@ -2,6 +2,7 @@ import { Image } from "../../global";
2
2
 
3
3
  export interface TableTeam {
4
4
  name: string;
5
+ shortName: string;
5
6
  abbreviation: string;
6
7
  logo?: Image;
7
8
  }
@@ -1,6 +1,6 @@
1
1
  import { TeamID } from "../../global";
2
2
 
3
- export type TradingInactiveReason = "SPLIT_IN_PROGRESS" | "NONE" | "MANUAL" | "BANKRUPTCY" | "VAR";
3
+ export type TradingInactiveReason = "SPLIT_IN_PROGRESS" | "NONE" | "MANUAL" | "BANKRUPTCY" | "VAR" | "TEMP_GOAL";
4
4
 
5
5
  export interface MarketIndicators {
6
6
  dailyHigh: number;
@@ -6,6 +6,19 @@ export type OrderTransactionType = "MARKET" | "LIMIT" | "INSTANT" | "BANKRUPT";
6
6
 
7
7
  export type OrderStatus = "ACTIVE" | "COMPLETED" | "ABORTED" | "CANCELLED";
8
8
 
9
+ export type OrderAbortReason =
10
+ | "NOT_ENOUGH_SHARES"
11
+ | "SELF_EXCLUSION"
12
+ | "ACCOUNT_BLOCKED"
13
+ | "ACCOUNT_CLOSURE"
14
+ | "SPLIT_DIV"
15
+ | "BET_MARGIN"
16
+ | "BANKRUPT"
17
+ | "SEASON_END"
18
+ | "NOT_ENOUGH_FUNDS"
19
+ | "TOO_SMALL_ORDER_VALUE"
20
+ | "EXCEEDED_WAGERING_LIMITS";
21
+
9
22
  type OrderID = string;
10
23
 
11
24
  export interface Order {
@@ -26,6 +39,9 @@ export interface Order {
26
39
  updatedAt: ISODate;
27
40
  status: OrderStatus;
28
41
  id: OrderID;
42
+ totalPrice: number;
43
+ preciseSharesValue: number;
44
+ abortReason: OrderAbortReason | null;
29
45
  vatPercentage?: number;
30
46
  vatProcessed?: number;
31
47
  childId?: OrderID;
@@ -1,5 +1,6 @@
1
1
  export enum UserStatus {
2
2
  CREATED = "CREATED",
3
+ EMAIL_CONFIRMED = "EMAIL_CONFIRMED",
3
4
  ACTIVATED = "ACTIVATED",
4
5
  DEACTIVATED = "DEACTIVATED",
5
6
  BANNED = "BANNED",
@@ -5,6 +5,7 @@ export interface UserWallet {
5
5
  invested: number;
6
6
  profit: number;
7
7
  equity: number;
8
+ bonus: number;
8
9
  }
9
10
 
10
11
  /**
@@ -33,6 +33,13 @@ export type SeasonID = string;
33
33
 
34
34
  export type GroupID = string;
35
35
 
36
+ /**
37
+ * Until we will support external player ids and there is need
38
+ * to have match unique player ids it will be constructed as
39
+ * concatenation of Team ID and Player uniform number
40
+ *
41
+ * ie. 5f4160de-72d3-4821-ae19-6bfb4f05a0c9_11
42
+ */
36
43
  export type PlayerID = string;
37
44
 
38
45
  export type Percentage = number // 0.0-1.0
@@ -68,4 +75,14 @@ export interface WithSeasons {
68
75
  };
69
76
  }
70
77
 
78
+ export type MarketingOffers = "REGISTER2021";
79
+
71
80
  export type Platforms = 'IOS' | 'WEB' | 'ANDROID';
81
+
82
+ export interface Stage {
83
+ id: string;
84
+ }
85
+
86
+ export interface Group {
87
+ id: string;
88
+ }
@@ -1,4 +1,4 @@
1
- import {ISODate, MatchID, MatchStatus} from "../global";
1
+ import {Group, ISODate, MatchID, MatchStatus, Stage} from "../global";
2
2
 
3
3
  export interface MatchQueryData {
4
4
  id: MatchID;
@@ -6,6 +6,8 @@ export interface MatchQueryData {
6
6
  realStartDate: ISODate; // Real start time, f.e match was delayed
7
7
  roundNb: number;
8
8
  matchStatus: MatchStatus;
9
+ stage?: Stage;
10
+ group?: Group;
9
11
  }
10
12
 
11
13
  interface Matches {
@@ -1,15 +1,30 @@
1
- import {Image, ISODate, MatchPeriod, MatchResult, MatchSide, MatchStatus, TeamID, TeamSide} from "../global";
1
+ import {
2
+ Group,
3
+ Image,
4
+ ISODate,
5
+ MatchPeriod,
6
+ MatchResult,
7
+ MatchSide,
8
+ MatchStatus,
9
+ Stage,
10
+ TeamID,
11
+ TeamSide
12
+ } from "../global";
2
13
 
3
14
  export interface Team {
4
15
  id: TeamID;
5
16
  name: string;
17
+ shortName: string;
6
18
  abbreviation: string;
7
19
  logo?: Image;
8
20
  }
9
21
 
10
22
  export interface Opponent {
11
23
  score: number;
24
+ name: string;
12
25
  teamId: string;
26
+ abbreviation: string;
27
+ logo?: Image;
13
28
  }
14
29
 
15
30
  export interface PreviousMatch {
@@ -42,11 +57,11 @@ export interface EventStatus {
42
57
 
43
58
  export interface MatchOverviewSnapshot {
44
59
  id: string;
45
- teams: {
46
- home: Team;
47
- away: Team;
60
+ teams?: {
61
+ home?: Team;
62
+ away?: Team;
48
63
  };
49
- score: {
64
+ score?: {
50
65
  home: number;
51
66
  away: number;
52
67
  };
@@ -54,6 +69,13 @@ export interface MatchOverviewSnapshot {
54
69
  home: Share;
55
70
  away: Share;
56
71
  };
72
+ temporaryTeams?: {
73
+ home?: string;
74
+ away?: string;
75
+ };
76
+ tournamentType: 'DOMESTIC' | 'INTERNATIONAL';
77
+ stage?: Stage;
78
+ group?: Group;
57
79
  startDate: ISODate;
58
80
  roundNb: number;
59
81
  eventStatus: EventStatus;
@@ -1,24 +1,30 @@
1
1
  import { TeamRanking } from "../details/tables/ranking";
2
+ import {Image, MatchResult} from "../global";
3
+ import {Team} from "./matchOverviews";
4
+
5
+ export interface MatchOveriew {
6
+ vsTeam?: Team;
7
+ result?: MatchResult;
8
+ matchId?: string;
9
+ startDate?: string;
10
+ }
2
11
 
3
12
  export interface TeamTable {
13
+ name: string;
14
+ abbreviation: string;
15
+ shortName: string;
16
+ logo: Image;
4
17
  ranking: TeamRanking;
18
+ groupId?: string;
5
19
  previousMatchId?: string;
6
20
  nextMatchId?: string;
21
+ nextMatch?: MatchOveriew;
22
+ previousMatch?: MatchOveriew;
7
23
  }
8
24
 
9
25
  export interface GroupTable {
10
26
  name: string;
11
- matchesIds: string[];
12
- ranking: {
13
- [teamID: string]: TeamRanking;
14
- }
15
- }
16
-
17
- export interface SeasonTable {
18
- groupIds?: string[];
19
- table: {
20
- [teamID: string]: TeamTable;
21
- }
27
+ matchesIds: {[matchId: string]: true};
22
28
  }
23
29
 
24
30
  export interface TableSummary {
@@ -31,7 +37,9 @@ export interface TableSummary {
31
37
  };
32
38
  leagues: {
33
39
  [sportID: string]: {
34
- [seasonID: string]: SeasonTable;
40
+ [seasonID: string]: {
41
+ [teamID: string]: TeamTable;
42
+ };
35
43
  };
36
44
  };
37
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.24.0-9",
3
+ "version": "3.25.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {
@@ -1,13 +0,0 @@
1
- export interface MatchReferees {
2
- referee: string;
3
- refereeAssistants: string[];
4
- fourthOfficial: string;
5
- varOfficial: string;
6
- varAssistants: string[];
7
- }
8
-
9
- export interface Referees {
10
- [sportID: string]: {
11
- [matchID: string]: MatchReferees;
12
- };
13
- }