@wrcb/cb-common 1.0.76 → 1.0.81

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,7 +11,6 @@ export declare enum Subjects {
11
11
  PredictionUpdated = "prediction:updated",
12
12
  PredictionResultProcessed = "prediction:result:processed",
13
13
  BetMade = "bet:made",
14
- BetClaimMade = "bet:claim:made",
15
14
  DepositMade = "deposit:made",
16
15
  WithdrawalMade = "withdrawal:made"
17
16
  }
@@ -15,7 +15,6 @@ var Subjects;
15
15
  Subjects["PredictionUpdated"] = "prediction:updated";
16
16
  Subjects["PredictionResultProcessed"] = "prediction:result:processed";
17
17
  Subjects["BetMade"] = "bet:made";
18
- Subjects["BetClaimMade"] = "bet:claim:made";
19
18
  Subjects["DepositMade"] = "deposit:made";
20
19
  Subjects["WithdrawalMade"] = "withdrawal:made";
21
20
  })(Subjects || (exports.Subjects = Subjects = {}));
@@ -18,6 +18,6 @@ export interface PredictionOptions {
18
18
  options: Options[];
19
19
  }
20
20
  export interface Options {
21
+ optionId: string;
21
22
  optionLabel: string;
22
- odd: number;
23
23
  }
@@ -8,7 +8,7 @@ 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, oddConfiguration?: OddConfiguration, image?: string, rules?: string, slug?: string): {
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): {
12
12
  title: string;
13
13
  details: string;
14
14
  status: PredictionStatus;
@@ -22,9 +22,9 @@ export declare function BuildPredictionObject(market: any, predictionOptions: an
22
22
  };
23
23
  export declare function BuildPredictionOptionsTwoOptionsArray(): PredictionOptions[];
24
24
  export declare function BuildPredictionOptionsMultipleOptionsArray(): PredictionOptions[];
25
- export declare function BuildBetObject(prediction: any, userId?: string, odd?: number, value?: number): {
25
+ export declare function BuildBetObject(prediction: any, userId: string, value?: number, odd?: number): {
26
26
  prediction: any;
27
27
  userId: string;
28
- odd: number;
29
28
  value: number;
29
+ odd: number;
30
30
  };
@@ -31,7 +31,7 @@ function BuildPredictionObject(market, predictionOptions, title, details, status
31
31
  rules: rules !== null && rules !== void 0 ? rules : 'rules',
32
32
  slug: slug !== null && slug !== void 0 ? slug : 'slug',
33
33
  market,
34
- predictionOptions,
34
+ predictionOptions: predictionOptions !== null && predictionOptions !== void 0 ? predictionOptions : BuildPredictionOptionsTwoOptionsArray(),
35
35
  };
36
36
  }
37
37
  function BuildPredictionOptionsTwoOptionsArray() {
@@ -41,11 +41,11 @@ function BuildPredictionOptionsTwoOptionsArray() {
41
41
  options: [
42
42
  {
43
43
  optionLabel: 'Sim',
44
- odd: 0,
44
+ optionId: '1--'
45
45
  },
46
46
  {
47
47
  optionLabel: 'Não',
48
- odd: 0,
48
+ optionId: '2--'
49
49
  },
50
50
  ],
51
51
  },
@@ -56,11 +56,11 @@ function BuildPredictionOptionsMultipleOptionsArray() {
56
56
  const predictionOptionsMultiOptions = [];
57
57
  return predictionOptionsMultiOptions;
58
58
  }
59
- function BuildBetObject(prediction, userId, odd, value) {
59
+ function BuildBetObject(prediction, userId, value, odd) {
60
60
  return {
61
61
  prediction,
62
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,
63
+ value: value !== null && value !== void 0 ? value : 150,
64
+ odd: odd !== null && odd !== void 0 ? odd : 1.5,
65
65
  };
66
66
  }
package/build/index.d.ts CHANGED
@@ -32,7 +32,6 @@ export * from './events/predictionFinishedEvent';
32
32
  export * from './events/predictionDeletedEvent';
33
33
  export * from './events/predictionUpdatedEvent';
34
34
  export * from './events/betMadeEvent';
35
- export * from './events/betClaimMadeEvent';
36
35
  export * from './events/depositMadeEvent';
37
36
  export * from './events/withdrawalMadeEvent';
38
37
  export * from './events/newPasswordGeneratedEvent';
package/build/index.js CHANGED
@@ -48,7 +48,6 @@ __exportStar(require("./events/predictionFinishedEvent"), exports);
48
48
  __exportStar(require("./events/predictionDeletedEvent"), exports);
49
49
  __exportStar(require("./events/predictionUpdatedEvent"), exports);
50
50
  __exportStar(require("./events/betMadeEvent"), exports);
51
- __exportStar(require("./events/betClaimMadeEvent"), exports);
52
51
  __exportStar(require("./events/depositMadeEvent"), exports);
53
52
  __exportStar(require("./events/withdrawalMadeEvent"), exports);
54
53
  __exportStar(require("./events/newPasswordGeneratedEvent"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrcb/cb-common",
3
- "version": "1.0.76",
3
+ "version": "1.0.81",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,16 +0,0 @@
1
- import { Subjects } from './subjects';
2
- export interface BetClaimMadeEvent {
3
- subject: Subjects.BetClaimMade;
4
- data: {
5
- betId: string;
6
- value: number;
7
- version: number;
8
- userId: string;
9
- prediction: {
10
- id: string;
11
- title: string;
12
- details: string;
13
- };
14
- marketTitle: string;
15
- };
16
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });