@sportsbroker/firebase-structure 3.73.9 → 3.75.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.d.ts +1 -115
- package/firestore/b2b-bet-events/b2b-bet-events.model.ts +116 -0
- package/firestore/b2b-bet-events/index.ts +1 -1
- package/firestore/b2b-bets/b2b-bets.d.ts +1 -70
- package/firestore/b2b-bets/b2b-bets.model.ts +87 -0
- package/firestore/b2b-bets/index.ts +1 -1
- package/firestore/b2b-gf-events/b2b-gf-events.d.ts +1 -0
- package/firestore/b2b-gf-events/b2b-gf-events.model.ts +104 -0
- package/firestore/b2b-gf-events/index.ts +1 -0
- package/firestore/b2b-gf-game-templates/b2b-gf-game-templates.d.ts +1 -0
- package/firestore/b2b-gf-game-templates/b2b-gf-game-templates.model.ts +32 -0
- package/firestore/b2b-gf-game-templates/index.ts +1 -0
- package/firestore/b2b-matches/b2b-match.d.ts +1 -44
- package/firestore/b2b-matches/b2b-match.model.ts +44 -0
- package/firestore/b2b-matches/index.ts +1 -1
- package/package.json +1 -1
- package/.vscode/settings.json +0 -22
|
@@ -1,115 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { MPQuestion } from "../match-predictor";
|
|
3
|
-
|
|
4
|
-
export type B2BBetEvent = {
|
|
5
|
-
id: string;
|
|
6
|
-
organizationId: UUID;
|
|
7
|
-
startDate: ISODate;
|
|
8
|
-
status: B2BBetEventStatusType;
|
|
9
|
-
bettingStatus: B2BBetEventBettingStatusType;
|
|
10
|
-
gameKey: GameKeyEnum;
|
|
11
|
-
gameSpecificData: B2BMPEventGameSpecificData;
|
|
12
|
-
resultsData: ResultsData;
|
|
13
|
-
poolData: B2BBetEventPoolData;
|
|
14
|
-
createdAt: ISODate;
|
|
15
|
-
updatedAt: ISODate;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export type ResultsData = B2BMPEventResultsData;
|
|
19
|
-
|
|
20
|
-
export type B2BBetEventPoolData = {
|
|
21
|
-
id: UUID;
|
|
22
|
-
potAmount?: number; // deprecated
|
|
23
|
-
payoutAmount?: number; // this should be used
|
|
24
|
-
participants: number; // active bets count
|
|
25
|
-
entryFee: number;
|
|
26
|
-
leaderboard: {
|
|
27
|
-
entries: {
|
|
28
|
-
userId: UUID;
|
|
29
|
-
displayName: string;
|
|
30
|
-
position: number;
|
|
31
|
-
score: number;
|
|
32
|
-
prize: number | null;
|
|
33
|
-
}[];
|
|
34
|
-
};
|
|
35
|
-
payoutStructure: PoolPayoutStructure;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export type PoolPayoutStructure = { [position: string]: number };
|
|
39
|
-
|
|
40
|
-
export enum GameKeyEnum {
|
|
41
|
-
MATCH_PREDICTOR = "match-predictor",
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export type B2BBetEventBettingStatusType = "locked" | "unlocked" | "settled";
|
|
45
|
-
|
|
46
|
-
export type B2BBetEventStatusType =
|
|
47
|
-
| "pending" // before we start display event ald at this time betting is locked
|
|
48
|
-
| "open" // now we can place bets on event but match did not start yet
|
|
49
|
-
| "event-in-progress" // match already started betting is locked again
|
|
50
|
-
| "waiting-for-results-approval" // match is finished and we wait for CSA to approve match results
|
|
51
|
-
| "results-approved" // results are approved and event is ready to be settled
|
|
52
|
-
| "finished" // event is finished and settled
|
|
53
|
-
| "canceled"; // event is canceled
|
|
54
|
-
|
|
55
|
-
////////////////////////////////////// MATCH PREDICTOR SPECIFIC TYPES //////////////////////////////////////
|
|
56
|
-
|
|
57
|
-
export type B2BMPEventGameSpecificData = {
|
|
58
|
-
matchId: UUID;
|
|
59
|
-
questions: MPQuestion[];
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export type B2BMPEventResultsData = {
|
|
63
|
-
[mpQuestionKey: MPQuestionKeyType]: B2BMPEventResultData;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export type MPQuestionKeyType = `${MPQuestionKeyEnum}` | string;
|
|
67
|
-
|
|
68
|
-
export enum MPQuestionKeyEnum {
|
|
69
|
-
MATCH_SCORE = "match-score",
|
|
70
|
-
TOTAL_SHOTS_ON_TARGET = "total-shots-on-target",
|
|
71
|
-
TOTAL_CARDS = "total-cards",
|
|
72
|
-
// MATCH_RESULT = 'match-result',
|
|
73
|
-
RED_CARD_IS_GIVEN = "red-card-is-given",
|
|
74
|
-
PENALTY_AWARDED = "penalty-awarded",
|
|
75
|
-
// BOTH_TEAM_SCORE = 'both-team-score',
|
|
76
|
-
// GOAL_IN_BOTH_HALVES = 'goal-in-both-halves',
|
|
77
|
-
GOAL_IN_FIRST_15 = "goal-in-first-15",
|
|
78
|
-
MOST_TACKLES_WON = "most-tackles-won",
|
|
79
|
-
CORNERS_10_OR_MORE = "corners-10-or-more",
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export type B2BMPEventResultData = MPQuestion & {
|
|
83
|
-
result: {
|
|
84
|
-
isFinal: boolean;
|
|
85
|
-
value: MPQuestionResultTypeValueType[MPQuestionResultTypeEnum];
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export type MPQuestionResultTypeValueType = {
|
|
90
|
-
[MPQuestionResultTypeEnum.BOTH_SIDES_POSITIVE_INTEGER]: BothSidesPositiveInteger;
|
|
91
|
-
[MPQuestionResultTypeEnum.POSITIVE_INTEGER]: PositiveInteger;
|
|
92
|
-
[MPQuestionResultTypeEnum.MATCH_SIDE_RESULT]: MatchSideResultEnum;
|
|
93
|
-
[MPQuestionResultTypeEnum.YES_NO]: YesNoResultEnum;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export enum MatchSideResultEnum {
|
|
97
|
-
HOME = "home",
|
|
98
|
-
AWAY = "away",
|
|
99
|
-
DRAW = "draw",
|
|
100
|
-
}
|
|
101
|
-
export enum YesNoResultEnum {
|
|
102
|
-
YES = "yes",
|
|
103
|
-
NO = "no",
|
|
104
|
-
}
|
|
105
|
-
export type BothSidesPositiveInteger = { home: number; away: number };
|
|
106
|
-
export type PositiveInteger = number;
|
|
107
|
-
|
|
108
|
-
export enum MPQuestionResultTypeEnum {
|
|
109
|
-
BOTH_SIDES_POSITIVE_INTEGER = "both-sides-positive-integer",
|
|
110
|
-
POSITIVE_INTEGER = "positive-integer",
|
|
111
|
-
MATCH_SIDE_RESULT = "match-side-result",
|
|
112
|
-
YES_NO = "yes-no",
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
1
|
+
export * from "./b2b-bet-events.model";
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { ISODate, UUID } from "../common";
|
|
2
|
+
import type { MPQuestion } from "../match-predictor";
|
|
3
|
+
|
|
4
|
+
export type B2BBetEvent = {
|
|
5
|
+
id: string;
|
|
6
|
+
organizationId: UUID;
|
|
7
|
+
startDate: ISODate;
|
|
8
|
+
status: B2BBetEventStatusType;
|
|
9
|
+
bettingStatus: B2BBetEventBettingStatusType;
|
|
10
|
+
gameKey: GameKeyEnum;
|
|
11
|
+
gameSpecificData: B2BMPEventGameSpecificData;
|
|
12
|
+
resultsData: ResultsData;
|
|
13
|
+
poolData: B2BBetEventPoolData;
|
|
14
|
+
createdAt: ISODate;
|
|
15
|
+
updatedAt: ISODate;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type ResultsData = B2BMPEventResultsData;
|
|
19
|
+
|
|
20
|
+
export type B2BBetEventPoolData = {
|
|
21
|
+
id: UUID;
|
|
22
|
+
potAmount?: number; // deprecated
|
|
23
|
+
payoutAmount?: number; // this should be used
|
|
24
|
+
participants: number; // active bets count
|
|
25
|
+
entryFee: number;
|
|
26
|
+
leaderboard: {
|
|
27
|
+
entries: {
|
|
28
|
+
userId: UUID;
|
|
29
|
+
displayName: string;
|
|
30
|
+
position: number;
|
|
31
|
+
score: number;
|
|
32
|
+
prize: number | null;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
payoutStructure: PoolPayoutStructure;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type PoolPayoutStructure = { [position: string]: number };
|
|
39
|
+
|
|
40
|
+
export enum GameKeyEnum {
|
|
41
|
+
MATCH_PREDICTOR = "match-predictor",
|
|
42
|
+
GAME_FRAMEWORK = "game-framework",
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type B2BBetEventBettingStatusType = "locked" | "unlocked" | "settled";
|
|
46
|
+
|
|
47
|
+
export type B2BBetEventStatusType =
|
|
48
|
+
| "pending" // before we start display event ald at this time betting is locked
|
|
49
|
+
| "open" // now we can place bets on event but match did not start yet
|
|
50
|
+
| "event-in-progress" // match already started betting is locked again
|
|
51
|
+
| "waiting-for-results-approval" // match is finished and we wait for CSA to approve match results
|
|
52
|
+
| "results-approved" // results are approved and event is ready to be settled
|
|
53
|
+
| "finished" // event is finished and settled
|
|
54
|
+
| "canceled"; // event is canceled
|
|
55
|
+
|
|
56
|
+
////////////////////////////////////// MATCH PREDICTOR SPECIFIC TYPES //////////////////////////////////////
|
|
57
|
+
|
|
58
|
+
export type B2BMPEventGameSpecificData = {
|
|
59
|
+
matchId: UUID;
|
|
60
|
+
questions: MPQuestion[];
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type B2BMPEventResultsData = {
|
|
64
|
+
[mpQuestionKey: MPQuestionKeyType]: B2BMPEventResultData;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type MPQuestionKeyType = `${MPQuestionKeyEnum}` | string;
|
|
68
|
+
|
|
69
|
+
export enum MPQuestionKeyEnum {
|
|
70
|
+
MATCH_SCORE = "match-score",
|
|
71
|
+
TOTAL_SHOTS_ON_TARGET = "total-shots-on-target",
|
|
72
|
+
TOTAL_CARDS = "total-cards",
|
|
73
|
+
// MATCH_RESULT = 'match-result',
|
|
74
|
+
RED_CARD_IS_GIVEN = "red-card-is-given",
|
|
75
|
+
PENALTY_AWARDED = "penalty-awarded",
|
|
76
|
+
// BOTH_TEAM_SCORE = 'both-team-score',
|
|
77
|
+
// GOAL_IN_BOTH_HALVES = 'goal-in-both-halves',
|
|
78
|
+
GOAL_IN_FIRST_15 = "goal-in-first-15",
|
|
79
|
+
MOST_TACKLES_WON = "most-tackles-won",
|
|
80
|
+
CORNERS_10_OR_MORE = "corners-10-or-more",
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type B2BMPEventResultData = MPQuestion & {
|
|
84
|
+
result: {
|
|
85
|
+
isFinal: boolean;
|
|
86
|
+
value: MPQuestionResultTypeValueType[MPQuestionResultTypeEnum];
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type MPQuestionResultTypeValueType = {
|
|
91
|
+
[MPQuestionResultTypeEnum.BOTH_SIDES_POSITIVE_INTEGER]: BothSidesPositiveInteger;
|
|
92
|
+
[MPQuestionResultTypeEnum.POSITIVE_INTEGER]: PositiveInteger;
|
|
93
|
+
[MPQuestionResultTypeEnum.MATCH_SIDE_RESULT]: MatchSideResultEnum;
|
|
94
|
+
[MPQuestionResultTypeEnum.YES_NO]: YesNoResultEnum;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export enum MatchSideResultEnum {
|
|
98
|
+
HOME = "home",
|
|
99
|
+
AWAY = "away",
|
|
100
|
+
DRAW = "draw",
|
|
101
|
+
}
|
|
102
|
+
export enum YesNoResultEnum {
|
|
103
|
+
YES = "yes",
|
|
104
|
+
NO = "no",
|
|
105
|
+
}
|
|
106
|
+
export type BothSidesPositiveInteger = { home: number; away: number };
|
|
107
|
+
export type PositiveInteger = number;
|
|
108
|
+
|
|
109
|
+
export enum MPQuestionResultTypeEnum {
|
|
110
|
+
BOTH_SIDES_POSITIVE_INTEGER = "both-sides-positive-integer",
|
|
111
|
+
POSITIVE_INTEGER = "positive-integer",
|
|
112
|
+
MATCH_SIDE_RESULT = "match-side-result",
|
|
113
|
+
YES_NO = "yes-no",
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./b2b-bet-events";
|
|
1
|
+
export * from "./b2b-bet-events.model";
|
|
@@ -1,70 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ISODate, UUID } from "../common";
|
|
3
|
-
|
|
4
|
-
export type B2BBet = {
|
|
5
|
-
id: string;
|
|
6
|
-
userId: UUID;
|
|
7
|
-
gameKey: GameKeyEnum;
|
|
8
|
-
betEventId: UUID;
|
|
9
|
-
predictions: BetPredictionType[];
|
|
10
|
-
createdAt: ISODate;
|
|
11
|
-
updatedAt: ISODate;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type BetPredictionType = MPPrediction;
|
|
15
|
-
|
|
16
|
-
export type MPPrediction = {
|
|
17
|
-
questionKey: MPQuestionKeyEnum;
|
|
18
|
-
predictionValue: MPQuestionResultTypeValueType[MPQuestionResultTypeEnum];
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export enum MPQuestionKeyEnum {
|
|
22
|
-
MATCH_SCORE = "match-score",
|
|
23
|
-
TOTAL_SHOTS_ON_TARGET = "total-shots-on-target",
|
|
24
|
-
TOTAL_CARDS = "total-cards",
|
|
25
|
-
// MATCH_RESULT = 'match-result',
|
|
26
|
-
RED_CARD_IS_GIVEN = "red-card-is-given",
|
|
27
|
-
PENALTY_AWARDED = "penalty-awarded",
|
|
28
|
-
// BOTH_TEAM_SCORE = 'both-team-score',
|
|
29
|
-
// GOAL_IN_BOTH_HALVES = 'goal-in-both-halves',
|
|
30
|
-
GOAL_IN_FIRST_15 = "goal-in-first-15",
|
|
31
|
-
MOST_TACKLES_WON = "most-tackles-won",
|
|
32
|
-
CORNERS_10_OR_MORE = "corners-10-or-more",
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// export type MPQuestionKeyType = keyof typeof MPQuestionKeyEnum;
|
|
36
|
-
|
|
37
|
-
export enum MatchSideResultEnum {
|
|
38
|
-
HOME = "home",
|
|
39
|
-
AWAY = "away",
|
|
40
|
-
DRAW = "draw",
|
|
41
|
-
}
|
|
42
|
-
export enum YesNoResultEnum {
|
|
43
|
-
YES = "yes",
|
|
44
|
-
NO = "no",
|
|
45
|
-
}
|
|
46
|
-
export type BothSidesPositiveInteger = { home: number; away: number };
|
|
47
|
-
export type PositiveInteger = number;
|
|
48
|
-
|
|
49
|
-
export enum MPQuestionResultTypeEnum {
|
|
50
|
-
BOTH_SIDES_POSITIVE_INTEGER = "both-sides-positive-integer",
|
|
51
|
-
POSITIVE_INTEGER = "positive-integer",
|
|
52
|
-
MATCH_SIDE_RESULT = "match-side-result",
|
|
53
|
-
YES_NO = "yes-no",
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export type MPQuestionResultTypeType = keyof typeof MPQuestionResultTypeEnum;
|
|
57
|
-
|
|
58
|
-
export type MPQuestion = {
|
|
59
|
-
key: MPQuestionKeyEnum;
|
|
60
|
-
points: number;
|
|
61
|
-
resultValueType: MPQuestionResultTypeEnum;
|
|
62
|
-
displayOrder: number;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export type MPQuestionResultTypeValueType = {
|
|
66
|
-
[MPQuestionResultTypeEnum.BOTH_SIDES_POSITIVE_INTEGER]: BothSidesPositiveInteger;
|
|
67
|
-
[MPQuestionResultTypeEnum.POSITIVE_INTEGER]: PositiveInteger;
|
|
68
|
-
[MPQuestionResultTypeEnum.MATCH_SIDE_RESULT]: MatchSideResultEnum;
|
|
69
|
-
[MPQuestionResultTypeEnum.YES_NO]: YesNoResultEnum;
|
|
70
|
-
};
|
|
1
|
+
export * from "./b2b-bets.model";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { GameKeyEnum } from "../b2b-bet-events";
|
|
2
|
+
import type { GFQuestionResultValue } from "../b2b-gf-events";
|
|
3
|
+
import type { ISODate, UUID } from "../common";
|
|
4
|
+
|
|
5
|
+
export type B2BBet = {
|
|
6
|
+
id: string;
|
|
7
|
+
userId: UUID;
|
|
8
|
+
gameKey: GameKeyEnum;
|
|
9
|
+
gameTypeId: UUID;
|
|
10
|
+
status: BetStatusEnum;
|
|
11
|
+
betEventId: UUID;
|
|
12
|
+
predictions: BetPredictionType[];
|
|
13
|
+
createdAt: ISODate;
|
|
14
|
+
updatedAt: ISODate;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export enum BetStatusEnum {
|
|
18
|
+
OPEN = "open",
|
|
19
|
+
PENDING = "pending",
|
|
20
|
+
WON = "won",
|
|
21
|
+
LOST = "lost",
|
|
22
|
+
CANCELED = "cancelled",
|
|
23
|
+
LOCKED = "locked",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type BetPredictionType = MPPrediction | GFPrediction;
|
|
27
|
+
|
|
28
|
+
export type MPPrediction = {
|
|
29
|
+
questionKey: MPQuestionKeyEnum;
|
|
30
|
+
predictionValue: MPQuestionResultTypeValueType[MPQuestionResultTypeEnum];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type GFPrediction = {
|
|
34
|
+
eventQuestionId: UUID;
|
|
35
|
+
predictionValue: GFQuestionResultValue;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export enum MPQuestionKeyEnum {
|
|
39
|
+
MATCH_SCORE = "match-score",
|
|
40
|
+
TOTAL_SHOTS_ON_TARGET = "total-shots-on-target",
|
|
41
|
+
TOTAL_CARDS = "total-cards",
|
|
42
|
+
// MATCH_RESULT = 'match-result',
|
|
43
|
+
RED_CARD_IS_GIVEN = "red-card-is-given",
|
|
44
|
+
PENALTY_AWARDED = "penalty-awarded",
|
|
45
|
+
// BOTH_TEAM_SCORE = 'both-team-score',
|
|
46
|
+
// GOAL_IN_BOTH_HALVES = 'goal-in-both-halves',
|
|
47
|
+
GOAL_IN_FIRST_15 = "goal-in-first-15",
|
|
48
|
+
MOST_TACKLES_WON = "most-tackles-won",
|
|
49
|
+
CORNERS_10_OR_MORE = "corners-10-or-more",
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// export type MPQuestionKeyType = keyof typeof MPQuestionKeyEnum;
|
|
53
|
+
|
|
54
|
+
export enum MatchSideResultEnum {
|
|
55
|
+
HOME = "home",
|
|
56
|
+
AWAY = "away",
|
|
57
|
+
DRAW = "draw",
|
|
58
|
+
}
|
|
59
|
+
export enum YesNoResultEnum {
|
|
60
|
+
YES = "yes",
|
|
61
|
+
NO = "no",
|
|
62
|
+
}
|
|
63
|
+
export type BothSidesPositiveInteger = { home: number; away: number };
|
|
64
|
+
export type PositiveInteger = number;
|
|
65
|
+
|
|
66
|
+
export enum MPQuestionResultTypeEnum {
|
|
67
|
+
BOTH_SIDES_POSITIVE_INTEGER = "both-sides-positive-integer",
|
|
68
|
+
POSITIVE_INTEGER = "positive-integer",
|
|
69
|
+
MATCH_SIDE_RESULT = "match-side-result",
|
|
70
|
+
YES_NO = "yes-no",
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type MPQuestionResultTypeType = keyof typeof MPQuestionResultTypeEnum;
|
|
74
|
+
|
|
75
|
+
export type MPQuestion = {
|
|
76
|
+
key: MPQuestionKeyEnum;
|
|
77
|
+
points: number;
|
|
78
|
+
resultValueType: MPQuestionResultTypeEnum;
|
|
79
|
+
displayOrder: number;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type MPQuestionResultTypeValueType = {
|
|
83
|
+
[MPQuestionResultTypeEnum.BOTH_SIDES_POSITIVE_INTEGER]: BothSidesPositiveInteger;
|
|
84
|
+
[MPQuestionResultTypeEnum.POSITIVE_INTEGER]: PositiveInteger;
|
|
85
|
+
[MPQuestionResultTypeEnum.MATCH_SIDE_RESULT]: MatchSideResultEnum;
|
|
86
|
+
[MPQuestionResultTypeEnum.YES_NO]: YesNoResultEnum;
|
|
87
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./b2b-bets";
|
|
1
|
+
export * from "./b2b-bets.model";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./b2b-gf-events.model";
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
B2BBetEventBettingStatusType,
|
|
3
|
+
B2BBetEventPoolData,
|
|
4
|
+
B2BBetEventStatusType,
|
|
5
|
+
GameKeyEnum,
|
|
6
|
+
} from "../b2b-bet-events";
|
|
7
|
+
import type { ISODate, UUID } from "../common";
|
|
8
|
+
|
|
9
|
+
export type B2BGFEvent = {
|
|
10
|
+
id: UUID;
|
|
11
|
+
organizationId: UUID;
|
|
12
|
+
startDate: ISODate;
|
|
13
|
+
status: B2BBetEventStatusType;
|
|
14
|
+
bettingStatus: B2BBetEventBettingStatusType;
|
|
15
|
+
gameKey: GameKeyEnum;
|
|
16
|
+
gameTypeId: UUID;
|
|
17
|
+
name: string;
|
|
18
|
+
entryFeeAmount: number;
|
|
19
|
+
commissionPercent: number;
|
|
20
|
+
prizeDistributionStrategy: GFPrizeDistributionStrategyEnum;
|
|
21
|
+
seedValue: number;
|
|
22
|
+
questions: GFEventQuestion[];
|
|
23
|
+
resultsData: GFEventResultsData;
|
|
24
|
+
poolData: B2BBetEventPoolData;
|
|
25
|
+
resultsUpdateReason: string | null;
|
|
26
|
+
createdAt: ISODate;
|
|
27
|
+
updatedAt: ISODate;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type GFEventQuestion = {
|
|
31
|
+
eventQuestionId: UUID;
|
|
32
|
+
questionType: GFQuestionTypeEnum;
|
|
33
|
+
text: string;
|
|
34
|
+
matchId: UUID;
|
|
35
|
+
gameTypeQuestionId?: UUID;
|
|
36
|
+
providerKey: string;
|
|
37
|
+
displayOrder: number;
|
|
38
|
+
helperText?: string;
|
|
39
|
+
label: string;
|
|
40
|
+
sport: string;
|
|
41
|
+
inGameEventKey: GFInGameEventKey;
|
|
42
|
+
pointsForExactHit: number;
|
|
43
|
+
pointsForCorrectResult: number;
|
|
44
|
+
pointsForWrongAnswer: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type GFEventResultsData = {
|
|
48
|
+
[eventQuestionId: UUID]: GFEventResultData;
|
|
49
|
+
} | null;
|
|
50
|
+
|
|
51
|
+
export type GFEventResultData = {
|
|
52
|
+
matchId: UUID;
|
|
53
|
+
isMatchFinished?: boolean;
|
|
54
|
+
result: {
|
|
55
|
+
isFinal: boolean;
|
|
56
|
+
value: GFQuestionResultValue;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type GFOccurrenceCountForSides = {
|
|
61
|
+
home: number;
|
|
62
|
+
away: number;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type GFQuestionResultValue = string | number | boolean | GFOccurrenceCountForSides;
|
|
66
|
+
|
|
67
|
+
export enum GFQuestionTypeEnum {
|
|
68
|
+
OCCURRENCE_COUNT_FOR_SIDES = "occurrence-count-for-sides",
|
|
69
|
+
MOST_OCCURRENCE_RESULT = "most-occurrence-result",
|
|
70
|
+
TOTAL_OCCURRENCE_COUNT = "total-occurrence-count",
|
|
71
|
+
OCCURRED_OR_NOT = "occurred-or-not",
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export enum GFInGameEventKey {
|
|
75
|
+
SCORE = "score",
|
|
76
|
+
GOAL = "goal",
|
|
77
|
+
CORNERS = "corners",
|
|
78
|
+
CORNERS_TOTAL = "corners_total",
|
|
79
|
+
CORNERS_10_OR_MORE = "corners_10_or_more",
|
|
80
|
+
RED_CARD = "red_card",
|
|
81
|
+
RED_CARD_TOTAL = "red_card_total",
|
|
82
|
+
YELLOW_CARD = "yellow_card",
|
|
83
|
+
YELLOW_CARD_TOTAL = "yellow_card_total",
|
|
84
|
+
TOTAL_CARDS = "total_cards",
|
|
85
|
+
PENALTY = "penalty",
|
|
86
|
+
TOTAL_GOALS = "total_goals",
|
|
87
|
+
SHOTS_ON_TARGET = "shots_on_target",
|
|
88
|
+
SHOTS_TOTAL = "shots_total",
|
|
89
|
+
TACKLES = "tackles",
|
|
90
|
+
TACKLES_TOTAL = "tackles_total",
|
|
91
|
+
GOAL_IN_FIRST_15 = "goal_in_first_15",
|
|
92
|
+
OFFSIDES = "offsides",
|
|
93
|
+
OFFSIDES_TOTAL = "offsides_total",
|
|
94
|
+
FOULS = "fouls",
|
|
95
|
+
FOULS_TOTAL = "fouls_total",
|
|
96
|
+
POSSESSION = "possession",
|
|
97
|
+
SAVES = "saves",
|
|
98
|
+
SAVES_TOTAL = "saves_total",
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export enum GFPrizeDistributionStrategyEnum {
|
|
102
|
+
WINNER_TAKES_ALL = "winner-takes-all",
|
|
103
|
+
TOP_3 = "top-3",
|
|
104
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./b2b-gf-events.model";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./b2b-gf-game-templates.model";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ISODate, UUID } from "../common";
|
|
2
|
+
import type { GFInGameEventKey, GFQuestionTypeEnum } from "../b2b-gf-events";
|
|
3
|
+
|
|
4
|
+
export type B2BGFGameTemplate = {
|
|
5
|
+
id: UUID;
|
|
6
|
+
displayName: string;
|
|
7
|
+
questionsTemplates: B2BGFQuestionTemplate[];
|
|
8
|
+
rules: string;
|
|
9
|
+
status: B2BGFGameTemplateStatusEnum;
|
|
10
|
+
createdAt: ISODate;
|
|
11
|
+
updatedAt: ISODate;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type B2BGFQuestionTemplate = {
|
|
15
|
+
id: UUID;
|
|
16
|
+
providerKey: string;
|
|
17
|
+
displayOrder: number;
|
|
18
|
+
helperText?: string;
|
|
19
|
+
label: string;
|
|
20
|
+
sport: string;
|
|
21
|
+
inGameEventKey: GFInGameEventKey;
|
|
22
|
+
type: GFQuestionTypeEnum;
|
|
23
|
+
pointsForExactHit: number;
|
|
24
|
+
pointsForCorrectResult: number;
|
|
25
|
+
pointsForWrongAnswer: number;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export enum B2BGFGameTemplateStatusEnum {
|
|
29
|
+
DRAFT = "draft",
|
|
30
|
+
PUBLISHED = "published",
|
|
31
|
+
ARCHIVED = "archived",
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./b2b-gf-game-templates.model";
|
|
@@ -1,44 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type B2BMatch = {
|
|
4
|
-
id: UUID;
|
|
5
|
-
startDate: ISODate;
|
|
6
|
-
homeTeam: MatchTeam;
|
|
7
|
-
awayTeam: MatchTeam;
|
|
8
|
-
status: B2BMatchStatus;
|
|
9
|
-
createdAt: ISODate;
|
|
10
|
-
updatedAt: ISODate;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type MatchTeam = {
|
|
14
|
-
id: UUID;
|
|
15
|
-
name: string;
|
|
16
|
-
logo: string | null;
|
|
17
|
-
score: number;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type B2BMatchStatus = {
|
|
21
|
-
matchStatus: B2BMatchStatusType;
|
|
22
|
-
isActive: boolean;
|
|
23
|
-
period: B2BMatchPeriod;
|
|
24
|
-
periodId: number;
|
|
25
|
-
minutes: number;
|
|
26
|
-
additionalMinutes: number;
|
|
27
|
-
fullTimeFinished: boolean;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export type B2BMatchPeriod =
|
|
31
|
-
| "PRE_MATCH"
|
|
32
|
-
| "FIRST_HALF"
|
|
33
|
-
| "SECOND_HALF"
|
|
34
|
-
| "FIRST_OVERTIME_HALF"
|
|
35
|
-
| "SECOND_OVERTIME_HALF"
|
|
36
|
-
| "SHOOTOUT";
|
|
37
|
-
|
|
38
|
-
export type B2BMatchStatusType =
|
|
39
|
-
| "finished"
|
|
40
|
-
| "preMatch"
|
|
41
|
-
| "live"
|
|
42
|
-
| "cancelled"
|
|
43
|
-
| "postponed"
|
|
44
|
-
| "unknown";
|
|
1
|
+
export * from "./b2b-match.model";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ISODate, UUID } from "../common";
|
|
2
|
+
|
|
3
|
+
export type B2BMatch = {
|
|
4
|
+
id: UUID;
|
|
5
|
+
startDate: ISODate;
|
|
6
|
+
homeTeam: MatchTeam;
|
|
7
|
+
awayTeam: MatchTeam;
|
|
8
|
+
status: B2BMatchStatus;
|
|
9
|
+
createdAt: ISODate;
|
|
10
|
+
updatedAt: ISODate;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type MatchTeam = {
|
|
14
|
+
id: UUID;
|
|
15
|
+
name: string;
|
|
16
|
+
logo: string | null;
|
|
17
|
+
score: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type B2BMatchStatus = {
|
|
21
|
+
matchStatus: B2BMatchStatusType;
|
|
22
|
+
isActive: boolean;
|
|
23
|
+
period: B2BMatchPeriod;
|
|
24
|
+
periodId: number;
|
|
25
|
+
minutes: number;
|
|
26
|
+
additionalMinutes: number;
|
|
27
|
+
fullTimeFinished: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type B2BMatchPeriod =
|
|
31
|
+
| "PRE_MATCH"
|
|
32
|
+
| "FIRST_HALF"
|
|
33
|
+
| "SECOND_HALF"
|
|
34
|
+
| "FIRST_OVERTIME_HALF"
|
|
35
|
+
| "SECOND_OVERTIME_HALF"
|
|
36
|
+
| "SHOOTOUT";
|
|
37
|
+
|
|
38
|
+
export type B2BMatchStatusType =
|
|
39
|
+
| "finished"
|
|
40
|
+
| "preMatch"
|
|
41
|
+
| "live"
|
|
42
|
+
| "cancelled"
|
|
43
|
+
| "postponed"
|
|
44
|
+
| "unknown";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./b2b-match";
|
|
1
|
+
export * from "./b2b-match.model";
|
package/package.json
CHANGED
package/.vscode/settings.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"workbench.colorCustomizations": {
|
|
3
|
-
"activityBar.activeBackground": "#1f6fd0",
|
|
4
|
-
"activityBar.background": "#1f6fd0",
|
|
5
|
-
"activityBar.foreground": "#e7e7e7",
|
|
6
|
-
"activityBar.inactiveForeground": "#e7e7e799",
|
|
7
|
-
"activityBarBadge.background": "#ee90bb",
|
|
8
|
-
"activityBarBadge.foreground": "#15202b",
|
|
9
|
-
"commandCenter.border": "#e7e7e799",
|
|
10
|
-
"sash.hoverBorder": "#1f6fd0",
|
|
11
|
-
"statusBar.background": "#1857a4",
|
|
12
|
-
"statusBar.foreground": "#e7e7e7",
|
|
13
|
-
"statusBarItem.hoverBackground": "#1f6fd0",
|
|
14
|
-
"statusBarItem.remoteBackground": "#1857a4",
|
|
15
|
-
"statusBarItem.remoteForeground": "#e7e7e7",
|
|
16
|
-
"titleBar.activeBackground": "#1857a4",
|
|
17
|
-
"titleBar.activeForeground": "#e7e7e7",
|
|
18
|
-
"titleBar.inactiveBackground": "#1857a499",
|
|
19
|
-
"titleBar.inactiveForeground": "#e7e7e799"
|
|
20
|
-
},
|
|
21
|
-
"peacock.color": "#1857a4"
|
|
22
|
-
}
|