@sportsbroker/firebase-structure 9.6.0 → 9.8.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.
@@ -3,7 +3,7 @@ export type { PredictionPowerCardPlay, PredictionPowerCardTarget, PredictionPowe
3
3
  import type { PredictionFamilyEngine } from "../../bet-events";
4
4
  import type { Bet, PendingPrediction, SettledPrediction } from "../../bets/bets.model";
5
5
  import type { UUID } from "../../common";
6
- import type { EventBase, EventQuestion, EventResultsData } from "../../events/events.model";
6
+ import type { EventBase, EventQuestion, EventResultsData, QuestionResultValue } from "../../events/events.model";
7
7
  import type { Pool } from "../../pools/pools.model";
8
8
 
9
9
  /**
@@ -28,6 +28,8 @@ export type Event = EventBase & {
28
28
  resultsData: EventResultsData;
29
29
  /** Omitted on pre-card and card-free event documents. */
30
30
  powerCards?: PredictionPowerCards;
31
+ /** Tiebreaker questions in tiebreak order. Omitted on events without tiebreakers. */
32
+ tiebreakers?: EventQuestion[];
31
33
  };
32
34
 
33
35
  export type PredictionEvent = Event;
@@ -53,4 +55,6 @@ export type PredictionBet = Bet & {
53
55
  predictions: PredictionAnswer[];
54
56
  /** Owner-only, never part of the public event offer. */
55
57
  entryData?: PredictionPowerCardEntryData;
58
+ /** The player's tiebreaker answers, in tiebreak order. `distance` appears when the bet is settled. */
59
+ tiebreakers?: { eventQuestionId: UUID; predictionValue: QuestionResultValue; distance?: number }[];
56
60
  };
@@ -100,8 +100,18 @@ 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;
114
+ /** Distances to each tiebreaker result, in order. Written only for a settled pool. */
115
+ tiebreak?: number[];
106
116
  }[];
107
117
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "9.6.0",
3
+ "version": "9.8.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {