@sportsbroker/firebase-structure 9.4.0 → 9.5.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.
|
@@ -6,11 +6,30 @@ export type Fixture = {
|
|
|
6
6
|
homeTeam: MatchTeam;
|
|
7
7
|
awayTeam: MatchTeam;
|
|
8
8
|
status: FixtureStatus;
|
|
9
|
+
/** The match clock every game counts on from. Absent before the first reading of the match. */
|
|
10
|
+
clock?: FixtureClock;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The match time, the same for every game and operator of the match. A reader computes the time now as
|
|
15
|
+
* `seconds + (now - readAt) × pace` while `running`, and `seconds` while it is not. It moves only when a
|
|
16
|
+
* reading disagrees with that prediction, when the clock stops or starts, or with the shown minute.
|
|
17
|
+
*/
|
|
18
|
+
export type FixtureClock = {
|
|
19
|
+
/** Match time played at `readAt`, in seconds, as the sport counts it; null for a sport without a match clock. */
|
|
20
|
+
seconds: number | null;
|
|
21
|
+
/** When the source read the clock (ISO 8601). */
|
|
22
|
+
readAt: ISODate;
|
|
23
|
+
/** False before kick-off, at breaks between periods, while suspended and after full time. */
|
|
24
|
+
running: boolean;
|
|
25
|
+
/** Match seconds per wall-clock second: 1 for a real match, the playback speed of a showcase. */
|
|
26
|
+
pace: number;
|
|
9
27
|
};
|
|
10
28
|
|
|
11
29
|
export type MatchTeam = {
|
|
12
30
|
id: UUID;
|
|
13
31
|
name: string;
|
|
32
|
+
/** Shared team shirt URL. Display: pool override -> fixture logo -> built-in shirt. */
|
|
14
33
|
logo: string | null;
|
|
15
34
|
score: number;
|
|
16
35
|
};
|
|
@@ -43,32 +43,10 @@ export type Pool = {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* so this covers all of them at once. The ids are the same ones the `Fixtures` documents named
|
|
51
|
-
* under `matchIds`, so a client joins what it already read.
|
|
52
|
-
*
|
|
53
|
-
* It lives on the POOL and not on the fixture because a shirt is one operator's choice: a fixture
|
|
54
|
-
* document is shared by every operator running that match, and could not carry a per-operator
|
|
55
|
-
* answer. The pool is the only document that knows whose it is.
|
|
56
|
-
*
|
|
57
|
-
* A LIST and not a map, which is a storage fact rather than a taste. Pool documents are written
|
|
58
|
-
* with a merge, and a merge DEEP-merges a nested map: a shirt that was removed, repointed at
|
|
59
|
-
* another team, or keyed to a team that has since left a hand-entered fixture would stay in that
|
|
60
|
-
* map for ever, because a write that stops naming a key does not remove it. A list is replaced
|
|
61
|
-
* whole, so what was written last is what a player sees. A client that wants lookup by id builds
|
|
62
|
-
* its own map once.
|
|
63
|
-
*
|
|
64
|
-
* Optional to READ, always written. A team with no shirt has no entry, and a pool whose teams have
|
|
65
|
-
* none carries an EMPTY list rather than no field: a write that simply stopped sending the field
|
|
66
|
-
* would leave the previous list in place, for the same merge reason as above. So presence means
|
|
67
|
-
* nothing and length means everything - a client checks whether the list has an entry for the team
|
|
68
|
-
* it is drawing, and draws what it drew before when it has not. It stays optional on the type
|
|
69
|
-
* because documents written before this field existed have none.
|
|
70
|
-
|
|
71
|
-
* Nothing here is a promise that a team has a shirt.
|
|
46
|
+
* Explicit team overrides of this pool's operator, ordered by team id.
|
|
47
|
+
* Display: pool override -> Fixtures side logo -> built-in shirt.
|
|
48
|
+
* Shared kits are never copied here. An empty list clears removed overrides
|
|
49
|
+
* because Firestore merge replaces arrays rather than merging their entries.
|
|
72
50
|
*/
|
|
73
51
|
export type PoolTeamKits = PoolTeamKit[];
|
|
74
52
|
|