crazy-odds-bet-shared 1.0.13 → 1.0.14
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/models/index.js +2 -1
- package/models/oddDebug.js +16 -2
- package/package.json +1 -1
package/models/index.js
CHANGED
|
@@ -8,7 +8,7 @@ const { User } = require('./user');
|
|
|
8
8
|
const { MarketTemplate } = require('./marketTemplate');
|
|
9
9
|
const { Market } = require('./market');
|
|
10
10
|
const { Odd } = require('./odd');
|
|
11
|
-
const { OddDebug, OddDebugType } = require('./oddDebug');
|
|
11
|
+
const { OddDebug, OddDebugType, oddDebugStatus } = require('./oddDebug');
|
|
12
12
|
const { BetTracker } = require('./betTracker');
|
|
13
13
|
const { generateSlug } = require('./base');
|
|
14
14
|
|
|
@@ -26,6 +26,7 @@ module.exports = {
|
|
|
26
26
|
Odd,
|
|
27
27
|
OddDebug,
|
|
28
28
|
OddDebugType,
|
|
29
|
+
oddDebugStatus,
|
|
29
30
|
BetTracker,
|
|
30
31
|
generateSlug
|
|
31
32
|
};
|
package/models/oddDebug.js
CHANGED
|
@@ -8,6 +8,12 @@ const OddDebugType = {
|
|
|
8
8
|
PLAYER_MATCHING: 'player_matching'
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
const oddDebugStatus = {
|
|
12
|
+
PENDING: 'pending',
|
|
13
|
+
PROCESSED: 'processed',
|
|
14
|
+
ERROR: 'error'
|
|
15
|
+
};
|
|
16
|
+
|
|
11
17
|
/**
|
|
12
18
|
* OddDebug schema - stores debugging information for odds
|
|
13
19
|
*/
|
|
@@ -23,6 +29,11 @@ const oddDebugSchema = new Schema(
|
|
|
23
29
|
enum: Object.values(OddDebugType),
|
|
24
30
|
default: OddDebugType.PLAYER_MATCHING
|
|
25
31
|
},
|
|
32
|
+
status: {
|
|
33
|
+
type: String,
|
|
34
|
+
enum: Object.values(oddDebugStatus),
|
|
35
|
+
default: oddDebugStatus.PENDING
|
|
36
|
+
},
|
|
26
37
|
debugData: { type: Schema.Types.Mixed, default: {} }
|
|
27
38
|
},
|
|
28
39
|
baseSchemaOptions
|
|
@@ -33,7 +44,10 @@ oddDebugSchema.index({ bookmakerId: 1 });
|
|
|
33
44
|
oddDebugSchema.index({ oddId: 1 });
|
|
34
45
|
oddDebugSchema.index({ fixtureId: 1 });
|
|
35
46
|
oddDebugSchema.index({ type: 1 });
|
|
36
|
-
oddDebugSchema.index({
|
|
47
|
+
oddDebugSchema.index({ status: 1 });
|
|
48
|
+
oddDebugSchema.index({ bookmakerId: 1, oddId: 1, fixtureId: 1, type: 1, status: 1 });
|
|
49
|
+
oddDebugSchema.index({ bookmakerId: 1, fixtureId: 1, type: 1, status: 1, 'debugData.key': 1 });
|
|
50
|
+
oddDebugSchema.index({ 'debugData.key': 1 });
|
|
37
51
|
|
|
38
52
|
// Static methods
|
|
39
53
|
oddDebugSchema.static('findByBookmakerAndOdd', function (bookmakerId, oddId) {
|
|
@@ -42,4 +56,4 @@ oddDebugSchema.static('findByBookmakerAndOdd', function (bookmakerId, oddId) {
|
|
|
42
56
|
|
|
43
57
|
const OddDebug = model('OddDebug', oddDebugSchema);
|
|
44
58
|
|
|
45
|
-
module.exports = { OddDebug, OddDebugType };
|
|
59
|
+
module.exports = { OddDebug, OddDebugType, oddDebugStatus };
|