gambling-bot-shared 1.0.3 → 1.0.4

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.
@@ -24,7 +24,7 @@ function createCasinoBetService({ userModel, transactionModel }) {
24
24
  amount,
25
25
  type: 'refund',
26
26
  source: 'casino',
27
- betId,
27
+ referenceId: betId,
28
28
  meta: { game }
29
29
  }
30
30
  ], { session });
@@ -52,7 +52,7 @@ function createCasinoBetService({ userModel, transactionModel }) {
52
52
  if (winnings > 0) {
53
53
  const winExists = await transactionModel
54
54
  .exists({
55
- betId,
55
+ referenceId: betId,
56
56
  type: 'win'
57
57
  })
58
58
  .session(session);
@@ -65,7 +65,7 @@ function createCasinoBetService({ userModel, transactionModel }) {
65
65
  amount: winnings,
66
66
  type: 'win',
67
67
  source: 'casino',
68
- betId,
68
+ referenceId: betId,
69
69
  meta: { game }
70
70
  }
71
71
  ], { session });
@@ -99,7 +99,7 @@ function createCasinoBetService({ userModel, transactionModel }) {
99
99
  amount,
100
100
  type: 'refund',
101
101
  source: 'casino',
102
- betId: raffleId,
102
+ referenceId: raffleId,
103
103
  meta: { game }
104
104
  }
105
105
  ], { session });
@@ -127,7 +127,7 @@ function createCasinoBetService({ userModel, transactionModel }) {
127
127
  amount,
128
128
  type: 'win',
129
129
  source: 'casino',
130
- betId: raffleId,
130
+ referenceId: raffleId,
131
131
  meta: { game }
132
132
  }
133
133
  ], { session });
@@ -63,7 +63,7 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
63
63
  }, "id"> & {
64
64
  id: string;
65
65
  }> | undefined;
66
- betId?: import("mongoose").SchemaDefinitionProperty<string | undefined, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
66
+ referenceId?: import("mongoose").SchemaDefinitionProperty<string | undefined, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
67
67
  id: string;
68
68
  }, import("mongoose").DefaultSchemaOptions> & Omit<TTransaction & {
69
69
  _id: import("mongoose").Types.ObjectId;
@@ -17,13 +17,13 @@ exports.TransactionSchema = new mongoose_1.Schema({
17
17
  enum: ['command', 'manual', 'web', 'system', 'casino']
18
18
  },
19
19
  meta: { type: mongoose_1.Schema.Types.Mixed, default: {} },
20
- betId: { type: String, default: null },
20
+ referenceId: { type: String, default: null },
21
21
  handledBy: { type: String, default: null }
22
22
  }, { timestamps: { createdAt: true, updatedAt: false } });
23
- exports.TransactionSchema.index({ betId: 1, type: 1 }, {
23
+ exports.TransactionSchema.index({ referenceId: 1, type: 1 }, {
24
24
  unique: true,
25
25
  partialFilterExpression: {
26
- betId: { $exists: true, $ne: null }
26
+ referenceId: { $exists: true, $ne: null }
27
27
  }
28
28
  });
29
29
  // for pagination / sorting
@@ -36,5 +36,5 @@ exports.TransactionSchema.index({ guildId: 1, source: 1, createdAt: -1 });
36
36
  exports.TransactionSchema.index({ guildId: 1, userId: 1, createdAt: -1 });
37
37
  // admin search
38
38
  exports.TransactionSchema.index({ guildId: 1, handledBy: 1, createdAt: -1 });
39
- // for bet lookups
40
- exports.TransactionSchema.index({ guildId: 1, betId: 1 });
39
+ // reference ID lookups
40
+ exports.TransactionSchema.index({ guildId: 1, referenceId: 1 });
@@ -9,7 +9,7 @@ export type TTransaction = {
9
9
  type: 'deposit' | 'withdraw' | 'bet' | 'win' | 'refund' | 'bonus' | 'vip';
10
10
  source: 'command' | 'manual' | 'web' | 'system' | 'casino';
11
11
  meta?: TransactionMeta;
12
- betId?: string;
12
+ referenceId?: string;
13
13
  handledBy?: string;
14
14
  createdAt: Date;
15
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gambling-bot-shared",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "license": "MIT",
5
5
  "type": "commonjs",
6
6
  "repository": {