@sportsbroker/firebase-structure 9.7.0 → 9.9.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.
@@ -8,6 +8,30 @@ export type Fixture = {
8
8
  status: FixtureStatus;
9
9
  /** The match clock every game counts on from. Absent before the first reading of the match. */
10
10
  clock?: FixtureClock;
11
+ /** The score of each stage the match reached. Absent before kick-off and on documents projected before it existed. */
12
+ stageScores?: FixtureStageScores;
13
+ };
14
+
15
+ /**
16
+ * One key per stage the match reached: a stage appears when it starts, and its score follows the match until the
17
+ * stage ends. A stage the match did not reach is absent: no extra time means no `extraTime`, no shootout means no
18
+ * `penalties`. A match can go from `fullTime` straight to `penalties`.
19
+ */
20
+ export type FixtureStageScores = {
21
+ /**
22
+ * Regulation time: the two halves with their stoppage time. The games count this score; it is final once
23
+ * `status.fullTimeFinished` is true.
24
+ */
25
+ fullTime?: FixtureScore;
26
+ /** Extra time, counted from kick-off: the goals of regulation time are included. */
27
+ extraTime?: FixtureScore;
28
+ /** The penalty shootout alone. */
29
+ penalties?: FixtureScore;
30
+ };
31
+
32
+ export type FixtureScore = {
33
+ home: number;
34
+ away: number;
11
35
  };
12
36
 
13
37
  /**
@@ -31,6 +55,7 @@ export type MatchTeam = {
31
55
  name: string;
32
56
  /** Shared team shirt URL. Display: pool override -> fixture logo -> built-in shirt. */
33
57
  logo: string | null;
58
+ /** Goals in the whole match, extra time included. The penalty shootout is not counted. */
34
59
  score: number;
35
60
  };
36
61
 
@@ -41,6 +66,7 @@ export type FixtureStatus = {
41
66
  periodId: number;
42
67
  minutes: number;
43
68
  additionalMinutes: number;
69
+ /** True from the end of regulation time (the second half with its stoppage time). The games end here. */
44
70
  fullTimeFinished: boolean;
45
71
  };
46
72
 
@@ -100,7 +100,15 @@ export type PoolLeaderboard = {
100
100
  entries: {
101
101
  userId: UUID;
102
102
  displayName: string;
103
+ /** Dense ranking position: tied entries share it and the next group gets the next number. Prizes key on it. */
103
104
  position: number;
105
+ /**
106
+ * The place to show: 1 + the entries of the whole leaderboard with a lower position (`1, 1, 1, 4, 5`).
107
+ * Absent on a document projected before it existed; show `position` then.
108
+ */
109
+ displayPosition?: number;
110
+ /** The other entries of the whole leaderboard on the same position. Absent like `displayPosition`. */
111
+ sharedWith?: number;
104
112
  score: number;
105
113
  prize: number | null;
106
114
  /** Distances to each tiebreaker result, in order. Written only for a settled pool. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "9.7.0",
3
+ "version": "9.9.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {