@wrcb/cb-common 1.0.74 → 1.0.76
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.
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { MarketStatus } from '../events/types/marketStatus';
|
|
2
2
|
import { OddConfiguration } from '../events/types/oddConfiguration';
|
|
3
|
+
import { PredictionOptions } from '../events/types/predictions';
|
|
3
4
|
import { PredictionStatus } from '../events/types/predictionStatus';
|
|
4
|
-
export declare function BuildMarketObject(): {
|
|
5
|
+
export declare function BuildMarketObject(title?: string, description?: string, status?: MarketStatus, priority?: number): {
|
|
5
6
|
title: string;
|
|
6
7
|
description: string;
|
|
7
8
|
status: MarketStatus;
|
|
8
9
|
priority: number;
|
|
9
10
|
};
|
|
10
|
-
export declare function BuildPredictionObject(market: any, predictionOptions: any): {
|
|
11
|
+
export declare function BuildPredictionObject(market: any, predictionOptions: any, title?: string, details?: string, status?: PredictionStatus, deadLine?: Date, oddConfiguration?: OddConfiguration, image?: string, rules?: string, slug?: string): {
|
|
11
12
|
title: string;
|
|
12
13
|
details: string;
|
|
13
14
|
status: PredictionStatus;
|
|
@@ -19,7 +20,9 @@ export declare function BuildPredictionObject(market: any, predictionOptions: an
|
|
|
19
20
|
market: any;
|
|
20
21
|
predictionOptions: any;
|
|
21
22
|
};
|
|
22
|
-
export declare function
|
|
23
|
+
export declare function BuildPredictionOptionsTwoOptionsArray(): PredictionOptions[];
|
|
24
|
+
export declare function BuildPredictionOptionsMultipleOptionsArray(): PredictionOptions[];
|
|
25
|
+
export declare function BuildBetObject(prediction: any, userId?: string, odd?: number, value?: number): {
|
|
23
26
|
prediction: any;
|
|
24
27
|
userId: string;
|
|
25
28
|
odd: number;
|
|
@@ -5,38 +5,62 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BuildMarketObject = BuildMarketObject;
|
|
7
7
|
exports.BuildPredictionObject = BuildPredictionObject;
|
|
8
|
+
exports.BuildPredictionOptionsTwoOptionsArray = BuildPredictionOptionsTwoOptionsArray;
|
|
9
|
+
exports.BuildPredictionOptionsMultipleOptionsArray = BuildPredictionOptionsMultipleOptionsArray;
|
|
8
10
|
exports.BuildBetObject = BuildBetObject;
|
|
9
11
|
const marketStatus_1 = require("../events/types/marketStatus");
|
|
10
12
|
const oddConfiguration_1 = require("../events/types/oddConfiguration");
|
|
11
13
|
const predictionStatus_1 = require("../events/types/predictionStatus");
|
|
12
14
|
const createIdMongoose_1 = __importDefault(require("./createIdMongoose"));
|
|
13
|
-
function BuildMarketObject() {
|
|
15
|
+
function BuildMarketObject(title, description, status, priority) {
|
|
14
16
|
return {
|
|
15
|
-
title: 'Politics',
|
|
16
|
-
description: 'Politics predictions',
|
|
17
|
-
status: marketStatus_1.MarketStatus.Active,
|
|
18
|
-
priority: 1,
|
|
17
|
+
title: title !== null && title !== void 0 ? title : 'Politics',
|
|
18
|
+
description: description !== null && description !== void 0 ? description : 'Politics predictions',
|
|
19
|
+
status: status !== null && status !== void 0 ? status : marketStatus_1.MarketStatus.Active,
|
|
20
|
+
priority: priority !== null && priority !== void 0 ? priority : 1,
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
|
-
function BuildPredictionObject(market, predictionOptions) {
|
|
23
|
+
function BuildPredictionObject(market, predictionOptions, title, details, status, deadLine, oddConfiguration, image, rules, slug) {
|
|
22
24
|
return {
|
|
23
|
-
title: 'Will Donald Trump win?',
|
|
24
|
-
details: 'prediction about elections',
|
|
25
|
-
status: predictionStatus_1.PredictionStatus.Created,
|
|
26
|
-
deadLine: new Date(),
|
|
27
|
-
oddConfiguration: oddConfiguration_1.OddConfiguration.Automatic05,
|
|
28
|
-
image: 'image',
|
|
29
|
-
rules: 'rules',
|
|
30
|
-
slug: 'slug',
|
|
25
|
+
title: title !== null && title !== void 0 ? title : 'Will Donald Trump win?',
|
|
26
|
+
details: details !== null && details !== void 0 ? details : 'prediction about elections',
|
|
27
|
+
status: status !== null && status !== void 0 ? status : predictionStatus_1.PredictionStatus.Created,
|
|
28
|
+
deadLine: deadLine !== null && deadLine !== void 0 ? deadLine : new Date(),
|
|
29
|
+
oddConfiguration: oddConfiguration !== null && oddConfiguration !== void 0 ? oddConfiguration : oddConfiguration_1.OddConfiguration.Automatic05,
|
|
30
|
+
image: image !== null && image !== void 0 ? image : 'image',
|
|
31
|
+
rules: rules !== null && rules !== void 0 ? rules : 'rules',
|
|
32
|
+
slug: slug !== null && slug !== void 0 ? slug : 'slug',
|
|
31
33
|
market,
|
|
32
34
|
predictionOptions,
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
|
-
function
|
|
37
|
+
function BuildPredictionOptionsTwoOptionsArray() {
|
|
38
|
+
const predictionOptionsTwoOptions = [
|
|
39
|
+
{
|
|
40
|
+
description: 'Teremos cadeirada no marçal?',
|
|
41
|
+
options: [
|
|
42
|
+
{
|
|
43
|
+
optionLabel: 'Sim',
|
|
44
|
+
odd: 0,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
optionLabel: 'Não',
|
|
48
|
+
odd: 0,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
return predictionOptionsTwoOptions;
|
|
54
|
+
}
|
|
55
|
+
function BuildPredictionOptionsMultipleOptionsArray() {
|
|
56
|
+
const predictionOptionsMultiOptions = [];
|
|
57
|
+
return predictionOptionsMultiOptions;
|
|
58
|
+
}
|
|
59
|
+
function BuildBetObject(prediction, userId, odd, value) {
|
|
36
60
|
return {
|
|
37
61
|
prediction,
|
|
38
|
-
userId: (0, createIdMongoose_1.default)(),
|
|
39
|
-
odd: 1,
|
|
40
|
-
value: 23,
|
|
62
|
+
userId: userId !== null && userId !== void 0 ? userId : (0, createIdMongoose_1.default)(),
|
|
63
|
+
odd: odd !== null && odd !== void 0 ? odd : 1,
|
|
64
|
+
value: value !== null && value !== void 0 ? value : 23,
|
|
41
65
|
};
|
|
42
66
|
}
|