@sportsbroker/firebase-structure 3.50.0 → 3.52.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.
@@ -4,24 +4,22 @@ export type MatchDoc = MatchData & Doc;
4
4
 
5
5
  export type MatchData = {
6
6
  matchId: UUID;
7
- sport: SportEnum;
7
+ sport: Sport;
8
+ startDate: ISODate;
8
9
  teams?: MatchSides<MatchTeam>;
9
- score?: MatchScores;
10
+ roundNb: number;
11
+ season: string;
12
+ eventStatus: EventStatus;
10
13
  tournamentType: TournamentType;
11
14
  stage?: MatchStage;
12
15
  group?: MatchGroup;
16
+ score?: MatchScores;
13
17
  previousMatches?: MatchSides<PreviousMatch[]>;
14
- startDate: ISODate;
15
- roundNb: number;
16
- eventStatus: EventStatus;
17
- season: string;
18
18
  };
19
19
 
20
20
  export type MatchResult = "WON" | "DRAW" | "LOST";
21
21
 
22
- export enum SportEnum {
23
- SOCCER = "soccer",
24
- }
22
+ export type Sport = "soccer";
25
23
 
26
24
  export type TournamentType =
27
25
  | "DOMESTIC_LEAGUE"
@@ -40,14 +38,10 @@ export type MatchScores = {
40
38
  };
41
39
  };
42
40
 
43
- export enum MatchTeamSideEnum {
44
- HOME = "home",
45
- AWAY = "away",
46
- NONE = "none",
47
- }
41
+ export type MatchTeamSide = "home" | "away" | "none";
48
42
 
49
43
  export type PreviousMatch = {
50
- playedAs: MatchTeamSideEnum;
44
+ playedAs: MatchTeamSide;
51
45
  result: MatchResult;
52
46
  score: number;
53
47
  opponent: Opponent;
@@ -55,18 +49,18 @@ export type PreviousMatch = {
55
49
  };
56
50
 
57
51
  export interface MatchSides<T> {
58
- [MatchTeamSideEnum.HOME]?: T;
59
- [MatchTeamSideEnum.AWAY]?: T;
52
+ home?: T;
53
+ away?: T;
60
54
  }
61
55
 
62
56
  export type MatchStage = {
63
57
  stageId: UUID;
64
- name: string;
58
+ name?: string;
65
59
  };
66
60
 
67
61
  export type MatchGroup = {
68
62
  groupId: UUID;
69
- name: string;
63
+ name?: string;
70
64
  };
71
65
 
72
66
  export type MatchTeams = {
@@ -83,27 +77,21 @@ export type MatchTeam = {
83
77
  };
84
78
 
85
79
  export type EventStatus = {
86
- matchStatus: MatchStatusEnum;
87
- period: MatchPeriodEnum;
80
+ matchStatus: MatchStatus;
81
+ period: MatchPeriod;
88
82
  isActive: boolean;
89
83
  matchTime: MatchTime;
90
84
  };
91
85
 
92
- export enum MatchPeriodEnum {
93
- PRE_MATCH = "PRE_MATCH",
94
- FIRST_HALF = "FIRST_HALF",
95
- SECOND_HALF = "SECOND_HALF",
96
- FIRST_OVERTIME_HALF = "FIRST_OVERTIME_HALF",
97
- SECOND_OVERTIME_HALF = "SECOND_OVERTIME_HALF",
98
- SHOOTOUT = "SHOOTOUT",
99
- }
86
+ export type MatchPeriod =
87
+ | "PRE_MATCH"
88
+ | "FIRST_HALF"
89
+ | "SECOND_HALF"
90
+ | "FIRST_OVERTIME_HALF"
91
+ | "SECOND_OVERTIME_HALF"
92
+ | "SHOOTOUT";
100
93
 
101
- export enum MatchStatusEnum {
102
- PENDING = "PENDING",
103
- STARTED = "STARTED",
104
- FINISHED = "FINISHED",
105
- POSTPONED = "POSTPONED",
106
- }
94
+ export type MatchStatus = "PENDING" | "STARTED" | "FINISHED" | "POSTPONED";
107
95
 
108
96
  export type MatchTime = {
109
97
  minutes: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.50.0",
3
+ "version": "3.52.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {