@sportsbroker/firebase-structure 3.24.0-3 → 3.24.0-31

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,227 @@
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-31](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-30...v3.24.0-31) (2021-06-21)
6
+
7
+
8
+ ### Features
9
+
10
+ * added temp goal to trading inactivity reasons ([98c7f35](https://github.com/SportsBroker-HQ/firebase-structure/commit/98c7f359294e56f08c84a5295de44f65ef8780e8))
11
+
12
+ ## [3.24.0-30](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-29...v3.24.0-30) (2021-06-16)
13
+
14
+
15
+ ### Features
16
+
17
+ * field position types ([#145](https://github.com/SportsBroker-HQ/firebase-structure/issues/145)) ([393e46c](https://github.com/SportsBroker-HQ/firebase-structure/commit/393e46cc97eced1624e4bbcaa82f12ea7f4a4f31))
18
+
19
+ ## [3.24.0-29](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-28...v3.24.0-29) (2021-05-28)
20
+
21
+
22
+ ### Features
23
+
24
+ * match score structure update - include penalties in periods ([3ae52f7](https://github.com/SportsBroker-HQ/firebase-structure/commit/3ae52f7d14554ce02b0cdc55c64bd4e146b9e33b))
25
+
26
+ ## [3.24.0-28](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-26...v3.24.0-28) (2021-05-27)
27
+
28
+
29
+ ### Features
30
+
31
+ * added penalty shootout events ([c62dba9](https://github.com/SportsBroker-HQ/firebase-structure/commit/c62dba96d138bd3215ab3b437b2d93ccdf272990))
32
+ * identify player by quasi unique id ([71f9554](https://github.com/SportsBroker-HQ/firebase-structure/commit/71f955447310c75d6ffa9f00dff3ba9a722aee6a))
33
+
34
+ ## [3.24.0-27](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-26...v3.24.0-27) (2021-05-20)
35
+
36
+
37
+ ### Features
38
+
39
+ * identify player by quasi unique id ([71f9554](https://github.com/SportsBroker-HQ/firebase-structure/commit/71f955447310c75d6ffa9f00dff3ba9a722aee6a))
40
+
41
+ ## [3.24.0-26](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-16...v3.24.0-26) (2021-05-20)
42
+
43
+
44
+ ### Features
45
+
46
+ * add missed penalty event, add period to events ([42293fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/42293feefc383900fa456d8dfef80ade0581c3b6))
47
+ * add short name to league table ([db3a43f](https://github.com/SportsBroker-HQ/firebase-structure/commit/db3a43f11484f3c6c42bc87261b7dbeebcca3a87))
48
+ * add temporaryTeams ([3e0c94b](https://github.com/SportsBroker-HQ/firebase-structure/commit/3e0c94b16db3f364555adf2bf53a7227db7efbab))
49
+ * add tournament type to match ([07a9531](https://github.com/SportsBroker-HQ/firebase-structure/commit/07a9531a80f4756a6264e87bb0c4c1c59f76943a))
50
+ * add tournament type to match ([f6bb925](https://github.com/SportsBroker-HQ/firebase-structure/commit/f6bb9257d6c2848a09cf06153c42a8209e0086ff))
51
+ * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
52
+ * added tournament stage ([2b189d7](https://github.com/SportsBroker-HQ/firebase-structure/commit/2b189d7bec15763309200736e8554fcbf98c656d))
53
+ * make sub player in optional ([2f66535](https://github.com/SportsBroker-HQ/firebase-structure/commit/2f66535bb82037854865ebd0d37bca5b7cb443b8))
54
+ * mark teams as optional ([98a7b6b](https://github.com/SportsBroker-HQ/firebase-structure/commit/98a7b6b9daabceb41f6450f6ff6e51054248b37f))
55
+ * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
56
+ * new match statistics [ch14445] ([e1b598e](https://github.com/SportsBroker-HQ/firebase-structure/commit/e1b598eaf702948e33c27d9e6fccf95e53c6cafa))
57
+
58
+
59
+ ### Bug Fixes
60
+
61
+ * 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))
62
+
63
+ ## [3.24.0-25](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-24...v3.24.0-25) (2021-05-19)
64
+
65
+
66
+ ### Features
67
+
68
+ * add tournament type to match ([f6bb925](https://github.com/SportsBroker-HQ/firebase-structure/commit/f6bb9257d6c2848a09cf06153c42a8209e0086ff))
69
+
70
+ ## [3.24.0-24](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-23...v3.24.0-24) (2021-05-17)
71
+
72
+
73
+ ### Features
74
+
75
+ * add tournament type to match ([07a9531](https://github.com/SportsBroker-HQ/firebase-structure/commit/07a9531a80f4756a6264e87bb0c4c1c59f76943a))
76
+
77
+ ## [3.24.0-23](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-22...v3.24.0-23) (2021-05-17)
78
+
79
+
80
+ ### Features
81
+
82
+ * add temporaryTeams ([3e0c94b](https://github.com/SportsBroker-HQ/firebase-structure/commit/3e0c94b16db3f364555adf2bf53a7227db7efbab))
83
+
84
+ ## [3.24.0-22](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-21...v3.24.0-22) (2021-05-14)
85
+
86
+
87
+ ### Features
88
+
89
+ * add missed penalty event, add period to events ([42293fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/42293feefc383900fa456d8dfef80ade0581c3b6))
90
+
91
+ ## [3.24.0-21](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-20...v3.24.0-21) (2021-05-12)
92
+
93
+
94
+ ### Features
95
+
96
+ * add short name to league table ([db3a43f](https://github.com/SportsBroker-HQ/firebase-structure/commit/db3a43f11484f3c6c42bc87261b7dbeebcca3a87))
97
+
98
+ ## [3.24.0-20](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-19...v3.24.0-20) (2021-05-11)
99
+
100
+
101
+ ### Features
102
+
103
+ * mark teams as optional ([98a7b6b](https://github.com/SportsBroker-HQ/firebase-structure/commit/98a7b6b9daabceb41f6450f6ff6e51054248b37f))
104
+
105
+ ## [3.24.0-19](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-17...v3.24.0-19) (2021-05-10)
106
+
107
+
108
+ ### Features
109
+
110
+ * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
111
+ * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
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-18](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-17...v3.24.0-18) (2021-05-10)
119
+
120
+
121
+ ### Features
122
+
123
+ * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
124
+ * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
125
+
126
+
127
+ ### Bug Fixes
128
+
129
+ * 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))
130
+
131
+ ## [3.24.0-17](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-16...v3.24.0-17) (2021-05-06)
132
+
133
+
134
+ ### Features
135
+
136
+ * make sub player in optional ([2f66535](https://github.com/SportsBroker-HQ/firebase-structure/commit/2f66535bb82037854865ebd0d37bca5b7cb443b8))
137
+ * new match statistics [ch14445] ([e1b598e](https://github.com/SportsBroker-HQ/firebase-structure/commit/e1b598eaf702948e33c27d9e6fccf95e53c6cafa))
138
+
139
+ ## [3.24.0-16](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-15...v3.24.0-16) (2021-04-23)
140
+
141
+
142
+ ### Features
143
+
144
+ * adjust head to head structure ([a9e03d0](https://github.com/SportsBroker-HQ/firebase-structure/commit/a9e03d09e5632b0a52ab0fd13559320a6ba62fda))
145
+
146
+ ## [3.24.0-15](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-14...v3.24.0-15) (2021-04-21)
147
+
148
+ ## [3.24.0-14](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-13...v3.24.0-14) (2021-04-21)
149
+
150
+
151
+ ### Bug Fixes
152
+
153
+ * prevent remove of stages/groups ([cf92497](https://github.com/SportsBroker-HQ/firebase-structure/commit/cf9249774fa323eb2317e70488593e9b2c162686))
154
+
155
+ ## [3.24.0-13](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-12...v3.24.0-13) (2021-04-21)
156
+
157
+
158
+ ### Features
159
+
160
+ * set prev/next match as optional ([fa64283](https://github.com/SportsBroker-HQ/firebase-structure/commit/fa64283cd8059db43baeefa4c75c04b97652125e))
161
+
162
+ ## [3.24.0-12](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-11...v3.24.0-12) (2021-04-21)
163
+
164
+
165
+ ### Features
166
+
167
+ * add stages, groups ([7e0bf8f](https://github.com/SportsBroker-HQ/firebase-structure/commit/7e0bf8f96d65e84abb4e463ef0dd0f2ca643467a))
168
+
169
+ ## [3.24.0-11](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-10...v3.24.0-11) (2021-04-19)
170
+
171
+
172
+ ### Features
173
+
174
+ * add match team predicate ([1b01393](https://github.com/SportsBroker-HQ/firebase-structure/commit/1b013931dd54e080569fd01b5a2f1a60cc982432))
175
+
176
+ ## [3.24.0-10](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-9...v3.24.0-10) (2021-04-19)
177
+
178
+
179
+ ### Bug Fixes
180
+
181
+ * revert snapshots structures ([4dffdbe](https://github.com/SportsBroker-HQ/firebase-structure/commit/4dffdbeadde47e7cd977be4d639c1b2a013015fc))
182
+
183
+ ## [3.24.0-9](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-7...v3.24.0-9) (2021-04-16)
184
+
185
+
186
+ ### Features
187
+
188
+ * added type and countryCode to SeasonOverview ([dc420fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/dc420fe7566bb8bd0721668c449847b84a576588))
189
+ * adjust events teamId ([afc6b72](https://github.com/SportsBroker-HQ/firebase-structure/commit/afc6b727dfa5e0ba2cb558c54d7e15453a6a5efd))
190
+
191
+ ## [3.24.0-8](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-7...v3.24.0-8) (2021-04-16)
192
+
193
+
194
+ ### Features
195
+
196
+ * added type and countryCode to SeasonOverview ([dc420fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/dc420fe7566bb8bd0721668c449847b84a576588))
197
+
198
+ ## [3.24.0-7](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-6...v3.24.0-7) (2021-04-15)
199
+
200
+
201
+ ### Features
202
+
203
+ * adjust match scores schema ([e34e1d3](https://github.com/SportsBroker-HQ/firebase-structure/commit/e34e1d313256cd330105f436e90caeaebb5293c9))
204
+
205
+ ## [3.24.0-6](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-5...v3.24.0-6) (2021-04-15)
206
+
207
+
208
+ ### Features
209
+
210
+ * adjust match scores schema ([c18bbe3](https://github.com/SportsBroker-HQ/firebase-structure/commit/c18bbe3ea23151a7567d226da57ca3914a35be9a))
211
+
212
+ ## [3.24.0-5](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-3...v3.24.0-5) (2021-04-14)
213
+
214
+
215
+ ### Features
216
+
217
+ * adjust head2head structure ([39ee387](https://github.com/SportsBroker-HQ/firebase-structure/commit/39ee38764e4ff0aee5224207bfb83933ebae11b8))
218
+
219
+ ## [3.24.0-4](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-3...v3.24.0-4) (2021-04-14)
220
+
221
+
222
+ ### Features
223
+
224
+ * adjust head2head structure ([39ee387](https://github.com/SportsBroker-HQ/firebase-structure/commit/39ee38764e4ff0aee5224207bfb83933ebae11b8))
225
+
5
226
  ## [3.24.0-3](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-2...v3.24.0-3) (2021-04-14)
6
227
 
7
228
 
@@ -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,9 +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
- home: HeadToHeadTeamStats;
8
- away: HeadToHeadTeamStats;
11
+ teamsData: TeamsHeadToHeadStats;
12
+ draws: number;
13
+ }
14
+
15
+ // h2hId - "<teamAId>_<teamBId>" or "<teamBId>_<teamAId>"
16
+
17
+ export interface HeadToHead {
18
+ [sportId: string]: {
19
+ [h2hId: string]: HeadToHeadStats,
20
+ }
9
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 {
@@ -1,19 +1,19 @@
1
1
  export interface Score {
2
- home: number;
3
- away: number;
2
+ home: number | null;
3
+ away: number | null;
4
4
  }
5
5
 
6
- export interface MatchPeriods{
7
- 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;
8
14
  secondHalf?: Score;
9
15
  firstOvertime?: Score;
10
16
  secondOvertime?: Score;
11
- }
12
-
13
- export interface MatchScore {
14
- home: number;
15
- away: number;
16
- periods: MatchPeriods;
17
17
  shootoutPenalties?: Score;
18
18
  }
19
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 {
@@ -10,8 +10,8 @@ export interface MatchTeam {
10
10
  export interface Teams {
11
11
  [sportID: string]: {
12
12
  [matchID: string]: {
13
- home: MatchTeam;
14
- away: MatchTeam;
13
+ home?: MatchTeam;
14
+ away?: MatchTeam;
15
15
  };
16
16
  };
17
17
  }
@@ -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,6 +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';
5
+ export type SeasonType = 'DOMESTIC' | 'INTERNATIONAL';
6
+ export type TournamentStage = 'group' | 'knockout';
7
+
4
8
 
5
9
  export interface SeasonOverview {
6
10
  endDate: ISODate;
@@ -11,6 +15,10 @@ export interface SeasonOverview {
11
15
  nextSeasonId?: string;
12
16
  state: SeasonState;
13
17
  logo?: Image;
18
+ type: SeasonType;
19
+ countryCode?: string;
20
+ stages?: Stages;
21
+ stage?: TournamentStage;
14
22
  }
15
23
 
16
24
  /**
@@ -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
+ }
@@ -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;
@@ -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
@@ -66,3 +76,11 @@ export interface WithSeasons {
66
76
  }
67
77
 
68
78
  export type Platforms = 'IOS' | 'WEB' | 'ANDROID';
79
+
80
+ export interface Stage {
81
+ id: string;
82
+ }
83
+
84
+ export interface Group {
85
+ id: string;
86
+ }
@@ -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,4 +1,15 @@
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;
@@ -9,7 +20,10 @@ export interface Team {
9
20
 
10
21
  export interface Opponent {
11
22
  score: number;
23
+ name: string;
12
24
  teamId: string;
25
+ abbreviation: string;
26
+ logo?: Image;
13
27
  }
14
28
 
15
29
  export interface PreviousMatch {
@@ -42,11 +56,11 @@ export interface EventStatus {
42
56
 
43
57
  export interface MatchOverviewSnapshot {
44
58
  id: string;
45
- teams: {
46
- home: Team;
47
- away: Team;
59
+ teams?: {
60
+ home?: Team;
61
+ away?: Team;
48
62
  };
49
- score: {
63
+ score?: {
50
64
  home: number;
51
65
  away: number;
52
66
  };
@@ -54,6 +68,13 @@ export interface MatchOverviewSnapshot {
54
68
  home: Share;
55
69
  away: Share;
56
70
  };
71
+ temporaryTeams?: {
72
+ home?: string;
73
+ away?: string;
74
+ };
75
+ tournamentType: 'DOMESTIC' | 'INTERNATIONAL';
76
+ stage?: Stage;
77
+ group?: Group;
57
78
  startDate: ISODate;
58
79
  roundNb: number;
59
80
  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-3",
3
+ "version": "3.24.0-31",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {
@@ -1,13 +0,0 @@
1
- types:
2
- - build
3
- - chore
4
- - ci
5
- - docs
6
- - feat
7
- - fix
8
- - improvement
9
- - perf
10
- - refactor
11
- - revert
12
- - style
13
- - test
@@ -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
- }