@sportsbroker/firebase-structure 6.3.0 → 7.0.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.
@@ -11,8 +11,6 @@ export type BetEvent = {
11
11
  gameSpecificData: EventGameSpecificData;
12
12
  resultsData: ResultsData;
13
13
  poolData: Pool;
14
- createdAt: ISODate;
15
- updatedAt: ISODate;
16
14
  };
17
15
 
18
16
  export type ResultsData = EventResultsData;
@@ -18,8 +18,11 @@ export type Bet = {
18
18
  * before this field existed omit it and MUST be treated as `"real"`. New projections always set it.
19
19
  */
20
20
  track?: PoolTrack;
21
- createdAt: ISODate;
22
- updatedAt: ISODate;
21
+ /**
22
+ * When the user placed this bet. Replaces the removed `createdAt`/`updatedAt` pair:
23
+ * bets are immutable once placed, so a single placement timestamp is enough.
24
+ */
25
+ betPlaceDate: ISODate;
23
26
  };
24
27
 
25
28
  export enum BetStatusEnum {
@@ -36,6 +39,12 @@ export type BetPredictionType = Prediction;
36
39
  export type Prediction = {
37
40
  eventQuestionId: UUID;
38
41
  predictionValue: QuestionResultValue;
42
+ /**
43
+ * Whether this answer was correct, set only once the bet is settled (won/lost).
44
+ * Absent = pending: no final result yet, or a document projected before this field
45
+ * existed. Consumers MUST treat absent as pending, never as "wrong".
46
+ */
47
+ correct?: boolean;
39
48
  };
40
49
 
41
50
  export enum MatchSideResultEnum {
@@ -1,7 +1,5 @@
1
1
  export type Doc = {
2
2
  docId: UUID;
3
- createdAt: ISODate;
4
- updatedAt: ISODate;
5
3
  };
6
4
 
7
5
  export type ISODate = string;
@@ -16,8 +16,6 @@ export type Event = {
16
16
  questions: EventQuestion[];
17
17
  resultsData: EventResultsData;
18
18
  resultsUpdateReason: string | null;
19
- createdAt: ISODate;
20
- updatedAt: ISODate;
21
19
  matchIds?: UUID[];
22
20
  };
23
21
 
@@ -6,8 +6,6 @@ export type Fixture = {
6
6
  homeTeam: MatchTeam;
7
7
  awayTeam: MatchTeam;
8
8
  status: FixtureStatus;
9
- createdAt: ISODate;
10
- updatedAt: ISODate;
11
9
  };
12
10
 
13
11
  export type MatchTeam = {
@@ -1,4 +1,4 @@
1
- import { Doc, ISODate, UUID } from "../common";
1
+ import { Doc, UUID } from "../common";
2
2
 
3
3
  export type LeaderboardDoc = Leaderboard & Doc;
4
4
 
@@ -7,8 +7,6 @@ export type Leaderboard = {
7
7
  betEventId: UUID;
8
8
  poolId: UUID;
9
9
  entries: LeaderboardEntry[];
10
- createdAt: ISODate;
11
- updatedAt: ISODate;
12
10
  };
13
11
 
14
12
  export type LeaderboardEntry = {
@@ -56,6 +56,4 @@ export type Pool = {
56
56
  * field existed omit it and MUST be treated as `"real"`. New projections always set it.
57
57
  */
58
58
  track?: PoolTrack;
59
- createdAt: ISODate;
60
- updatedAt: ISODate;
61
59
  };
@@ -1,4 +1,4 @@
1
- import type { ISODate, UUID } from "../common";
1
+ import type { UUID } from "../common";
2
2
  import type { InGameEventKey, QuestionTypeEnum } from "../events";
3
3
 
4
4
  export type QuestionSet = {
@@ -7,8 +7,6 @@ export type QuestionSet = {
7
7
  questions: QuestionTemplate[];
8
8
  rules: string;
9
9
  status: QuestionSetStatusEnum;
10
- createdAt: ISODate;
11
- updatedAt: ISODate;
12
10
  };
13
11
 
14
12
  export type QuestionTemplate = {
@@ -12,8 +12,6 @@ export interface SPEvent {
12
12
  pools: { [key: string]: SPEventPool };
13
13
  jackpot: Jackpot | null;
14
14
  miniJackpot?: boolean;
15
- createdAt: ISODate;
16
- updatedAt: ISODate;
17
15
  }
18
16
  export type SPEventMatchStatusType =
19
17
  | "pre-event"
@@ -1,5 +1,3 @@
1
- import { ISODate } from "../../global";
2
-
3
1
  export type NotificationID = string;
4
2
 
5
3
  export type OrderType = "MARKET" | "LIMIT";
@@ -102,8 +100,6 @@ export interface Notification<T extends NotificationType> {
102
100
  description?: string;
103
101
  variables?: VariablesMap[T];
104
102
  shown: boolean;
105
- createdAt: ISODate;
106
- updatedAt: ISODate;
107
103
  id: NotificationID;
108
104
  }
109
105
 
@@ -25,7 +25,6 @@ export interface Order {
25
25
  action: OrderActionType;
26
26
  allOrNothing: boolean;
27
27
  amount: number;
28
- createdAt: ISODate;
29
28
  executedAt?: ISODate;
30
29
  limit?: number;
31
30
  processedAmount: number;
@@ -35,7 +34,6 @@ export interface Order {
35
34
  teamId: TeamID;
36
35
  transactionFee: Percentage;
37
36
  type: OrderTransactionType;
38
- updatedAt: ISODate;
39
37
  status: OrderStatus;
40
38
  id: OrderID;
41
39
  totalPrice: number;
@@ -13,8 +13,6 @@ export type TransactionPaymentMethod = 'SKRILL' | 'SPORTSBROKER' | 'PAY360';
13
13
  export type TransactionStatus = "PREPARED" | "PENDING" | "SUCCEED" | "FAILED" | "CANCELLED" | "IN_REVIEW";
14
14
 
15
15
  export interface Transaction {
16
- createdAt: ISODate;
17
- updatedAt: ISODate;
18
16
  executedAt?: ISODate;
19
17
  id: TransactionID,
20
18
  status: TransactionStatus;
@@ -3,8 +3,6 @@ import { OrderStatus } from "../details/users/orders";
3
3
 
4
4
  interface OrderQueryData {
5
5
  status: OrderStatus;
6
- createdAt: ISODate;
7
- updatedAt: ISODate;
8
6
  executedAt?: ISODate;
9
7
  id: string;
10
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "6.3.0",
3
+ "version": "7.0.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {