@wrcb/cb-common 1.0.89 → 1.0.93
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/build/events/predictionStartedEvent.d.ts +1 -1
- package/build/events/predictionUpdatedEvent.d.ts +1 -1
- package/build/events/types/{oddConfiguration.d.ts → oddType.d.ts} +6 -1
- package/build/events/types/oddType.js +43 -0
- package/build/events/types/predictions.d.ts +2 -1
- package/build/helpers/createObjects.d.ts +3 -3
- package/build/helpers/createObjects.js +7 -5
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/build/events/types/oddConfiguration.js +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Subjects } from './subjects';
|
|
2
|
-
import { OddConfiguration } from './types/
|
|
2
|
+
import { OddConfiguration } from './types/oddType';
|
|
3
3
|
import { PredictionOptions } from './types/predictions';
|
|
4
4
|
export interface PredictionStartedEvent {
|
|
5
5
|
subject: Subjects.PredictionStarted;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Subjects } from './subjects';
|
|
2
|
-
import { OddConfiguration } from './types/
|
|
2
|
+
import { OddConfiguration } from './types/oddType';
|
|
3
3
|
import { PredictionOptions } from './types/predictions';
|
|
4
4
|
export interface PredictionUpdatedEvent {
|
|
5
5
|
subject: Subjects.PredictionUpdated;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare enum
|
|
1
|
+
export declare enum OddType {
|
|
2
2
|
Automatic05 = "Autom\u00E1tico 05",
|
|
3
3
|
Automatic06 = "Autom\u00E1tico 06",
|
|
4
4
|
Automatic07 = "Autom\u00E1tico 07",
|
|
@@ -7,3 +7,8 @@ export declare enum OddConfiguration {
|
|
|
7
7
|
Automatic10 = "Autom\u00E1tico 10",
|
|
8
8
|
Manual = "Manual"
|
|
9
9
|
}
|
|
10
|
+
export interface OddConfiguration {
|
|
11
|
+
oddType: OddType;
|
|
12
|
+
housePercentage: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const oddInfoMap: Record<OddType, OddConfiguration>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.oddInfoMap = exports.OddType = void 0;
|
|
4
|
+
var OddType;
|
|
5
|
+
(function (OddType) {
|
|
6
|
+
OddType["Automatic05"] = "Autom\u00E1tico 05";
|
|
7
|
+
OddType["Automatic06"] = "Autom\u00E1tico 06";
|
|
8
|
+
OddType["Automatic07"] = "Autom\u00E1tico 07";
|
|
9
|
+
OddType["Automatic08"] = "Autom\u00E1tico 08";
|
|
10
|
+
OddType["Automatic09"] = "Autom\u00E1tico 09";
|
|
11
|
+
OddType["Automatic10"] = "Autom\u00E1tico 10";
|
|
12
|
+
OddType["Manual"] = "Manual";
|
|
13
|
+
})(OddType || (exports.OddType = OddType = {}));
|
|
14
|
+
exports.oddInfoMap = {
|
|
15
|
+
[OddType.Automatic05]: {
|
|
16
|
+
oddType: OddType.Automatic05,
|
|
17
|
+
housePercentage: 5,
|
|
18
|
+
},
|
|
19
|
+
[OddType.Automatic06]: {
|
|
20
|
+
oddType: OddType.Automatic06,
|
|
21
|
+
housePercentage: 6,
|
|
22
|
+
},
|
|
23
|
+
[OddType.Automatic07]: {
|
|
24
|
+
oddType: OddType.Automatic07,
|
|
25
|
+
housePercentage: 7,
|
|
26
|
+
},
|
|
27
|
+
[OddType.Automatic08]: {
|
|
28
|
+
oddType: OddType.Automatic08,
|
|
29
|
+
housePercentage: 8,
|
|
30
|
+
},
|
|
31
|
+
[OddType.Automatic09]: {
|
|
32
|
+
oddType: OddType.Automatic09,
|
|
33
|
+
housePercentage: 9,
|
|
34
|
+
},
|
|
35
|
+
[OddType.Automatic10]: {
|
|
36
|
+
oddType: OddType.Automatic10,
|
|
37
|
+
housePercentage: 10,
|
|
38
|
+
},
|
|
39
|
+
[OddType.Manual]: {
|
|
40
|
+
oddType: OddType.Manual,
|
|
41
|
+
housePercentage: 0, // Pode ser 0 por padrão, já que será manualmente definido
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Market } from './market';
|
|
2
|
-
import { OddConfiguration } from './
|
|
2
|
+
import { OddConfiguration } from './oddType';
|
|
3
3
|
import { PredictionStatus } from './predictionStatus';
|
|
4
4
|
export interface Prediction {
|
|
5
5
|
market: Market;
|
|
@@ -21,4 +21,5 @@ export interface Options {
|
|
|
21
21
|
optionId: string;
|
|
22
22
|
optionLabel: string;
|
|
23
23
|
optionWinner: boolean;
|
|
24
|
+
optionInitialOdd: number;
|
|
24
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MarketStatus } from '../events/types/marketStatus';
|
|
2
|
-
import {
|
|
2
|
+
import { OddType } from '../events/types/oddType';
|
|
3
3
|
import { PredictionOptions } from '../events/types/predictions';
|
|
4
4
|
import { PredictionStatus } from '../events/types/predictionStatus';
|
|
5
5
|
export declare function BuildMarketObject(title?: string, description?: string, status?: MarketStatus, priority?: number): {
|
|
@@ -8,12 +8,12 @@ export declare function BuildMarketObject(title?: string, description?: string,
|
|
|
8
8
|
status: MarketStatus;
|
|
9
9
|
priority: number;
|
|
10
10
|
};
|
|
11
|
-
export declare function BuildPredictionObject(market: any, predictionOptions?: any, title?: string, details?: string, status?: PredictionStatus, deadLine?: Date,
|
|
11
|
+
export declare function BuildPredictionObject(market: any, predictionOptions?: any, title?: string, details?: string, status?: PredictionStatus, deadLine?: Date, oddType?: OddType, image?: string, rules?: string, slug?: string): {
|
|
12
12
|
title: string;
|
|
13
13
|
details: string;
|
|
14
14
|
status: PredictionStatus;
|
|
15
15
|
deadLine: Date;
|
|
16
|
-
|
|
16
|
+
oddType: OddType;
|
|
17
17
|
image: string;
|
|
18
18
|
rules: string;
|
|
19
19
|
slug: string;
|
|
@@ -10,7 +10,7 @@ exports.BuildPredictionOptionsMultipleOptionsArray = BuildPredictionOptionsMulti
|
|
|
10
10
|
exports.BuildBetObject = BuildBetObject;
|
|
11
11
|
const uuid_1 = require("uuid");
|
|
12
12
|
const marketStatus_1 = require("../events/types/marketStatus");
|
|
13
|
-
const
|
|
13
|
+
const oddType_1 = require("../events/types/oddType");
|
|
14
14
|
const predictionStatus_1 = require("../events/types/predictionStatus");
|
|
15
15
|
const createIdMongoose_1 = __importDefault(require("./createIdMongoose"));
|
|
16
16
|
function BuildMarketObject(title, description, status, priority) {
|
|
@@ -21,13 +21,13 @@ function BuildMarketObject(title, description, status, priority) {
|
|
|
21
21
|
priority: priority !== null && priority !== void 0 ? priority : 1,
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function BuildPredictionObject(market, predictionOptions, title, details, status, deadLine,
|
|
24
|
+
function BuildPredictionObject(market, predictionOptions, title, details, status, deadLine, oddType, image, rules, slug) {
|
|
25
25
|
return {
|
|
26
26
|
title: title !== null && title !== void 0 ? title : 'Will Donald Trump win?',
|
|
27
27
|
details: details !== null && details !== void 0 ? details : 'prediction about elections',
|
|
28
28
|
status: status !== null && status !== void 0 ? status : predictionStatus_1.PredictionStatus.Created,
|
|
29
29
|
deadLine: deadLine !== null && deadLine !== void 0 ? deadLine : new Date(),
|
|
30
|
-
|
|
30
|
+
oddType: oddType !== null && oddType !== void 0 ? oddType : oddType_1.OddType.Automatic05,
|
|
31
31
|
image: image !== null && image !== void 0 ? image : 'image',
|
|
32
32
|
rules: rules !== null && rules !== void 0 ? rules : 'rules',
|
|
33
33
|
slug: slug !== null && slug !== void 0 ? slug : 'slug',
|
|
@@ -43,12 +43,14 @@ function BuildPredictionOptionsTwoOptionsArray() {
|
|
|
43
43
|
{
|
|
44
44
|
optionId: (0, uuid_1.v4)(),
|
|
45
45
|
optionLabel: 'Sim',
|
|
46
|
-
optionWinner: false
|
|
46
|
+
optionWinner: false,
|
|
47
|
+
optionInitialOdd: 0
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
optionId: (0, uuid_1.v4)(),
|
|
50
51
|
optionLabel: 'Não',
|
|
51
|
-
optionWinner: false
|
|
52
|
+
optionWinner: false,
|
|
53
|
+
optionInitialOdd: 0
|
|
52
54
|
},
|
|
53
55
|
],
|
|
54
56
|
},
|
package/build/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export * from './events/types/ledgerOperation';
|
|
|
22
22
|
export * from './events/types/ledgerOperationMode';
|
|
23
23
|
export * from './events/types/country';
|
|
24
24
|
export * from './events/types/userRole';
|
|
25
|
-
export * from './events/types/
|
|
25
|
+
export * from './events/types/oddType';
|
|
26
26
|
export * from './events/types/predictions';
|
|
27
27
|
export * from './events/commentCreatedEvent';
|
|
28
28
|
export * from './events/commentUpdatedEvent';
|
package/build/index.js
CHANGED
|
@@ -38,7 +38,7 @@ __exportStar(require("./events/types/ledgerOperation"), exports);
|
|
|
38
38
|
__exportStar(require("./events/types/ledgerOperationMode"), exports);
|
|
39
39
|
__exportStar(require("./events/types/country"), exports);
|
|
40
40
|
__exportStar(require("./events/types/userRole"), exports);
|
|
41
|
-
__exportStar(require("./events/types/
|
|
41
|
+
__exportStar(require("./events/types/oddType"), exports);
|
|
42
42
|
__exportStar(require("./events/types/predictions"), exports);
|
|
43
43
|
__exportStar(require("./events/commentCreatedEvent"), exports);
|
|
44
44
|
__exportStar(require("./events/commentUpdatedEvent"), exports);
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OddConfiguration = void 0;
|
|
4
|
-
var OddConfiguration;
|
|
5
|
-
(function (OddConfiguration) {
|
|
6
|
-
OddConfiguration["Automatic05"] = "Autom\u00E1tico 05";
|
|
7
|
-
OddConfiguration["Automatic06"] = "Autom\u00E1tico 06";
|
|
8
|
-
OddConfiguration["Automatic07"] = "Autom\u00E1tico 07";
|
|
9
|
-
OddConfiguration["Automatic08"] = "Autom\u00E1tico 08";
|
|
10
|
-
OddConfiguration["Automatic09"] = "Autom\u00E1tico 09";
|
|
11
|
-
OddConfiguration["Automatic10"] = "Autom\u00E1tico 10";
|
|
12
|
-
OddConfiguration["Manual"] = "Manual";
|
|
13
|
-
})(OddConfiguration || (exports.OddConfiguration = OddConfiguration = {}));
|