jp.db.schemas 2.2.12 → 2.2.13
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/index.d.ts +4 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -11
- package/dist/index.js.map +1 -1
- package/dist/models/experiences-level-edge.enum.d.ts +5 -0
- package/dist/models/experiences-level-edge.enum.d.ts.map +1 -0
- package/dist/models/experiences-level-edge.enum.js +9 -0
- package/dist/models/experiences-level-edge.enum.js.map +1 -0
- package/dist/models/experiences-level-rank.enum.d.ts +6 -0
- package/dist/models/experiences-level-rank.enum.d.ts.map +1 -0
- package/dist/models/experiences-level-rank.enum.js +10 -0
- package/dist/models/experiences-level-rank.enum.js.map +1 -0
- package/dist/models/rating-add-bulk-item.interface.d.ts +1 -1
- package/dist/models/rating-add-bulk-item.interface.d.ts.map +1 -1
- package/dist/models/rating-monthly-result.interface.d.ts +2 -1
- package/dist/models/rating-monthly-result.interface.d.ts.map +1 -1
- package/dist/repositories/achievement.repository.d.ts +1 -1
- package/dist/repositories/achievement.repository.d.ts.map +1 -1
- package/dist/repositories/achievement.repository.js +7 -2
- package/dist/repositories/achievement.repository.js.map +1 -1
- package/dist/repositories/activity-log.repository.d.ts +6 -6
- package/dist/repositories/activity-log.repository.d.ts.map +1 -1
- package/dist/repositories/activity-log.repository.js +13 -13
- package/dist/repositories/activity-log.repository.js.map +1 -1
- package/dist/repositories/banners.repository.d.ts +1 -1
- package/dist/repositories/banners.repository.d.ts.map +1 -1
- package/dist/repositories/banners.repository.js +9 -2
- package/dist/repositories/banners.repository.js.map +1 -1
- package/dist/repositories/daily-bonus.repository.d.ts +1 -1
- package/dist/repositories/daily-bonus.repository.d.ts.map +1 -1
- package/dist/repositories/daily-bonus.repository.js +3 -2
- package/dist/repositories/daily-bonus.repository.js.map +1 -1
- package/dist/repositories/friend.repository.d.ts +1 -1
- package/dist/repositories/friend.repository.d.ts.map +1 -1
- package/dist/repositories/friend.repository.js +2 -7
- package/dist/repositories/friend.repository.js.map +1 -1
- package/dist/repositories/game-statistic.repository.d.ts +1 -1
- package/dist/repositories/game-statistic.repository.d.ts.map +1 -1
- package/dist/repositories/game-statistic.repository.js +2 -2
- package/dist/repositories/game-statistic.repository.js.map +1 -1
- package/dist/repositories/index.d.ts +1 -3
- package/dist/repositories/index.d.ts.map +1 -1
- package/dist/repositories/index.js +1 -5
- package/dist/repositories/index.js.map +1 -1
- package/dist/repositories/menu.repository.d.ts +1 -1
- package/dist/repositories/menu.repository.d.ts.map +1 -1
- package/dist/repositories/menu.repository.js +3 -2
- package/dist/repositories/menu.repository.js.map +1 -1
- package/dist/repositories/premium.repository.d.ts +1 -1
- package/dist/repositories/premium.repository.d.ts.map +1 -1
- package/dist/repositories/premium.repository.js +8 -2
- package/dist/repositories/premium.repository.js.map +1 -1
- package/dist/repositories/products.repository.d.ts +1 -1
- package/dist/repositories/products.repository.d.ts.map +1 -1
- package/dist/repositories/products.repository.js +3 -2
- package/dist/repositories/products.repository.js.map +1 -1
- package/dist/repositories/rating.repository.d.ts +0 -1
- package/dist/repositories/rating.repository.d.ts.map +1 -1
- package/dist/repositories/rating.repository.js +3 -10
- package/dist/repositories/rating.repository.js.map +1 -1
- package/dist/repositories/rule.repository.d.ts +1 -1
- package/dist/repositories/rule.repository.d.ts.map +1 -1
- package/dist/repositories/rule.repository.js +8 -2
- package/dist/repositories/rule.repository.js.map +1 -1
- package/dist/repositories/setting.repository.d.ts +1 -1
- package/dist/repositories/setting.repository.d.ts.map +1 -1
- package/dist/repositories/setting.repository.js +3 -2
- package/dist/repositories/setting.repository.js.map +1 -1
- package/dist/repositories/welcome.repository.d.ts +1 -1
- package/dist/repositories/welcome.repository.d.ts.map +1 -1
- package/dist/repositories/welcome.repository.js +8 -2
- package/dist/repositories/welcome.repository.js.map +1 -1
- package/dist/schemas/achievement.schema.d.ts +4 -24
- package/dist/schemas/achievement.schema.d.ts.map +1 -1
- package/dist/schemas/achievement.schema.js +4 -12
- package/dist/schemas/achievement.schema.js.map +1 -1
- package/dist/schemas/activity_log.schema.d.ts +2 -2
- package/dist/schemas/activity_log.schema.d.ts.map +1 -1
- package/dist/schemas/activity_log.schema.js +1 -1
- package/dist/schemas/activity_log.schema.js.map +1 -1
- package/dist/schemas/banner.schema.d.ts +4 -14
- package/dist/schemas/banner.schema.d.ts.map +1 -1
- package/dist/schemas/banner.schema.js +4 -8
- package/dist/schemas/banner.schema.js.map +1 -1
- package/dist/schemas/daily_bonus.schema.d.ts +67 -19
- package/dist/schemas/daily_bonus.schema.d.ts.map +1 -1
- package/dist/schemas/daily_bonus.schema.js +0 -4
- package/dist/schemas/daily_bonus.schema.js.map +1 -1
- package/dist/schemas/feature.schema.d.ts +2 -2
- package/dist/schemas/feature.schema.d.ts.map +1 -1
- package/dist/schemas/feature.schema.js +1 -1
- package/dist/schemas/feature.schema.js.map +1 -1
- package/dist/schemas/friend.schema.d.ts +67 -19
- package/dist/schemas/friend.schema.d.ts.map +1 -1
- package/dist/schemas/friend.schema.js +0 -4
- package/dist/schemas/friend.schema.js.map +1 -1
- package/dist/schemas/game_statistic.schema.d.ts +2 -22
- package/dist/schemas/game_statistic.schema.d.ts.map +1 -1
- package/dist/schemas/game_statistic.schema.js +2 -10
- package/dist/schemas/game_statistic.schema.js.map +1 -1
- package/dist/schemas/notification.schema.d.ts +2 -2
- package/dist/schemas/notification.schema.d.ts.map +1 -1
- package/dist/schemas/notification.schema.js +1 -1
- package/dist/schemas/notification.schema.js.map +1 -1
- package/dist/schemas/premium.schema.d.ts +47 -15
- package/dist/schemas/premium.schema.d.ts.map +1 -1
- package/dist/schemas/premium.schema.js +0 -4
- package/dist/schemas/premium.schema.js.map +1 -1
- package/dist/schemas/product.schema.d.ts +2 -2
- package/dist/schemas/product.schema.d.ts.map +1 -1
- package/dist/schemas/product.schema.js +1 -1
- package/dist/schemas/product.schema.js.map +1 -1
- package/dist/schemas/rating.schema.d.ts +2 -2
- package/dist/schemas/rating.schema.d.ts.map +1 -1
- package/dist/schemas/rating.schema.js +1 -1
- package/dist/schemas/rating.schema.js.map +1 -1
- package/dist/schemas/rule.schema.d.ts +47 -15
- package/dist/schemas/rule.schema.d.ts.map +1 -1
- package/dist/schemas/rule.schema.js +0 -4
- package/dist/schemas/rule.schema.js.map +1 -1
- package/dist/schemas/user.schema.d.ts +20 -0
- package/dist/schemas/user.schema.d.ts.map +1 -1
- package/dist/schemas/user.schema.js +27 -0
- package/dist/schemas/user.schema.js.map +1 -1
- package/dist/schemas/welcome.schema.d.ts +53 -11
- package/dist/schemas/welcome.schema.d.ts.map +1 -1
- package/dist/schemas/welcome.schema.js +3 -3
- package/dist/schemas/welcome.schema.js.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -17
- package/src/models/experiences-level-edge.enum.ts +4 -0
- package/src/models/experiences-level-rank.enum.ts +5 -0
- package/src/models/rating-add-bulk-item.interface.ts +1 -1
- package/src/models/rating-monthly-result.interface.ts +2 -1
- package/src/repositories/achievement.repository.ts +7 -2
- package/src/repositories/activity-log.repository.ts +13 -13
- package/src/repositories/banners.repository.ts +9 -2
- package/src/repositories/daily-bonus.repository.ts +4 -3
- package/src/repositories/friend.repository.ts +2 -10
- package/src/repositories/game-statistic.repository.ts +3 -6
- package/src/repositories/index.ts +0 -4
- package/src/repositories/menu.repository.ts +4 -3
- package/src/repositories/premium.repository.ts +8 -2
- package/src/repositories/products.repository.ts +4 -2
- package/src/repositories/rating.repository.ts +3 -14
- package/src/repositories/rule.repository.ts +8 -2
- package/src/repositories/setting.repository.ts +4 -3
- package/src/repositories/welcome.repository.ts +8 -2
- package/src/schemas/achievement.schema.ts +4 -10
- package/src/schemas/activity_log.schema.ts +1 -1
- package/src/schemas/banner.schema.ts +3 -6
- package/src/schemas/daily_bonus.schema.ts +0 -3
- package/src/schemas/feature.schema.ts +1 -1
- package/src/schemas/friend.schema.ts +0 -3
- package/src/schemas/game_statistic.schema.ts +2 -8
- package/src/schemas/notification.schema.ts +1 -1
- package/src/schemas/premium.schema.ts +0 -3
- package/src/schemas/product.schema.ts +1 -1
- package/src/schemas/rating.schema.ts +1 -1
- package/src/schemas/rule.schema.ts +0 -3
- package/src/schemas/user.schema.ts +27 -0
- package/src/schemas/welcome.schema.ts +2 -2
- package/src/utils.ts +4 -0
- package/dist/repositories/rooms.repository.d.ts +0 -8
- package/dist/repositories/rooms.repository.d.ts.map +0 -1
- package/dist/repositories/rooms.repository.js +0 -34
- package/dist/repositories/rooms.repository.js.map +0 -1
- package/dist/repositories/scheduled-tournaments.repository.d.ts +0 -11
- package/dist/repositories/scheduled-tournaments.repository.d.ts.map +0 -1
- package/dist/repositories/scheduled-tournaments.repository.js +0 -44
- package/dist/repositories/scheduled-tournaments.repository.js.map +0 -1
- package/dist/schemas/rooms.schema.d.ts +0 -179
- package/dist/schemas/rooms.schema.d.ts.map +0 -1
- package/dist/schemas/rooms.schema.js +0 -85
- package/dist/schemas/rooms.schema.js.map +0 -1
- package/dist/schemas/scheduled_tournament.schema.d.ts +0 -257
- package/dist/schemas/scheduled_tournament.schema.d.ts.map +0 -1
- package/dist/schemas/scheduled_tournament.schema.js +0 -113
- package/dist/schemas/scheduled_tournament.schema.js.map +0 -1
- package/src/repositories/rooms.repository.ts +0 -14
- package/src/repositories/scheduled-tournaments.repository.ts +0 -35
- package/src/schemas/rooms.schema.ts +0 -63
- package/src/schemas/scheduled_tournament.schema.ts +0 -94
package/dist/utils.d.ts
CHANGED
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,UAErD"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,UAErD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,UAE/C"}
|
package/dist/utils.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getChannelRegExpFilter = getChannelRegExpFilter;
|
|
4
|
+
exports.getGameRegExpFilter = getGameRegExpFilter;
|
|
4
5
|
function getChannelRegExpFilter(channel) {
|
|
5
6
|
return new RegExp(`ALL|${channel}`, 'i');
|
|
6
7
|
}
|
|
8
|
+
function getGameRegExpFilter(game) {
|
|
9
|
+
return new RegExp(`ALL|${game}`, 'i');
|
|
10
|
+
}
|
|
7
11
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAAA,wDAEC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAAA,wDAEC;AAED,kDAEC;AAND,SAAgB,sBAAsB,CAAC,OAAe;IACpD,OAAO,IAAI,MAAM,CAAC,OAAO,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI,MAAM,CAAC,OAAO,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;AACxC,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -21,15 +21,8 @@ import {
|
|
|
21
21
|
NotificationSchema,
|
|
22
22
|
} from './schemas/notification.schema';
|
|
23
23
|
import type { NotificationDocument } from './schemas/notification.schema';
|
|
24
|
-
import {
|
|
25
|
-
ScheduledTournament,
|
|
26
|
-
ScheduledTournamentSchema,
|
|
27
|
-
} from './schemas/scheduled_tournament.schema';
|
|
28
|
-
import type { ScheduledTournamentDocument } from './schemas/scheduled_tournament.schema';
|
|
29
24
|
import { Admin, AdminSchema } from './schemas/admin.schema';
|
|
30
25
|
import type { AdminDocument } from './schemas/admin.schema';
|
|
31
|
-
import { Room, RoomSchema } from './schemas/rooms.schema';
|
|
32
|
-
import type { RoomDocument } from './schemas/rooms.schema';
|
|
33
26
|
import { Article, ArticleSchema } from './schemas/article.schema';
|
|
34
27
|
import type { ArticleDocument } from './schemas/article.schema';
|
|
35
28
|
import { Banner, BannerSchema } from './schemas/banner.schema';
|
|
@@ -114,7 +107,6 @@ import {
|
|
|
114
107
|
ComplainsRepository,
|
|
115
108
|
NotificationRepository,
|
|
116
109
|
ProductsRepository,
|
|
117
|
-
ScheduledTournamentsRepository,
|
|
118
110
|
ServersRepository,
|
|
119
111
|
UsersRepository,
|
|
120
112
|
MenuRepository,
|
|
@@ -126,7 +118,6 @@ import {
|
|
|
126
118
|
RuleRepository,
|
|
127
119
|
DailyBonusRepository,
|
|
128
120
|
SettingRepository,
|
|
129
|
-
RoomsRepository,
|
|
130
121
|
GameResultRepository,
|
|
131
122
|
SimpleRoomsRepository,
|
|
132
123
|
OneTableTournamentRoomsRepository,
|
|
@@ -150,9 +141,7 @@ export type {
|
|
|
150
141
|
PurchaseDocument,
|
|
151
142
|
ComplainDocument,
|
|
152
143
|
NotificationDocument,
|
|
153
|
-
ScheduledTournamentDocument,
|
|
154
144
|
AdminDocument,
|
|
155
|
-
RoomDocument,
|
|
156
145
|
ArticleDocument,
|
|
157
146
|
BannerDocument,
|
|
158
147
|
ServerDocument,
|
|
@@ -201,12 +190,8 @@ export {
|
|
|
201
190
|
ComplainSchema,
|
|
202
191
|
Notification,
|
|
203
192
|
NotificationSchema,
|
|
204
|
-
ScheduledTournament,
|
|
205
|
-
ScheduledTournamentSchema,
|
|
206
193
|
Admin,
|
|
207
194
|
AdminSchema,
|
|
208
|
-
Room,
|
|
209
|
-
RoomSchema,
|
|
210
195
|
Article,
|
|
211
196
|
ArticleSchema,
|
|
212
197
|
Banner,
|
|
@@ -268,7 +253,6 @@ export {
|
|
|
268
253
|
ComplainsRepository,
|
|
269
254
|
NotificationRepository,
|
|
270
255
|
ProductsRepository,
|
|
271
|
-
ScheduledTournamentsRepository,
|
|
272
256
|
ServersRepository,
|
|
273
257
|
UsersRepository,
|
|
274
258
|
MenuRepository,
|
|
@@ -280,7 +264,6 @@ export {
|
|
|
280
264
|
FriendRepository,
|
|
281
265
|
WelcomeRepository,
|
|
282
266
|
SettingRepository,
|
|
283
|
-
RoomsRepository,
|
|
284
267
|
GameResultRepository,
|
|
285
268
|
SimpleRoomsRepository,
|
|
286
269
|
OneTableTournamentRoomsRepository,
|
|
@@ -3,6 +3,7 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { Achievement, AchievementDocument } from '..';
|
|
6
|
+
import { getGameRegExpFilter } from '../utils';
|
|
6
7
|
|
|
7
8
|
@Injectable()
|
|
8
9
|
export class AchievementRepository {
|
|
@@ -11,7 +12,11 @@ export class AchievementRepository {
|
|
|
11
12
|
private menuModel: Model<AchievementDocument>,
|
|
12
13
|
) {}
|
|
13
14
|
|
|
14
|
-
async findAchievements(): Promise<Array<Achievement>> {
|
|
15
|
-
return this.menuModel
|
|
15
|
+
async findAchievements(game: string): Promise<Array<Achievement>> {
|
|
16
|
+
return this.menuModel
|
|
17
|
+
.find({
|
|
18
|
+
game: getGameRegExpFilter(game),
|
|
19
|
+
})
|
|
20
|
+
.exec();
|
|
16
21
|
}
|
|
17
22
|
}
|
|
@@ -36,7 +36,7 @@ export class ActivityLogRepository {
|
|
|
36
36
|
userName: { $first: '$userName' },
|
|
37
37
|
event: { $first: '$event' },
|
|
38
38
|
game: { $first: '$game' },
|
|
39
|
-
|
|
39
|
+
channel: { $first: '$channel' },
|
|
40
40
|
count: { $sum: 1 },
|
|
41
41
|
},
|
|
42
42
|
},
|
|
@@ -113,14 +113,14 @@ export class ActivityLogRepository {
|
|
|
113
113
|
userId: string,
|
|
114
114
|
userName: string,
|
|
115
115
|
game: string,
|
|
116
|
-
|
|
116
|
+
channel: string,
|
|
117
117
|
): Promise<ActivityLog> {
|
|
118
118
|
return this.addActivityLog({
|
|
119
119
|
event: ActivityLogEnum.USER_LOGIN,
|
|
120
120
|
userId,
|
|
121
121
|
userName,
|
|
122
122
|
game,
|
|
123
|
-
|
|
123
|
+
channel,
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -128,7 +128,7 @@ export class ActivityLogRepository {
|
|
|
128
128
|
userId: string,
|
|
129
129
|
userName: string,
|
|
130
130
|
game: string,
|
|
131
|
-
|
|
131
|
+
channel: string,
|
|
132
132
|
amount: number,
|
|
133
133
|
): Promise<ActivityLog> {
|
|
134
134
|
return this.addActivityLog({
|
|
@@ -136,7 +136,7 @@ export class ActivityLogRepository {
|
|
|
136
136
|
userId,
|
|
137
137
|
userName,
|
|
138
138
|
game,
|
|
139
|
-
|
|
139
|
+
channel,
|
|
140
140
|
amount,
|
|
141
141
|
});
|
|
142
142
|
}
|
|
@@ -145,14 +145,14 @@ export class ActivityLogRepository {
|
|
|
145
145
|
userId: string,
|
|
146
146
|
userName: string,
|
|
147
147
|
game: string,
|
|
148
|
-
|
|
148
|
+
channel: string,
|
|
149
149
|
): Promise<ActivityLog> {
|
|
150
150
|
return this.addActivityLog({
|
|
151
151
|
event: ActivityLogEnum.USER_PLAYED_GAME,
|
|
152
152
|
userId,
|
|
153
153
|
userName,
|
|
154
154
|
game,
|
|
155
|
-
|
|
155
|
+
channel,
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -160,14 +160,14 @@ export class ActivityLogRepository {
|
|
|
160
160
|
userId: string,
|
|
161
161
|
userName: string,
|
|
162
162
|
game: string,
|
|
163
|
-
|
|
163
|
+
channel: string,
|
|
164
164
|
): Promise<ActivityLog> {
|
|
165
165
|
return this.addActivityLog({
|
|
166
166
|
event: ActivityLogEnum.USER_WON_GAME,
|
|
167
167
|
userId,
|
|
168
168
|
userName,
|
|
169
169
|
game,
|
|
170
|
-
|
|
170
|
+
channel,
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -175,14 +175,14 @@ export class ActivityLogRepository {
|
|
|
175
175
|
userId: string,
|
|
176
176
|
userName: string,
|
|
177
177
|
game: string,
|
|
178
|
-
|
|
178
|
+
channel: string,
|
|
179
179
|
): Promise<ActivityLog> {
|
|
180
180
|
return this.addActivityLog({
|
|
181
181
|
event: ActivityLogEnum.USER_WON_PROFI,
|
|
182
182
|
userId,
|
|
183
183
|
userName,
|
|
184
184
|
game,
|
|
185
|
-
|
|
185
|
+
channel,
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
|
|
@@ -190,14 +190,14 @@ export class ActivityLogRepository {
|
|
|
190
190
|
userId: string,
|
|
191
191
|
userName: string,
|
|
192
192
|
game: string,
|
|
193
|
-
|
|
193
|
+
channel: string,
|
|
194
194
|
): Promise<ActivityLog> {
|
|
195
195
|
return this.addActivityLog({
|
|
196
196
|
event: ActivityLogEnum.USER_WON_ONE_TABLE_TOURNAMENT,
|
|
197
197
|
userId,
|
|
198
198
|
userName,
|
|
199
199
|
game,
|
|
200
|
-
|
|
200
|
+
channel,
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
203
|
|
|
@@ -3,6 +3,7 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { Banner, BannerDocument } from '../';
|
|
6
|
+
import { getChannelRegExpFilter, getGameRegExpFilter } from '../utils';
|
|
6
7
|
|
|
7
8
|
@Injectable()
|
|
8
9
|
export class BannersRepository {
|
|
@@ -12,9 +13,15 @@ export class BannersRepository {
|
|
|
12
13
|
|
|
13
14
|
async findEnabledBanner(
|
|
14
15
|
game: string,
|
|
15
|
-
|
|
16
|
+
channel: string,
|
|
16
17
|
): Promise<Banner | null> {
|
|
17
|
-
return this.bannerModel
|
|
18
|
+
return this.bannerModel
|
|
19
|
+
.findOne({
|
|
20
|
+
game: getGameRegExpFilter(game),
|
|
21
|
+
channel: getChannelRegExpFilter(channel),
|
|
22
|
+
enabled: true,
|
|
23
|
+
})
|
|
24
|
+
.exec();
|
|
18
25
|
}
|
|
19
26
|
|
|
20
27
|
async findById(id: string): Promise<Banner | null> {
|
|
@@ -3,7 +3,7 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { DailyBonus, DailyBonusDocument } from '../';
|
|
6
|
-
import { getChannelRegExpFilter } from '../utils';
|
|
6
|
+
import { getChannelRegExpFilter, getGameRegExpFilter } from '../utils';
|
|
7
7
|
|
|
8
8
|
@Injectable()
|
|
9
9
|
export class DailyBonusRepository {
|
|
@@ -13,12 +13,13 @@ export class DailyBonusRepository {
|
|
|
13
13
|
) {}
|
|
14
14
|
|
|
15
15
|
async findDailyBonuses(
|
|
16
|
-
channel: string,
|
|
17
16
|
game: string,
|
|
17
|
+
channel: string,
|
|
18
18
|
): Promise<Array<DailyBonus> | null> {
|
|
19
19
|
return this.dailyBonusModel
|
|
20
20
|
.find({
|
|
21
|
-
|
|
21
|
+
game: getGameRegExpFilter(game),
|
|
22
|
+
channel: getChannelRegExpFilter(channel),
|
|
22
23
|
})
|
|
23
24
|
.exec();
|
|
24
25
|
}
|
|
@@ -3,7 +3,6 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { Friend, FriendDocument } from '..';
|
|
6
|
-
import { getChannelRegExpFilter } from '../utils';
|
|
7
6
|
|
|
8
7
|
@Injectable()
|
|
9
8
|
export class FriendRepository {
|
|
@@ -11,14 +10,7 @@ export class FriendRepository {
|
|
|
11
10
|
@InjectModel(Friend.name) private friendModel: Model<FriendDocument>,
|
|
12
11
|
) {}
|
|
13
12
|
|
|
14
|
-
async
|
|
15
|
-
|
|
16
|
-
game: string,
|
|
17
|
-
): Promise<Array<Friend> | null> {
|
|
18
|
-
return this.friendModel
|
|
19
|
-
.find({
|
|
20
|
-
channels: getChannelRegExpFilter(channel),
|
|
21
|
-
})
|
|
22
|
-
.exec();
|
|
13
|
+
async findFriends(game: string): Promise<Array<Friend> | null> {
|
|
14
|
+
return this.friendModel.find().exec();
|
|
23
15
|
}
|
|
24
16
|
}
|
|
@@ -3,7 +3,7 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { GameStatistic, GameStatisticDocument } from '..';
|
|
6
|
-
import {
|
|
6
|
+
import { getGameRegExpFilter } from '../utils';
|
|
7
7
|
|
|
8
8
|
@Injectable()
|
|
9
9
|
export class GameStatisticRepository {
|
|
@@ -12,13 +12,10 @@ export class GameStatisticRepository {
|
|
|
12
12
|
private gameStatisticModel: Model<GameStatisticDocument>,
|
|
13
13
|
) {}
|
|
14
14
|
|
|
15
|
-
async findGameStatistic(
|
|
16
|
-
channel: string,
|
|
17
|
-
game: string,
|
|
18
|
-
): Promise<Array<GameStatistic> | null> {
|
|
15
|
+
async findGameStatistic(game: string): Promise<Array<GameStatistic> | null> {
|
|
19
16
|
return this.gameStatisticModel
|
|
20
17
|
.find({
|
|
21
|
-
|
|
18
|
+
game: getGameRegExpFilter(game),
|
|
22
19
|
})
|
|
23
20
|
.exec();
|
|
24
21
|
}
|
|
@@ -4,7 +4,6 @@ import { BannersRepository } from './banners.repository';
|
|
|
4
4
|
import { ComplainsRepository } from './complains.repository';
|
|
5
5
|
import { NotificationRepository } from './notification.repository';
|
|
6
6
|
import { ProductsRepository } from './products.repository';
|
|
7
|
-
import { ScheduledTournamentsRepository } from './scheduled-tournaments.repository';
|
|
8
7
|
import { ServersRepository } from './servers.repository';
|
|
9
8
|
import { UsersRepository } from './users.repository';
|
|
10
9
|
import { MenuRepository } from './menu.repository';
|
|
@@ -16,7 +15,6 @@ import { SettingRepository } from './setting.repository';
|
|
|
16
15
|
import { PremiumRepository } from './premium.repository';
|
|
17
16
|
import { WelcomeRepository } from './welcome.repository';
|
|
18
17
|
import { DailyBonusRepository } from './daily-bonus.repository';
|
|
19
|
-
import { RoomsRepository } from './rooms.repository';
|
|
20
18
|
import { GameResultRepository } from './game-result.repository';
|
|
21
19
|
import { SimpleRoomsRepository } from './simple-rooms.repository';
|
|
22
20
|
import { OneTableTournamentRoomsRepository } from './one-table-tournament-rooms.repository';
|
|
@@ -35,7 +33,6 @@ export {
|
|
|
35
33
|
ComplainsRepository,
|
|
36
34
|
NotificationRepository,
|
|
37
35
|
ProductsRepository,
|
|
38
|
-
ScheduledTournamentsRepository,
|
|
39
36
|
ServersRepository,
|
|
40
37
|
UsersRepository,
|
|
41
38
|
MenuRepository,
|
|
@@ -47,7 +44,6 @@ export {
|
|
|
47
44
|
PremiumRepository,
|
|
48
45
|
WelcomeRepository,
|
|
49
46
|
DailyBonusRepository,
|
|
50
|
-
RoomsRepository,
|
|
51
47
|
GameResultRepository,
|
|
52
48
|
SimpleRoomsRepository,
|
|
53
49
|
OneTableTournamentRoomsRepository,
|
|
@@ -3,16 +3,17 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { Menu, MenuDocument } from '../';
|
|
6
|
-
import { getChannelRegExpFilter } from '../utils';
|
|
6
|
+
import { getGameRegExpFilter, getChannelRegExpFilter } from '../utils';
|
|
7
7
|
|
|
8
8
|
@Injectable()
|
|
9
9
|
export class MenuRepository {
|
|
10
10
|
constructor(@InjectModel(Menu.name) private menuModel: Model<MenuDocument>) {}
|
|
11
11
|
|
|
12
|
-
async findMenus(
|
|
12
|
+
async findMenus(game: string, channel: string): Promise<Array<Menu> | null> {
|
|
13
13
|
return this.menuModel
|
|
14
14
|
.find({
|
|
15
|
-
|
|
15
|
+
game: getGameRegExpFilter(game),
|
|
16
|
+
channel: getChannelRegExpFilter(channel),
|
|
16
17
|
})
|
|
17
18
|
.exec();
|
|
18
19
|
}
|
|
@@ -3,6 +3,7 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { Premium, PremiumDocument } from '..';
|
|
6
|
+
import { getGameRegExpFilter, getChannelRegExpFilter } from '../utils';
|
|
6
7
|
|
|
7
8
|
@Injectable()
|
|
8
9
|
export class PremiumRepository {
|
|
@@ -10,7 +11,12 @@ export class PremiumRepository {
|
|
|
10
11
|
@InjectModel(Premium.name) private premiumModel: Model<PremiumDocument>,
|
|
11
12
|
) {}
|
|
12
13
|
|
|
13
|
-
async findPremium(
|
|
14
|
-
return this.premiumModel
|
|
14
|
+
async findPremium(game: string, channel: string): Promise<Premium | null> {
|
|
15
|
+
return this.premiumModel
|
|
16
|
+
.findOne({
|
|
17
|
+
game: getGameRegExpFilter(game),
|
|
18
|
+
channel: getChannelRegExpFilter(channel),
|
|
19
|
+
})
|
|
20
|
+
.exec();
|
|
15
21
|
}
|
|
16
22
|
}
|
|
@@ -3,7 +3,7 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { Product, ProductDocument } from '../';
|
|
6
|
-
import { getChannelRegExpFilter } from '../utils';
|
|
6
|
+
import { getChannelRegExpFilter, getGameRegExpFilter } from '../utils';
|
|
7
7
|
|
|
8
8
|
@Injectable()
|
|
9
9
|
export class ProductsRepository {
|
|
@@ -17,13 +17,15 @@ export class ProductsRepository {
|
|
|
17
17
|
|
|
18
18
|
async findProducts(
|
|
19
19
|
parentId: string | null,
|
|
20
|
+
game: string,
|
|
20
21
|
channel: string,
|
|
21
22
|
): Promise<Array<Product> | null> {
|
|
22
23
|
return this.productModel
|
|
23
24
|
.find({
|
|
24
25
|
parentId,
|
|
25
26
|
active: true,
|
|
26
|
-
|
|
27
|
+
game: getGameRegExpFilter(game),
|
|
28
|
+
channel: getChannelRegExpFilter(channel),
|
|
27
29
|
})
|
|
28
30
|
.exec();
|
|
29
31
|
}
|
|
@@ -3,7 +3,6 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { Rating, RatingDocument } from '..';
|
|
6
|
-
import { getChannelRegExpFilter } from '../utils';
|
|
7
6
|
import { IRatingMonthlyResult } from '../models/rating-monthly-result.interface';
|
|
8
7
|
|
|
9
8
|
@Injectable()
|
|
@@ -12,17 +11,6 @@ export class RatingRepository {
|
|
|
12
11
|
@InjectModel(Rating.name) private ratingModel: Model<RatingDocument>,
|
|
13
12
|
) {}
|
|
14
13
|
|
|
15
|
-
async findRating(
|
|
16
|
-
channel: string,
|
|
17
|
-
game: string,
|
|
18
|
-
): Promise<Array<Rating> | null> {
|
|
19
|
-
return this.ratingModel
|
|
20
|
-
.find({
|
|
21
|
-
channels: getChannelRegExpFilter(channel),
|
|
22
|
-
})
|
|
23
|
-
.exec();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
14
|
async addBulkPlayerRating(items: Array<Rating>): Promise<void> {
|
|
27
15
|
await this.ratingModel.insertMany(items);
|
|
28
16
|
}
|
|
@@ -57,7 +45,7 @@ export class RatingRepository {
|
|
|
57
45
|
userName: { $first: '$userName' },
|
|
58
46
|
userAvatarUrl: { $first: '$userAvatarUrl' },
|
|
59
47
|
game: { $first: '$game' },
|
|
60
|
-
|
|
48
|
+
channel: { $first: '$channel' },
|
|
61
49
|
count: { $sum: 1 },
|
|
62
50
|
profit: { $sum: '$profit' },
|
|
63
51
|
},
|
|
@@ -79,10 +67,11 @@ export class RatingRepository {
|
|
|
79
67
|
userName: 1,
|
|
80
68
|
userAvatarUrl: 1,
|
|
81
69
|
game: 1,
|
|
82
|
-
|
|
70
|
+
channel: 1,
|
|
83
71
|
count: 1,
|
|
84
72
|
date: '$_id.date',
|
|
85
73
|
rank: 1,
|
|
74
|
+
profit: 1,
|
|
86
75
|
},
|
|
87
76
|
},
|
|
88
77
|
]);
|
|
@@ -3,12 +3,18 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { Rule, RuleDocument } from '..';
|
|
6
|
+
import { getGameRegExpFilter, getChannelRegExpFilter } from '../utils';
|
|
6
7
|
|
|
7
8
|
@Injectable()
|
|
8
9
|
export class RuleRepository {
|
|
9
10
|
constructor(@InjectModel(Rule.name) private ruleModel: Model<RuleDocument>) {}
|
|
10
11
|
|
|
11
|
-
async findRule(
|
|
12
|
-
return this.ruleModel
|
|
12
|
+
async findRule(game: string, channel: string): Promise<Rule | null> {
|
|
13
|
+
return this.ruleModel
|
|
14
|
+
.findOne({
|
|
15
|
+
game: getGameRegExpFilter(game),
|
|
16
|
+
channel: getChannelRegExpFilter(channel),
|
|
17
|
+
})
|
|
18
|
+
.exec();
|
|
13
19
|
}
|
|
14
20
|
}
|
|
@@ -3,7 +3,7 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { Setting, SettingDocument } from '..';
|
|
6
|
-
import { getChannelRegExpFilter } from '../utils';
|
|
6
|
+
import { getChannelRegExpFilter, getGameRegExpFilter } from '../utils';
|
|
7
7
|
|
|
8
8
|
@Injectable()
|
|
9
9
|
export class SettingRepository {
|
|
@@ -12,12 +12,13 @@ export class SettingRepository {
|
|
|
12
12
|
) {}
|
|
13
13
|
|
|
14
14
|
async findSettings(
|
|
15
|
-
channel: string,
|
|
16
15
|
game: string,
|
|
16
|
+
channel: string,
|
|
17
17
|
): Promise<Array<Setting> | null> {
|
|
18
18
|
return this.settingModel
|
|
19
19
|
.find({
|
|
20
|
-
|
|
20
|
+
game: getGameRegExpFilter(game),
|
|
21
|
+
channel: getChannelRegExpFilter(channel),
|
|
21
22
|
})
|
|
22
23
|
.exec();
|
|
23
24
|
}
|
|
@@ -3,6 +3,7 @@ import { InjectModel } from '@nestjs/mongoose';
|
|
|
3
3
|
import { Model } from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { Welcome, WelcomeDocument } from '..';
|
|
6
|
+
import { getGameRegExpFilter, getChannelRegExpFilter } from '../utils';
|
|
6
7
|
|
|
7
8
|
@Injectable()
|
|
8
9
|
export class WelcomeRepository {
|
|
@@ -10,7 +11,12 @@ export class WelcomeRepository {
|
|
|
10
11
|
@InjectModel(Welcome.name) private welcomeModel: Model<WelcomeDocument>,
|
|
11
12
|
) {}
|
|
12
13
|
|
|
13
|
-
async findWelcome(game: string): Promise<Welcome | null> {
|
|
14
|
-
return this.welcomeModel
|
|
14
|
+
async findWelcome(game: string, channel: string): Promise<Welcome | null> {
|
|
15
|
+
return this.welcomeModel
|
|
16
|
+
.findOne({
|
|
17
|
+
game: getGameRegExpFilter(game),
|
|
18
|
+
channel: getChannelRegExpFilter(channel),
|
|
19
|
+
})
|
|
20
|
+
.exec();
|
|
15
21
|
}
|
|
16
22
|
}
|
|
@@ -12,17 +12,11 @@ export class Achievement {
|
|
|
12
12
|
})
|
|
13
13
|
readonly achievementId: string;
|
|
14
14
|
|
|
15
|
-
@Prop()
|
|
16
|
-
title: string
|
|
17
|
-
|
|
18
|
-
@Prop()
|
|
19
|
-
titleEn: string;
|
|
15
|
+
@Prop({ type: Object })
|
|
16
|
+
title: Record<string, string>;
|
|
20
17
|
|
|
21
|
-
@Prop()
|
|
22
|
-
description: string
|
|
23
|
-
|
|
24
|
-
@Prop()
|
|
25
|
-
descriptionEn: string;
|
|
18
|
+
@Prop({ type: Object })
|
|
19
|
+
description: Record<string, string>;
|
|
26
20
|
|
|
27
21
|
@Prop()
|
|
28
22
|
code: string;
|
|
@@ -12,11 +12,8 @@ export class Banner {
|
|
|
12
12
|
})
|
|
13
13
|
readonly bannerId: string;
|
|
14
14
|
|
|
15
|
-
@Prop()
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@Prop()
|
|
19
|
-
titleEn: string;
|
|
15
|
+
@Prop({ type: Object })
|
|
16
|
+
title: Record<string, string>;
|
|
20
17
|
|
|
21
18
|
@Prop()
|
|
22
19
|
image: string;
|
|
@@ -34,7 +31,7 @@ export class Banner {
|
|
|
34
31
|
game: string;
|
|
35
32
|
|
|
36
33
|
@Prop()
|
|
37
|
-
|
|
34
|
+
channel: string;
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
export const BannerSchema = SchemaFactory.createForClass(Banner);
|