@sportsbroker/firebase-structure 3.46.0 → 3.48.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/firestore/common.d.ts +8 -2
- package/firestore/index.d.ts +1 -0
- package/firestore/match.d.ts +162 -0
- package/firestore/user-status.d.ts +1 -2
- package/models/global.d.ts +6 -4
- package/package.json +1 -1
package/firestore/common.d.ts
CHANGED
package/firestore/index.d.ts
CHANGED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { ISODate, UUID, Image, Doc } from "./common";
|
|
2
|
+
|
|
3
|
+
export type MatchDoc = MatchData & Doc;
|
|
4
|
+
|
|
5
|
+
export type MatchData = {
|
|
6
|
+
matchId: UUID;
|
|
7
|
+
sport: SportEnum;
|
|
8
|
+
teams?: MatchSides<MatchTeam>;
|
|
9
|
+
score?: MatchScores;
|
|
10
|
+
tournamentType: TournamentType;
|
|
11
|
+
stage?: MatchStage;
|
|
12
|
+
group?: MatchGroup;
|
|
13
|
+
previousMatches?: MatchSides<PreviousMatch[]>;
|
|
14
|
+
startDate: ISODate;
|
|
15
|
+
roundNb: number;
|
|
16
|
+
eventStatus: EventStatus;
|
|
17
|
+
season: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type MatchResult = "WON" | "DRAW" | "LOST";
|
|
21
|
+
|
|
22
|
+
export enum SportEnum {
|
|
23
|
+
SOCCER = "soccer",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type TournamentType =
|
|
27
|
+
| "DOMESTIC_LEAGUE"
|
|
28
|
+
| "DOMESTIC_CUP"
|
|
29
|
+
| "INTERNATIONAL_CUP";
|
|
30
|
+
|
|
31
|
+
export type MatchScores = {
|
|
32
|
+
home: number | null;
|
|
33
|
+
away: number | null;
|
|
34
|
+
periods: {
|
|
35
|
+
firstHalf: MatchSides<number | null>;
|
|
36
|
+
secondHalf: MatchSides<number | null>;
|
|
37
|
+
firstOvertime: MatchSides<number | null>;
|
|
38
|
+
secondOvertime: MatchSides<number | null>;
|
|
39
|
+
shootoutPenalties: MatchSides<number | null>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export enum MatchTeamSideEnum {
|
|
44
|
+
HOME = "home",
|
|
45
|
+
AWAY = "away",
|
|
46
|
+
NONE = "none",
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type PreviousMatch = {
|
|
50
|
+
playedAs: MatchTeamSideEnum;
|
|
51
|
+
result: MatchResult;
|
|
52
|
+
score: number;
|
|
53
|
+
opponent: Opponent;
|
|
54
|
+
startDate: ISODate;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export interface MatchSides<T> {
|
|
58
|
+
[MatchTeamSideEnum.HOME]?: T;
|
|
59
|
+
[MatchTeamSideEnum.AWAY]?: T;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type MatchStage = {
|
|
63
|
+
stageId: UUID;
|
|
64
|
+
name: string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type MatchGroup = {
|
|
68
|
+
groupId: UUID;
|
|
69
|
+
name: string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type MatchTeams = {
|
|
73
|
+
home?: MatchTeam;
|
|
74
|
+
away?: MatchTeam;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export type MatchTeam = {
|
|
78
|
+
id: UUID;
|
|
79
|
+
name: string;
|
|
80
|
+
shortName: string;
|
|
81
|
+
abbreviation: string;
|
|
82
|
+
logo?: Image;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type Share = {
|
|
86
|
+
price: number;
|
|
87
|
+
openingPrice: number;
|
|
88
|
+
priceChangePercentage: number;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export type EventStatus = {
|
|
92
|
+
matchStatus: MatchStatusEnum;
|
|
93
|
+
period: MatchPeriodEnum;
|
|
94
|
+
isActive: boolean;
|
|
95
|
+
matchTime: MatchTime;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export enum MatchPeriodEnum {
|
|
99
|
+
PRE_MATCH = "PRE_MATCH",
|
|
100
|
+
FIRST_HALF = "FIRST_HALF",
|
|
101
|
+
SECOND_HALF = "SECOND_HALF",
|
|
102
|
+
FIRST_OVERTIME_HALF = "FIRST_OVERTIME_HALF",
|
|
103
|
+
SECOND_OVERTIME_HALF = "SECOND_OVERTIME_HALF",
|
|
104
|
+
SHOOTOUT = "SHOOTOUT",
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export enum MatchStatusEnum {
|
|
108
|
+
PENDING = "PENDING",
|
|
109
|
+
STARTED = "STARTED",
|
|
110
|
+
FINISHED = "FINISHED",
|
|
111
|
+
POSTPONED = "POSTPONED",
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type MatchTime = {
|
|
115
|
+
minutes: number;
|
|
116
|
+
additionalMinutes: number;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export type Opponent = {
|
|
120
|
+
score: number;
|
|
121
|
+
name: string;
|
|
122
|
+
teamId: string;
|
|
123
|
+
abbreviation: string;
|
|
124
|
+
logo?: Image;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type MatchPair = {
|
|
128
|
+
home?: Team;
|
|
129
|
+
away?: Team;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export type Team = {
|
|
133
|
+
_id: string;
|
|
134
|
+
teamId: string;
|
|
135
|
+
name: string;
|
|
136
|
+
displayName: string;
|
|
137
|
+
shortName: string;
|
|
138
|
+
officialName: string;
|
|
139
|
+
code: string;
|
|
140
|
+
type: TeamType;
|
|
141
|
+
countryId: string;
|
|
142
|
+
status: TeamStatus;
|
|
143
|
+
city: string | null;
|
|
144
|
+
createdAt: Date;
|
|
145
|
+
updatedAt: Date;
|
|
146
|
+
tournaments: string[];
|
|
147
|
+
logo: {
|
|
148
|
+
default: string;
|
|
149
|
+
};
|
|
150
|
+
isCurrentlyPlaying: boolean;
|
|
151
|
+
currentlyPlayedMatch: string | null;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export enum TeamType {
|
|
155
|
+
NATIONAL = "national",
|
|
156
|
+
CLUB = "club",
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export enum TeamStatus {
|
|
160
|
+
ACTIVE = "active",
|
|
161
|
+
DEFUNCT = "defunct",
|
|
162
|
+
}
|
package/models/global.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export type NumericID = number;
|
|
|
8
8
|
*/
|
|
9
9
|
export type MongoID = string;
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
export type UUID = string;
|
|
13
12
|
|
|
14
13
|
export type UserID = MongoID;
|
|
@@ -42,7 +41,7 @@ export type GroupID = string;
|
|
|
42
41
|
*/
|
|
43
42
|
export type PlayerID = string;
|
|
44
43
|
|
|
45
|
-
export type Percentage = number // 0.0-1.0
|
|
44
|
+
export type Percentage = number; // 0.0-1.0
|
|
46
45
|
|
|
47
46
|
export interface Image {
|
|
48
47
|
default: string;
|
|
@@ -69,7 +68,10 @@ export interface MatchSide<T> {
|
|
|
69
68
|
*/
|
|
70
69
|
export type MatchStatus = "PENDING" | "STARTED" | "FINISHED" | "POSTPONED";
|
|
71
70
|
|
|
72
|
-
export type TournamentType =
|
|
71
|
+
export type TournamentType =
|
|
72
|
+
| "DOMESTIC_LEAGUE"
|
|
73
|
+
| "DOMESTIC_CUP"
|
|
74
|
+
| "INTERNATIONAL_CUP";
|
|
73
75
|
|
|
74
76
|
export interface WithSeasons {
|
|
75
77
|
seasons: {
|
|
@@ -79,7 +81,7 @@ export interface WithSeasons {
|
|
|
79
81
|
|
|
80
82
|
export type MarketingOffers = "REGISTER2021";
|
|
81
83
|
|
|
82
|
-
export type Platforms =
|
|
84
|
+
export type Platforms = "IOS" | "WEB" | "ANDROID";
|
|
83
85
|
|
|
84
86
|
export interface Stage {
|
|
85
87
|
id: string;
|