@sportsbroker/firebase-structure 5.0.1 → 5.2.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.
- package/firestore/b2b-bet-events/b2b-bet-events.model.ts +6 -5
- package/firestore/b2b-bets/b2b-bets.model.ts +3 -3
- package/firestore/b2b-events/b2b-events.model.ts +2 -2
- package/firestore/b2b-pools/b2b-pools.model.ts +24 -20
- package/firestore/match-predictor/match-predictor.d.ts +2 -2
- package/firestore/score-predictor/score-predictor.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B2BPool } from "../b2b-pools";
|
|
2
2
|
import type { ISODate, UUID } from "../common";
|
|
3
3
|
import type { MPQuestion } from "../match-predictor";
|
|
4
4
|
|
|
@@ -7,19 +7,20 @@ export type B2BBetEvent = {
|
|
|
7
7
|
startDate: ISODate;
|
|
8
8
|
status: B2BBetEventStatusType;
|
|
9
9
|
bettingStatus: B2BBetEventBettingStatusType;
|
|
10
|
-
|
|
10
|
+
engine: GameEngineEnum;
|
|
11
11
|
gameSpecificData: B2BMPEventGameSpecificData;
|
|
12
12
|
resultsData: ResultsData;
|
|
13
|
-
poolData:
|
|
13
|
+
poolData: B2BPool;
|
|
14
14
|
createdAt: ISODate;
|
|
15
15
|
updatedAt: ISODate;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export type ResultsData = B2BMPEventResultsData;
|
|
19
19
|
|
|
20
|
-
export enum
|
|
20
|
+
export enum GameEngineEnum {
|
|
21
21
|
MATCH_PREDICTOR = "match-predictor",
|
|
22
22
|
SCORE_PREDICTOR = "score-predictor",
|
|
23
|
+
EDGE = "edge"
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export type B2BBetEventBettingStatusType = "locked" | "unlocked" | "settled";
|
|
@@ -31,7 +32,7 @@ export type B2BBetEventStatusType =
|
|
|
31
32
|
| "waiting-for-results-approval" // match is finished and we wait for CSA to approve match results
|
|
32
33
|
| "results-approved" // results are approved and event is ready to be settled
|
|
33
34
|
| "finished" // event is finished and settled
|
|
34
|
-
| "
|
|
35
|
+
| "cancelled"; // event is cancelled
|
|
35
36
|
|
|
36
37
|
////////////////////////////////////// MATCH PREDICTOR SPECIFIC TYPES //////////////////////////////////////
|
|
37
38
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GameEngineEnum } from "../b2b-bet-events";
|
|
2
2
|
import type { QuestionResultValue } from "../b2b-events";
|
|
3
3
|
import type { ISODate, UUID } from "../common";
|
|
4
4
|
|
|
5
5
|
export type B2BBet = {
|
|
6
6
|
id: string;
|
|
7
7
|
userId: UUID;
|
|
8
|
-
|
|
8
|
+
engine: GameEngineEnum;
|
|
9
9
|
questionSetId: UUID;
|
|
10
10
|
status: BetStatusEnum;
|
|
11
11
|
betEventId: UUID;
|
|
@@ -19,7 +19,7 @@ export enum BetStatusEnum {
|
|
|
19
19
|
PENDING = "pending",
|
|
20
20
|
WON = "won",
|
|
21
21
|
LOST = "lost",
|
|
22
|
-
|
|
22
|
+
CANCELLED = "cancelled",
|
|
23
23
|
LOCKED = "locked",
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
B2BBetEventBettingStatusType,
|
|
3
3
|
B2BBetEventStatusType,
|
|
4
|
-
|
|
4
|
+
GameEngineEnum,
|
|
5
5
|
} from "../b2b-bet-events";
|
|
6
6
|
import type { ISODate, UUID } from "../common";
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@ export type B2BEvent = {
|
|
|
10
10
|
startDate: ISODate;
|
|
11
11
|
status: B2BBetEventStatusType;
|
|
12
12
|
bettingStatus: B2BBetEventBettingStatusType;
|
|
13
|
-
|
|
13
|
+
engine: GameEngineEnum;
|
|
14
14
|
questionSetId: UUID;
|
|
15
15
|
name: string;
|
|
16
16
|
questions: EventQuestion[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B2BBetEventStatusType,
|
|
1
|
+
import { B2BBetEventStatusType, GameEngineEnum } from "../b2b-bet-events";
|
|
2
2
|
import type { ISODate, UUID } from "../common";
|
|
3
3
|
|
|
4
4
|
export type PoolPayoutStructure = { [position: string]: number };
|
|
@@ -9,7 +9,27 @@ export enum PrizeDistributionStrategyEnum {
|
|
|
9
9
|
TOP_5 = "top-5",
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export type
|
|
12
|
+
export type B2BPoolEvent = {
|
|
13
|
+
questionSetId: UUID;
|
|
14
|
+
status: B2BBetEventStatusType;
|
|
15
|
+
engine: GameEngineEnum;
|
|
16
|
+
startDate?: ISODate;
|
|
17
|
+
matchIds?: UUID[];
|
|
18
|
+
leagueCodes?: string[];
|
|
19
|
+
countryCodes?: string[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type B2BPoolLeaderboard = {
|
|
23
|
+
entries: {
|
|
24
|
+
userId: UUID;
|
|
25
|
+
displayName: string;
|
|
26
|
+
position: number;
|
|
27
|
+
score: number;
|
|
28
|
+
prize: number | null;
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type B2BPool = {
|
|
13
33
|
id: UUID;
|
|
14
34
|
betEventId: UUID;
|
|
15
35
|
operatorId: UUID;
|
|
@@ -18,24 +38,8 @@ export type B2BBetEventPoolData = {
|
|
|
18
38
|
participants: number; // active bets count
|
|
19
39
|
entryFee: number;
|
|
20
40
|
currency: string;
|
|
21
|
-
event:
|
|
22
|
-
|
|
23
|
-
status: B2BBetEventStatusType;
|
|
24
|
-
gameKey: GameKeyEnum;
|
|
25
|
-
startDate?: ISODate;
|
|
26
|
-
matchIds?: UUID[];
|
|
27
|
-
leagueCodes?: string[];
|
|
28
|
-
countryCodes?: string[];
|
|
29
|
-
};
|
|
30
|
-
leaderboard: {
|
|
31
|
-
entries: {
|
|
32
|
-
userId: UUID;
|
|
33
|
-
displayName: string;
|
|
34
|
-
position: number;
|
|
35
|
-
score: number;
|
|
36
|
-
prize: number | null;
|
|
37
|
-
}[];
|
|
38
|
-
};
|
|
41
|
+
event: B2BPoolEvent;
|
|
42
|
+
leaderboard: B2BPoolLeaderboard;
|
|
39
43
|
payoutStructure: PoolPayoutStructure;
|
|
40
44
|
prizeDistributionStrategy: PrizeDistributionStrategyEnum;
|
|
41
45
|
createdAt: ISODate;
|
|
@@ -19,7 +19,7 @@ export type MPEventMatchStatusType =
|
|
|
19
19
|
| "pre-event"
|
|
20
20
|
| "live"
|
|
21
21
|
| "finished"
|
|
22
|
-
| "
|
|
22
|
+
| "cancelled";
|
|
23
23
|
|
|
24
24
|
export type MPMatchData = {
|
|
25
25
|
matchId: UUID;
|
|
@@ -42,7 +42,7 @@ export type MPEventStatusType =
|
|
|
42
42
|
| "waiting-for-results-approval"
|
|
43
43
|
| "results-approved"
|
|
44
44
|
| "finished"
|
|
45
|
-
| "
|
|
45
|
+
| "cancelled";
|
|
46
46
|
|
|
47
47
|
export type MPEventPool = {
|
|
48
48
|
id: UUID;
|
|
@@ -19,7 +19,7 @@ export type SPEventMatchStatusType =
|
|
|
19
19
|
| "pre-event"
|
|
20
20
|
| "live"
|
|
21
21
|
| "finished"
|
|
22
|
-
| "
|
|
22
|
+
| "cancelled";
|
|
23
23
|
|
|
24
24
|
export type SPMatchesData = {
|
|
25
25
|
[matchId: string]: {
|
|
@@ -68,7 +68,7 @@ export type SPEventStatusType =
|
|
|
68
68
|
| "waiting-for-results-approval"
|
|
69
69
|
| "results-approved"
|
|
70
70
|
| "finished"
|
|
71
|
-
| "
|
|
71
|
+
| "cancelled";
|
|
72
72
|
|
|
73
73
|
export type SPEventPool = {
|
|
74
74
|
id: UUID;
|