@wrcb/cb-common 1.0.20 → 1.0.22

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,8 +1,8 @@
1
1
  import { Subjects } from './subjects';
2
- export interface PaymentMadeEvent {
3
- subject: Subjects.PaymentMade;
2
+ export interface BetClaimMadeEvent {
3
+ subject: Subjects.BetClaimMade;
4
4
  data: {
5
- paymentId: string;
5
+ betId: string;
6
6
  value: number;
7
7
  version: number;
8
8
  prediction: {
@@ -0,0 +1,15 @@
1
+ import { Subjects } from './subjects';
2
+ export interface BetMadeEvent {
3
+ subject: Subjects.BetMade;
4
+ data: {
5
+ betId: string;
6
+ value: number;
7
+ version: number;
8
+ prediction: {
9
+ id: string;
10
+ title: string;
11
+ description: string;
12
+ };
13
+ marketTitle: string;
14
+ };
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { Subjects } from './subjects';
2
+ import { LedgerOperation } from './types/ledgerOperation';
3
+ import { LedgerOperationMode } from './types/ledgerOperationMode';
4
+ export interface DepositMadeEvent {
5
+ subject: Subjects.DepositMade;
6
+ data: {
7
+ ledgerId: string;
8
+ value: number;
9
+ version: number;
10
+ ledgerOperation: LedgerOperation;
11
+ ledgerOperationMode: LedgerOperationMode;
12
+ };
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,7 +4,9 @@ export declare enum Subjects {
4
4
  PredictionCreated = "prediction:created",
5
5
  PredictionStarted = "prediction:started",
6
6
  PredictionFinished = "prediction:finished",
7
- PredictionPaymentProcessed = "prediction:paymentprocessed",
8
- PaymentMade = "payment:made",
7
+ PredictionResultProcessed = "prediction:result:processed",
8
+ BetMade = "bet:made",
9
+ BetClaimMade = "bet:claim:made",
10
+ DepositMade = "deposit:made",
9
11
  WithdrawalMade = "withdrawal:made"
10
12
  }
@@ -8,7 +8,9 @@ var Subjects;
8
8
  Subjects["PredictionCreated"] = "prediction:created";
9
9
  Subjects["PredictionStarted"] = "prediction:started";
10
10
  Subjects["PredictionFinished"] = "prediction:finished";
11
- Subjects["PredictionPaymentProcessed"] = "prediction:paymentprocessed";
12
- Subjects["PaymentMade"] = "payment:made";
11
+ Subjects["PredictionResultProcessed"] = "prediction:result:processed";
12
+ Subjects["BetMade"] = "bet:made";
13
+ Subjects["BetClaimMade"] = "bet:claim:made";
14
+ Subjects["DepositMade"] = "deposit:made";
13
15
  Subjects["WithdrawalMade"] = "withdrawal:made";
14
16
  })(Subjects || (exports.Subjects = Subjects = {}));
@@ -0,0 +1,6 @@
1
+ export declare enum LedgerOperation {
2
+ Deposited = "Depositado",
3
+ Withdrawn = "Retirada feita",
4
+ BetMade = "Aposta feita",
5
+ BetClaimMade = "Aposta retirada"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LedgerOperation = void 0;
4
+ var LedgerOperation;
5
+ (function (LedgerOperation) {
6
+ LedgerOperation["Deposited"] = "Depositado";
7
+ LedgerOperation["Withdrawn"] = "Retirada feita";
8
+ LedgerOperation["BetMade"] = "Aposta feita";
9
+ LedgerOperation["BetClaimMade"] = "Aposta retirada";
10
+ })(LedgerOperation || (exports.LedgerOperation = LedgerOperation = {}));
@@ -0,0 +1,5 @@
1
+ export declare enum LedgerOperationMode {
2
+ Internal = "Opera\u00E7\u00E3o interna",
3
+ Pix = "Pix",
4
+ CreditCard = "Cart\u00E3o de cr\u00E9dito"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LedgerOperationMode = void 0;
4
+ var LedgerOperationMode;
5
+ (function (LedgerOperationMode) {
6
+ LedgerOperationMode["Internal"] = "Opera\u00E7\u00E3o interna";
7
+ LedgerOperationMode["Pix"] = "Pix";
8
+ LedgerOperationMode["CreditCard"] = "Cart\u00E3o de cr\u00E9dito";
9
+ })(LedgerOperationMode || (exports.LedgerOperationMode = LedgerOperationMode = {}));
@@ -1,15 +1,13 @@
1
1
  import { Subjects } from './subjects';
2
+ import { LedgerOperation } from './types/ledgerOperation';
3
+ import { LedgerOperationMode } from './types/ledgerOperationMode';
2
4
  export interface WithdrawalMadeEvent {
3
5
  subject: Subjects.WithdrawalMade;
4
6
  data: {
5
- paymentId: string;
7
+ ledgerId: string;
6
8
  value: number;
7
9
  version: number;
8
- prediction: {
9
- id: string;
10
- title: string;
11
- description: string;
12
- };
13
- marketTitle: string;
10
+ ledgerOperation: LedgerOperation;
11
+ ledgerOperationMode: LedgerOperationMode;
14
12
  };
15
13
  }
package/build/index.d.ts CHANGED
@@ -13,8 +13,13 @@ export * from './events/basePublisher';
13
13
  export * from './events/subjects';
14
14
  export * from './events/types/marketStatus';
15
15
  export * from './events/types/predictionStatus';
16
+ export * from './events/types/ledgerOperation';
17
+ export * from './events/types/ledgerOperationMode';
16
18
  export * from './events/commentCreatedEvent';
17
19
  export * from './events/commentUpdatedEvent';
18
20
  export * from './events/predictionFinishedEvent';
19
21
  export * from './events/predictionStartedEvent';
20
- export * from './events/paymentMadeEvent';
22
+ export * from './events/betMadeEvent';
23
+ export * from './events/betClaimMadeEvent';
24
+ export * from './events/depositMadeEvent';
25
+ export * from './events/withdrawalMadeEvent';
package/build/index.js CHANGED
@@ -29,8 +29,13 @@ __exportStar(require("./events/basePublisher"), exports);
29
29
  __exportStar(require("./events/subjects"), exports);
30
30
  __exportStar(require("./events/types/marketStatus"), exports);
31
31
  __exportStar(require("./events/types/predictionStatus"), exports);
32
+ __exportStar(require("./events/types/ledgerOperation"), exports);
33
+ __exportStar(require("./events/types/ledgerOperationMode"), exports);
32
34
  __exportStar(require("./events/commentCreatedEvent"), exports);
33
35
  __exportStar(require("./events/commentUpdatedEvent"), exports);
34
36
  __exportStar(require("./events/predictionFinishedEvent"), exports);
35
37
  __exportStar(require("./events/predictionStartedEvent"), exports);
36
- __exportStar(require("./events/paymentMadeEvent"), exports);
38
+ __exportStar(require("./events/betMadeEvent"), exports);
39
+ __exportStar(require("./events/betClaimMadeEvent"), exports);
40
+ __exportStar(require("./events/depositMadeEvent"), exports);
41
+ __exportStar(require("./events/withdrawalMadeEvent"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrcb/cb-common",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",