gambling-bot-shared 1.0.2 → 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.
- package/dist/casino/services/casinoBet.service.js +5 -5
- package/dist/transactions/constants/index.d.ts +1 -0
- package/dist/transactions/constants/index.js +1 -0
- package/dist/transactions/constants/staffAudit.d.ts +14 -0
- package/dist/transactions/constants/staffAudit.js +21 -0
- package/dist/transactions/transaction.mongoose.d.ts +1 -1
- package/dist/transactions/transaction.mongoose.js +5 -5
- package/dist/transactions/types/transaction.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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
|
-
|
|
130
|
+
referenceId: raffleId,
|
|
131
131
|
meta: { game }
|
|
132
132
|
}
|
|
133
133
|
], { session });
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./transaction"), exports);
|
|
18
18
|
__exportStar(require("./gameRecordFields"), exports);
|
|
19
|
+
__exportStar(require("./staffAudit"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const STAFF_ADMIN_ACTIONS: {
|
|
2
|
+
readonly VIP_BUY: "admin-buy";
|
|
3
|
+
readonly VIP_EXTEND: "admin-extend";
|
|
4
|
+
readonly VIP_ADD_MEMBER: "admin-add-member";
|
|
5
|
+
readonly VIP_REMOVE: "admin-remove";
|
|
6
|
+
readonly RAFFLE_CANCEL: "raffle-cancel";
|
|
7
|
+
readonly PREDICTION_END: "prediction-end";
|
|
8
|
+
readonly PREDICTION_PAYOUT: "prediction-payout";
|
|
9
|
+
readonly PREDICTION_CANCEL: "prediction-cancel";
|
|
10
|
+
readonly ATM_REJECT: "atm-reject";
|
|
11
|
+
};
|
|
12
|
+
export type StaffAdminAction = (typeof STAFF_ADMIN_ACTIONS)[keyof typeof STAFF_ADMIN_ACTIONS];
|
|
13
|
+
export declare const STAFF_ACTION_CATEGORIES: readonly ["balance", "atm", "vip", "raffle", "prediction"];
|
|
14
|
+
export type StaffActionCategory = (typeof STAFF_ACTION_CATEGORIES)[number];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STAFF_ACTION_CATEGORIES = exports.STAFF_ADMIN_ACTIONS = void 0;
|
|
4
|
+
exports.STAFF_ADMIN_ACTIONS = {
|
|
5
|
+
VIP_BUY: 'admin-buy',
|
|
6
|
+
VIP_EXTEND: 'admin-extend',
|
|
7
|
+
VIP_ADD_MEMBER: 'admin-add-member',
|
|
8
|
+
VIP_REMOVE: 'admin-remove',
|
|
9
|
+
RAFFLE_CANCEL: 'raffle-cancel',
|
|
10
|
+
PREDICTION_END: 'prediction-end',
|
|
11
|
+
PREDICTION_PAYOUT: 'prediction-payout',
|
|
12
|
+
PREDICTION_CANCEL: 'prediction-cancel',
|
|
13
|
+
ATM_REJECT: 'atm-reject'
|
|
14
|
+
};
|
|
15
|
+
exports.STAFF_ACTION_CATEGORIES = [
|
|
16
|
+
'balance',
|
|
17
|
+
'atm',
|
|
18
|
+
'vip',
|
|
19
|
+
'raffle',
|
|
20
|
+
'prediction'
|
|
21
|
+
];
|
|
@@ -63,7 +63,7 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
|
|
|
63
63
|
}, "id"> & {
|
|
64
64
|
id: string;
|
|
65
65
|
}> | undefined;
|
|
66
|
-
|
|
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
|
-
|
|
20
|
+
referenceId: { type: String, default: null },
|
|
21
21
|
handledBy: { type: String, default: null }
|
|
22
22
|
}, { timestamps: { createdAt: true, updatedAt: false } });
|
|
23
|
-
exports.TransactionSchema.index({
|
|
23
|
+
exports.TransactionSchema.index({ referenceId: 1, type: 1 }, {
|
|
24
24
|
unique: true,
|
|
25
25
|
partialFilterExpression: {
|
|
26
|
-
|
|
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
|
-
//
|
|
40
|
-
exports.TransactionSchema.index({ guildId: 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
|
-
|
|
12
|
+
referenceId?: string;
|
|
13
13
|
handledBy?: string;
|
|
14
14
|
createdAt: Date;
|
|
15
15
|
};
|