@wrcb/cb-common 1.0.77 → 1.0.82

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,7 @@ 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
+ optionWinner: boolean;
23
24
  }
@@ -22,9 +22,9 @@ export declare function BuildPredictionObject(market: any, predictionOptions?: a
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
  };
@@ -8,6 +8,7 @@ exports.BuildPredictionObject = BuildPredictionObject;
8
8
  exports.BuildPredictionOptionsTwoOptionsArray = BuildPredictionOptionsTwoOptionsArray;
9
9
  exports.BuildPredictionOptionsMultipleOptionsArray = BuildPredictionOptionsMultipleOptionsArray;
10
10
  exports.BuildBetObject = BuildBetObject;
11
+ const uuid_1 = require("uuid");
11
12
  const marketStatus_1 = require("../events/types/marketStatus");
12
13
  const oddConfiguration_1 = require("../events/types/oddConfiguration");
13
14
  const predictionStatus_1 = require("../events/types/predictionStatus");
@@ -40,12 +41,14 @@ function BuildPredictionOptionsTwoOptionsArray() {
40
41
  description: 'Teremos cadeirada no marçal?',
41
42
  options: [
42
43
  {
44
+ optionId: (0, uuid_1.v4)(),
43
45
  optionLabel: 'Sim',
44
- odd: 0,
46
+ optionWinner: false
45
47
  },
46
48
  {
49
+ optionId: (0, uuid_1.v4)(),
47
50
  optionLabel: 'Não',
48
- odd: 0,
51
+ optionWinner: false
49
52
  },
50
53
  ],
51
54
  },
@@ -56,11 +59,11 @@ function BuildPredictionOptionsMultipleOptionsArray() {
56
59
  const predictionOptionsMultiOptions = [];
57
60
  return predictionOptionsMultiOptions;
58
61
  }
59
- function BuildBetObject(prediction, userId, odd, value) {
62
+ function BuildBetObject(prediction, userId, value, odd) {
60
63
  return {
61
64
  prediction,
62
65
  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,
66
+ value: value !== null && value !== void 0 ? value : 150,
67
+ odd: odd !== null && odd !== void 0 ? odd : 1.5,
65
68
  };
66
69
  }
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.77",
3
+ "version": "1.0.82",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,6 +28,7 @@
28
28
  "express-validator": "^7.1.0",
29
29
  "jsonwebtoken": "^9.0.2",
30
30
  "mongoose": "^8.6.3",
31
- "node-nats-streaming": "^0.3.2"
31
+ "node-nats-streaming": "^0.3.2",
32
+ "uuid": "^11.1.0"
32
33
  }
33
34
  }
@@ -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 });