@sportsbroker/firebase-structure 3.24.0-8 → 3.24.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,238 @@
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.24.0](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-38...v3.24.0) (2021-09-01)
6
+
7
+
8
+ ### Features
9
+
10
+ * add marketing offers to config ([c2b9e4e](https://github.com/SportsBroker-HQ/firebase-structure/commit/c2b9e4e00a9e52d197f3c5eeb594b3106eb46096))
11
+
12
+ ## [3.24.0-38](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-37...v3.24.0-38) (2021-08-22)
13
+
14
+
15
+ ### Features
16
+
17
+ * add bonus to wallet ([51d5acd](https://github.com/SportsBroker-HQ/firebase-structure/commit/51d5acd4f2fa0b91a0ee02e6ded1958ea802a198))
18
+
19
+ ## [3.24.0-37](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-36...v3.24.0-37) (2021-08-17)
20
+
21
+ ## [3.24.0-36](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-35...v3.24.0-36) (2021-08-09)
22
+
23
+
24
+ ### Features
25
+
26
+ * add abortReason to orders ([260cdef](https://github.com/SportsBroker-HQ/firebase-structure/commit/260cdeff97656cfad4620230d65f6839fd47039d))
27
+
28
+ ## [3.24.0-35](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-34...v3.24.0-35) (2021-08-03)
29
+
30
+
31
+ ### Features
32
+
33
+ * add preciseSharesValue to order ([db2a0c3](https://github.com/SportsBroker-HQ/firebase-structure/commit/db2a0c35ca242ed8400c7bcf8680f3910976c444))
34
+
35
+ ## [3.24.0-34](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-32...v3.24.0-34) (2021-07-29)
36
+
37
+
38
+ ### Features
39
+
40
+ * adder totalPrice to order details ([01844f2](https://github.com/SportsBroker-HQ/firebase-structure/commit/01844f22fc90630f1d19f55f7b7ad5d71f96c6b7))
41
+
42
+ ## [3.24.0-33](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-32...v3.24.0-33) (2021-07-26)
43
+
44
+ ## [3.24.0-32](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-31...v3.24.0-32) (2021-07-12)
45
+
46
+
47
+ ### Features
48
+
49
+ * added ordering for seasons ([4ec93e8](https://github.com/SportsBroker-HQ/firebase-structure/commit/4ec93e816692d64056f7279232912fabd06dea5d))
50
+
51
+ ## [3.24.0-31](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-30...v3.24.0-31) (2021-06-21)
52
+
53
+
54
+ ### Features
55
+
56
+ * added temp goal to trading inactivity reasons ([98c7f35](https://github.com/SportsBroker-HQ/firebase-structure/commit/98c7f359294e56f08c84a5295de44f65ef8780e8))
57
+
58
+ ## [3.24.0-30](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-29...v3.24.0-30) (2021-06-16)
59
+
60
+
61
+ ### Features
62
+
63
+ * field position types ([#145](https://github.com/SportsBroker-HQ/firebase-structure/issues/145)) ([393e46c](https://github.com/SportsBroker-HQ/firebase-structure/commit/393e46cc97eced1624e4bbcaa82f12ea7f4a4f31))
64
+
65
+ ## [3.24.0-29](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-28...v3.24.0-29) (2021-05-28)
66
+
67
+
68
+ ### Features
69
+
70
+ * match score structure update - include penalties in periods ([3ae52f7](https://github.com/SportsBroker-HQ/firebase-structure/commit/3ae52f7d14554ce02b0cdc55c64bd4e146b9e33b))
71
+
72
+ ## [3.24.0-28](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-26...v3.24.0-28) (2021-05-27)
73
+
74
+
75
+ ### Features
76
+
77
+ * added penalty shootout events ([c62dba9](https://github.com/SportsBroker-HQ/firebase-structure/commit/c62dba96d138bd3215ab3b437b2d93ccdf272990))
78
+ * identify player by quasi unique id ([71f9554](https://github.com/SportsBroker-HQ/firebase-structure/commit/71f955447310c75d6ffa9f00dff3ba9a722aee6a))
79
+
80
+ ## [3.24.0-27](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-26...v3.24.0-27) (2021-05-20)
81
+
82
+
83
+ ### Features
84
+
85
+ * identify player by quasi unique id ([71f9554](https://github.com/SportsBroker-HQ/firebase-structure/commit/71f955447310c75d6ffa9f00dff3ba9a722aee6a))
86
+
87
+ ## [3.24.0-26](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-16...v3.24.0-26) (2021-05-20)
88
+
89
+
90
+ ### Features
91
+
92
+ * add missed penalty event, add period to events ([42293fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/42293feefc383900fa456d8dfef80ade0581c3b6))
93
+ * add short name to league table ([db3a43f](https://github.com/SportsBroker-HQ/firebase-structure/commit/db3a43f11484f3c6c42bc87261b7dbeebcca3a87))
94
+ * add temporaryTeams ([3e0c94b](https://github.com/SportsBroker-HQ/firebase-structure/commit/3e0c94b16db3f364555adf2bf53a7227db7efbab))
95
+ * add tournament type to match ([07a9531](https://github.com/SportsBroker-HQ/firebase-structure/commit/07a9531a80f4756a6264e87bb0c4c1c59f76943a))
96
+ * add tournament type to match ([f6bb925](https://github.com/SportsBroker-HQ/firebase-structure/commit/f6bb9257d6c2848a09cf06153c42a8209e0086ff))
97
+ * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
98
+ * added tournament stage ([2b189d7](https://github.com/SportsBroker-HQ/firebase-structure/commit/2b189d7bec15763309200736e8554fcbf98c656d))
99
+ * make sub player in optional ([2f66535](https://github.com/SportsBroker-HQ/firebase-structure/commit/2f66535bb82037854865ebd0d37bca5b7cb443b8))
100
+ * mark teams as optional ([98a7b6b](https://github.com/SportsBroker-HQ/firebase-structure/commit/98a7b6b9daabceb41f6450f6ff6e51054248b37f))
101
+ * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
102
+ * new match statistics [ch14445] ([e1b598e](https://github.com/SportsBroker-HQ/firebase-structure/commit/e1b598eaf702948e33c27d9e6fccf95e53c6cafa))
103
+
104
+
105
+ ### Bug Fixes
106
+
107
+ * 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))
108
+
109
+ ## [3.24.0-25](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-24...v3.24.0-25) (2021-05-19)
110
+
111
+
112
+ ### Features
113
+
114
+ * add tournament type to match ([f6bb925](https://github.com/SportsBroker-HQ/firebase-structure/commit/f6bb9257d6c2848a09cf06153c42a8209e0086ff))
115
+
116
+ ## [3.24.0-24](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-23...v3.24.0-24) (2021-05-17)
117
+
118
+
119
+ ### Features
120
+
121
+ * add tournament type to match ([07a9531](https://github.com/SportsBroker-HQ/firebase-structure/commit/07a9531a80f4756a6264e87bb0c4c1c59f76943a))
122
+
123
+ ## [3.24.0-23](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-22...v3.24.0-23) (2021-05-17)
124
+
125
+
126
+ ### Features
127
+
128
+ * add temporaryTeams ([3e0c94b](https://github.com/SportsBroker-HQ/firebase-structure/commit/3e0c94b16db3f364555adf2bf53a7227db7efbab))
129
+
130
+ ## [3.24.0-22](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-21...v3.24.0-22) (2021-05-14)
131
+
132
+
133
+ ### Features
134
+
135
+ * add missed penalty event, add period to events ([42293fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/42293feefc383900fa456d8dfef80ade0581c3b6))
136
+
137
+ ## [3.24.0-21](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-20...v3.24.0-21) (2021-05-12)
138
+
139
+
140
+ ### Features
141
+
142
+ * add short name to league table ([db3a43f](https://github.com/SportsBroker-HQ/firebase-structure/commit/db3a43f11484f3c6c42bc87261b7dbeebcca3a87))
143
+
144
+ ## [3.24.0-20](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-19...v3.24.0-20) (2021-05-11)
145
+
146
+
147
+ ### Features
148
+
149
+ * mark teams as optional ([98a7b6b](https://github.com/SportsBroker-HQ/firebase-structure/commit/98a7b6b9daabceb41f6450f6ff6e51054248b37f))
150
+
151
+ ## [3.24.0-19](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-17...v3.24.0-19) (2021-05-10)
152
+
153
+
154
+ ### Features
155
+
156
+ * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
157
+ * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
158
+
159
+
160
+ ### Bug Fixes
161
+
162
+ * 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))
163
+
164
+ ## [3.24.0-18](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-17...v3.24.0-18) (2021-05-10)
165
+
166
+
167
+ ### Features
168
+
169
+ * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
170
+ * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
171
+
172
+
173
+ ### Bug Fixes
174
+
175
+ * 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))
176
+
177
+ ## [3.24.0-17](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-16...v3.24.0-17) (2021-05-06)
178
+
179
+
180
+ ### Features
181
+
182
+ * make sub player in optional ([2f66535](https://github.com/SportsBroker-HQ/firebase-structure/commit/2f66535bb82037854865ebd0d37bca5b7cb443b8))
183
+ * new match statistics [ch14445] ([e1b598e](https://github.com/SportsBroker-HQ/firebase-structure/commit/e1b598eaf702948e33c27d9e6fccf95e53c6cafa))
184
+
185
+ ## [3.24.0-16](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-15...v3.24.0-16) (2021-04-23)
186
+
187
+
188
+ ### Features
189
+
190
+ * adjust head to head structure ([a9e03d0](https://github.com/SportsBroker-HQ/firebase-structure/commit/a9e03d09e5632b0a52ab0fd13559320a6ba62fda))
191
+
192
+ ## [3.24.0-15](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-14...v3.24.0-15) (2021-04-21)
193
+
194
+ ## [3.24.0-14](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-13...v3.24.0-14) (2021-04-21)
195
+
196
+
197
+ ### Bug Fixes
198
+
199
+ * prevent remove of stages/groups ([cf92497](https://github.com/SportsBroker-HQ/firebase-structure/commit/cf9249774fa323eb2317e70488593e9b2c162686))
200
+
201
+ ## [3.24.0-13](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-12...v3.24.0-13) (2021-04-21)
202
+
203
+
204
+ ### Features
205
+
206
+ * set prev/next match as optional ([fa64283](https://github.com/SportsBroker-HQ/firebase-structure/commit/fa64283cd8059db43baeefa4c75c04b97652125e))
207
+
208
+ ## [3.24.0-12](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-11...v3.24.0-12) (2021-04-21)
209
+
210
+
211
+ ### Features
212
+
213
+ * add stages, groups ([7e0bf8f](https://github.com/SportsBroker-HQ/firebase-structure/commit/7e0bf8f96d65e84abb4e463ef0dd0f2ca643467a))
214
+
215
+ ## [3.24.0-11](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-10...v3.24.0-11) (2021-04-19)
216
+
217
+
218
+ ### Features
219
+
220
+ * add match team predicate ([1b01393](https://github.com/SportsBroker-HQ/firebase-structure/commit/1b013931dd54e080569fd01b5a2f1a60cc982432))
221
+
222
+ ## [3.24.0-10](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-9...v3.24.0-10) (2021-04-19)
223
+
224
+
225
+ ### Bug Fixes
226
+
227
+ * revert snapshots structures ([4dffdbe](https://github.com/SportsBroker-HQ/firebase-structure/commit/4dffdbeadde47e7cd977be4d639c1b2a013015fc))
228
+
229
+ ## [3.24.0-9](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-7...v3.24.0-9) (2021-04-16)
230
+
231
+
232
+ ### Features
233
+
234
+ * added type and countryCode to SeasonOverview ([dc420fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/dc420fe7566bb8bd0721668c449847b84a576588))
235
+ * adjust events teamId ([afc6b72](https://github.com/SportsBroker-HQ/firebase-structure/commit/afc6b727dfa5e0ba2cb558c54d7e15453a6a5efd))
236
+
5
237
  ## [3.24.0-8](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-7...v3.24.0-8) (2021-04-16)
6
238
 
7
239
 
@@ -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 } 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;
@@ -12,13 +19,14 @@ interface BaseEvent {
12
19
  type: EventType;
13
20
  time: EventTime;
14
21
  teamType: TeamSide;
15
- teamId: NumericID;
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,18 @@ 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
+
9
21
  type OrderID = string;
10
22
 
11
23
  export interface Order {
@@ -26,6 +38,9 @@ export interface Order {
26
38
  updatedAt: ISODate;
27
39
  status: OrderStatus;
28
40
  id: OrderID;
41
+ totalPrice: number;
42
+ preciseSharesValue: number;
43
+ abortReason: OrderAbortReason | null;
29
44
  vatPercentage?: number;
30
45
  vatProcessed?: number;
31
46
  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
  /**
@@ -8,9 +8,12 @@ export type NumericID = number;
8
8
  */
9
9
  export type MongoID = string;
10
10
 
11
+
12
+ export type UUID = string;
13
+
11
14
  export type UserID = MongoID;
12
15
 
13
- export type TeamID = MongoID;
16
+ export type TeamID = UUID;
14
17
 
15
18
  /**
16
19
  * @type ISO ISODate
@@ -24,12 +27,19 @@ export type SportID = "soccer" | string;
24
27
 
25
28
  export type Language = "en" | "de" | string;
26
29
 
27
- export type MatchID = MongoID;
30
+ export type MatchID = UUID;
28
31
 
29
32
  export type SeasonID = string;
30
33
 
31
34
  export type GroupID = string;
32
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
+ */
33
43
  export type PlayerID = string;
34
44
 
35
45
  export type Percentage = number // 0.0-1.0
@@ -65,4 +75,14 @@ export interface WithSeasons {
65
75
  };
66
76
  }
67
77
 
78
+ export type MarketingOffers = "REGISTER2021";
79
+
68
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-8",
3
+ "version": "3.24.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
- }