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.
Files changed (187) hide show
  1. package/dist/index.d.ts +4 -8
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -11
  4. package/dist/index.js.map +1 -1
  5. package/dist/models/experiences-level-edge.enum.d.ts +5 -0
  6. package/dist/models/experiences-level-edge.enum.d.ts.map +1 -0
  7. package/dist/models/experiences-level-edge.enum.js +9 -0
  8. package/dist/models/experiences-level-edge.enum.js.map +1 -0
  9. package/dist/models/experiences-level-rank.enum.d.ts +6 -0
  10. package/dist/models/experiences-level-rank.enum.d.ts.map +1 -0
  11. package/dist/models/experiences-level-rank.enum.js +10 -0
  12. package/dist/models/experiences-level-rank.enum.js.map +1 -0
  13. package/dist/models/rating-add-bulk-item.interface.d.ts +1 -1
  14. package/dist/models/rating-add-bulk-item.interface.d.ts.map +1 -1
  15. package/dist/models/rating-monthly-result.interface.d.ts +2 -1
  16. package/dist/models/rating-monthly-result.interface.d.ts.map +1 -1
  17. package/dist/repositories/achievement.repository.d.ts +1 -1
  18. package/dist/repositories/achievement.repository.d.ts.map +1 -1
  19. package/dist/repositories/achievement.repository.js +7 -2
  20. package/dist/repositories/achievement.repository.js.map +1 -1
  21. package/dist/repositories/activity-log.repository.d.ts +6 -6
  22. package/dist/repositories/activity-log.repository.d.ts.map +1 -1
  23. package/dist/repositories/activity-log.repository.js +13 -13
  24. package/dist/repositories/activity-log.repository.js.map +1 -1
  25. package/dist/repositories/banners.repository.d.ts +1 -1
  26. package/dist/repositories/banners.repository.d.ts.map +1 -1
  27. package/dist/repositories/banners.repository.js +9 -2
  28. package/dist/repositories/banners.repository.js.map +1 -1
  29. package/dist/repositories/daily-bonus.repository.d.ts +1 -1
  30. package/dist/repositories/daily-bonus.repository.d.ts.map +1 -1
  31. package/dist/repositories/daily-bonus.repository.js +3 -2
  32. package/dist/repositories/daily-bonus.repository.js.map +1 -1
  33. package/dist/repositories/friend.repository.d.ts +1 -1
  34. package/dist/repositories/friend.repository.d.ts.map +1 -1
  35. package/dist/repositories/friend.repository.js +2 -7
  36. package/dist/repositories/friend.repository.js.map +1 -1
  37. package/dist/repositories/game-statistic.repository.d.ts +1 -1
  38. package/dist/repositories/game-statistic.repository.d.ts.map +1 -1
  39. package/dist/repositories/game-statistic.repository.js +2 -2
  40. package/dist/repositories/game-statistic.repository.js.map +1 -1
  41. package/dist/repositories/index.d.ts +1 -3
  42. package/dist/repositories/index.d.ts.map +1 -1
  43. package/dist/repositories/index.js +1 -5
  44. package/dist/repositories/index.js.map +1 -1
  45. package/dist/repositories/menu.repository.d.ts +1 -1
  46. package/dist/repositories/menu.repository.d.ts.map +1 -1
  47. package/dist/repositories/menu.repository.js +3 -2
  48. package/dist/repositories/menu.repository.js.map +1 -1
  49. package/dist/repositories/premium.repository.d.ts +1 -1
  50. package/dist/repositories/premium.repository.d.ts.map +1 -1
  51. package/dist/repositories/premium.repository.js +8 -2
  52. package/dist/repositories/premium.repository.js.map +1 -1
  53. package/dist/repositories/products.repository.d.ts +1 -1
  54. package/dist/repositories/products.repository.d.ts.map +1 -1
  55. package/dist/repositories/products.repository.js +3 -2
  56. package/dist/repositories/products.repository.js.map +1 -1
  57. package/dist/repositories/rating.repository.d.ts +0 -1
  58. package/dist/repositories/rating.repository.d.ts.map +1 -1
  59. package/dist/repositories/rating.repository.js +3 -10
  60. package/dist/repositories/rating.repository.js.map +1 -1
  61. package/dist/repositories/rule.repository.d.ts +1 -1
  62. package/dist/repositories/rule.repository.d.ts.map +1 -1
  63. package/dist/repositories/rule.repository.js +8 -2
  64. package/dist/repositories/rule.repository.js.map +1 -1
  65. package/dist/repositories/setting.repository.d.ts +1 -1
  66. package/dist/repositories/setting.repository.d.ts.map +1 -1
  67. package/dist/repositories/setting.repository.js +3 -2
  68. package/dist/repositories/setting.repository.js.map +1 -1
  69. package/dist/repositories/welcome.repository.d.ts +1 -1
  70. package/dist/repositories/welcome.repository.d.ts.map +1 -1
  71. package/dist/repositories/welcome.repository.js +8 -2
  72. package/dist/repositories/welcome.repository.js.map +1 -1
  73. package/dist/schemas/achievement.schema.d.ts +4 -24
  74. package/dist/schemas/achievement.schema.d.ts.map +1 -1
  75. package/dist/schemas/achievement.schema.js +4 -12
  76. package/dist/schemas/achievement.schema.js.map +1 -1
  77. package/dist/schemas/activity_log.schema.d.ts +2 -2
  78. package/dist/schemas/activity_log.schema.d.ts.map +1 -1
  79. package/dist/schemas/activity_log.schema.js +1 -1
  80. package/dist/schemas/activity_log.schema.js.map +1 -1
  81. package/dist/schemas/banner.schema.d.ts +4 -14
  82. package/dist/schemas/banner.schema.d.ts.map +1 -1
  83. package/dist/schemas/banner.schema.js +4 -8
  84. package/dist/schemas/banner.schema.js.map +1 -1
  85. package/dist/schemas/daily_bonus.schema.d.ts +67 -19
  86. package/dist/schemas/daily_bonus.schema.d.ts.map +1 -1
  87. package/dist/schemas/daily_bonus.schema.js +0 -4
  88. package/dist/schemas/daily_bonus.schema.js.map +1 -1
  89. package/dist/schemas/feature.schema.d.ts +2 -2
  90. package/dist/schemas/feature.schema.d.ts.map +1 -1
  91. package/dist/schemas/feature.schema.js +1 -1
  92. package/dist/schemas/feature.schema.js.map +1 -1
  93. package/dist/schemas/friend.schema.d.ts +67 -19
  94. package/dist/schemas/friend.schema.d.ts.map +1 -1
  95. package/dist/schemas/friend.schema.js +0 -4
  96. package/dist/schemas/friend.schema.js.map +1 -1
  97. package/dist/schemas/game_statistic.schema.d.ts +2 -22
  98. package/dist/schemas/game_statistic.schema.d.ts.map +1 -1
  99. package/dist/schemas/game_statistic.schema.js +2 -10
  100. package/dist/schemas/game_statistic.schema.js.map +1 -1
  101. package/dist/schemas/notification.schema.d.ts +2 -2
  102. package/dist/schemas/notification.schema.d.ts.map +1 -1
  103. package/dist/schemas/notification.schema.js +1 -1
  104. package/dist/schemas/notification.schema.js.map +1 -1
  105. package/dist/schemas/premium.schema.d.ts +47 -15
  106. package/dist/schemas/premium.schema.d.ts.map +1 -1
  107. package/dist/schemas/premium.schema.js +0 -4
  108. package/dist/schemas/premium.schema.js.map +1 -1
  109. package/dist/schemas/product.schema.d.ts +2 -2
  110. package/dist/schemas/product.schema.d.ts.map +1 -1
  111. package/dist/schemas/product.schema.js +1 -1
  112. package/dist/schemas/product.schema.js.map +1 -1
  113. package/dist/schemas/rating.schema.d.ts +2 -2
  114. package/dist/schemas/rating.schema.d.ts.map +1 -1
  115. package/dist/schemas/rating.schema.js +1 -1
  116. package/dist/schemas/rating.schema.js.map +1 -1
  117. package/dist/schemas/rule.schema.d.ts +47 -15
  118. package/dist/schemas/rule.schema.d.ts.map +1 -1
  119. package/dist/schemas/rule.schema.js +0 -4
  120. package/dist/schemas/rule.schema.js.map +1 -1
  121. package/dist/schemas/user.schema.d.ts +20 -0
  122. package/dist/schemas/user.schema.d.ts.map +1 -1
  123. package/dist/schemas/user.schema.js +27 -0
  124. package/dist/schemas/user.schema.js.map +1 -1
  125. package/dist/schemas/welcome.schema.d.ts +53 -11
  126. package/dist/schemas/welcome.schema.d.ts.map +1 -1
  127. package/dist/schemas/welcome.schema.js +3 -3
  128. package/dist/schemas/welcome.schema.js.map +1 -1
  129. package/dist/utils.d.ts +1 -0
  130. package/dist/utils.d.ts.map +1 -1
  131. package/dist/utils.js +4 -0
  132. package/dist/utils.js.map +1 -1
  133. package/package.json +1 -1
  134. package/src/index.ts +0 -17
  135. package/src/models/experiences-level-edge.enum.ts +4 -0
  136. package/src/models/experiences-level-rank.enum.ts +5 -0
  137. package/src/models/rating-add-bulk-item.interface.ts +1 -1
  138. package/src/models/rating-monthly-result.interface.ts +2 -1
  139. package/src/repositories/achievement.repository.ts +7 -2
  140. package/src/repositories/activity-log.repository.ts +13 -13
  141. package/src/repositories/banners.repository.ts +9 -2
  142. package/src/repositories/daily-bonus.repository.ts +4 -3
  143. package/src/repositories/friend.repository.ts +2 -10
  144. package/src/repositories/game-statistic.repository.ts +3 -6
  145. package/src/repositories/index.ts +0 -4
  146. package/src/repositories/menu.repository.ts +4 -3
  147. package/src/repositories/premium.repository.ts +8 -2
  148. package/src/repositories/products.repository.ts +4 -2
  149. package/src/repositories/rating.repository.ts +3 -14
  150. package/src/repositories/rule.repository.ts +8 -2
  151. package/src/repositories/setting.repository.ts +4 -3
  152. package/src/repositories/welcome.repository.ts +8 -2
  153. package/src/schemas/achievement.schema.ts +4 -10
  154. package/src/schemas/activity_log.schema.ts +1 -1
  155. package/src/schemas/banner.schema.ts +3 -6
  156. package/src/schemas/daily_bonus.schema.ts +0 -3
  157. package/src/schemas/feature.schema.ts +1 -1
  158. package/src/schemas/friend.schema.ts +0 -3
  159. package/src/schemas/game_statistic.schema.ts +2 -8
  160. package/src/schemas/notification.schema.ts +1 -1
  161. package/src/schemas/premium.schema.ts +0 -3
  162. package/src/schemas/product.schema.ts +1 -1
  163. package/src/schemas/rating.schema.ts +1 -1
  164. package/src/schemas/rule.schema.ts +0 -3
  165. package/src/schemas/user.schema.ts +27 -0
  166. package/src/schemas/welcome.schema.ts +2 -2
  167. package/src/utils.ts +4 -0
  168. package/dist/repositories/rooms.repository.d.ts +0 -8
  169. package/dist/repositories/rooms.repository.d.ts.map +0 -1
  170. package/dist/repositories/rooms.repository.js +0 -34
  171. package/dist/repositories/rooms.repository.js.map +0 -1
  172. package/dist/repositories/scheduled-tournaments.repository.d.ts +0 -11
  173. package/dist/repositories/scheduled-tournaments.repository.d.ts.map +0 -1
  174. package/dist/repositories/scheduled-tournaments.repository.js +0 -44
  175. package/dist/repositories/scheduled-tournaments.repository.js.map +0 -1
  176. package/dist/schemas/rooms.schema.d.ts +0 -179
  177. package/dist/schemas/rooms.schema.d.ts.map +0 -1
  178. package/dist/schemas/rooms.schema.js +0 -85
  179. package/dist/schemas/rooms.schema.js.map +0 -1
  180. package/dist/schemas/scheduled_tournament.schema.d.ts +0 -257
  181. package/dist/schemas/scheduled_tournament.schema.d.ts.map +0 -1
  182. package/dist/schemas/scheduled_tournament.schema.js +0 -113
  183. package/dist/schemas/scheduled_tournament.schema.js.map +0 -1
  184. package/src/repositories/rooms.repository.ts +0 -14
  185. package/src/repositories/scheduled-tournaments.repository.ts +0 -35
  186. package/src/schemas/rooms.schema.ts +0 -63
  187. package/src/schemas/scheduled_tournament.schema.ts +0 -94
package/dist/utils.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare function getChannelRegExpFilter(channel: string): RegExp;
2
+ export declare function getGameRegExpFilter(game: string): RegExp;
2
3
  //# sourceMappingURL=utils.d.ts.map
@@ -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;AAFD,SAAgB,sBAAsB,CAAC,OAAe;IACpD,OAAO,IAAI,MAAM,CAAC,OAAO,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jp.db.schemas",
3
- "version": "2.2.12",
3
+ "version": "2.2.13",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
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,
@@ -0,0 +1,4 @@
1
+ export enum ExperiencesLevelEdgeEnum {
2
+ PLAYER = 50,
3
+ PROFI = 100,
4
+ }
@@ -0,0 +1,5 @@
1
+ export enum ExperiencesLevelRankEnum {
2
+ NEW = 1,
3
+ PLAYER = 2,
4
+ PROFI = 3,
5
+ }
@@ -3,5 +3,5 @@ export interface IRatingAddBulkItem {
3
3
  userName: string;
4
4
  userAvatarUrl: string;
5
5
  game: string;
6
- channels: string;
6
+ channel: string;
7
7
  }
@@ -4,8 +4,9 @@ export interface IRatingMonthlyResult {
4
4
  userName: string;
5
5
  userAvatarUrl: string;
6
6
  game: string;
7
- channels: string;
7
+ channel: string;
8
8
  count: number;
9
9
  date: string;
10
10
  rank: number;
11
+ profit: number;
11
12
  }
@@ -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.find().exec();
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
- channels: { $first: '$channels' },
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
- channels: string,
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
- channels,
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
- channels: string,
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
- channels,
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
- channels: string,
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
- channels,
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
- channels: string,
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
- channels,
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
- channels: string,
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
- channels,
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
- channels: string,
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
- channels,
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
- channels: string,
16
+ channel: string,
16
17
  ): Promise<Banner | null> {
17
- return this.bannerModel.findOne({ enabled: true }).exec();
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
- channels: getChannelRegExpFilter(channel),
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 findFriend(
15
- channel: string,
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 { getChannelRegExpFilter } from '../utils';
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
- channels: getChannelRegExpFilter(channel),
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(channel: string, game: string): Promise<Array<Menu> | null> {
12
+ async findMenus(game: string, channel: string): Promise<Array<Menu> | null> {
13
13
  return this.menuModel
14
14
  .find({
15
- channels: getChannelRegExpFilter(channel),
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(gameType: string): Promise<Premium | null> {
14
- return this.premiumModel.findOne({ gameType }).exec();
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
- channels: getChannelRegExpFilter(channel),
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
- channels: { $first: '$channels' },
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
- channels: 1,
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(gameType: string): Promise<Rule | null> {
12
- return this.ruleModel.findOne({ gameType }).exec();
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
- channels: getChannelRegExpFilter(channel),
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.findOne({ game }).exec();
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;
@@ -31,7 +31,7 @@ export class ActivityLog {
31
31
  game: string;
32
32
 
33
33
  @Prop()
34
- channels: string;
34
+ channel: string;
35
35
  }
36
36
 
37
37
  export const ActivityLogSchema = SchemaFactory.createForClass(ActivityLog);
@@ -12,11 +12,8 @@ export class Banner {
12
12
  })
13
13
  readonly bannerId: string;
14
14
 
15
- @Prop()
16
- titleRu: string;
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
- channels: string;
34
+ channel: string;
38
35
  }
39
36
 
40
37
  export const BannerSchema = SchemaFactory.createForClass(Banner);
@@ -12,9 +12,6 @@ export class DailyBonus {
12
12
  })
13
13
  readonly dailyBonusId: string;
14
14
 
15
- @Prop()
16
- id: string;
17
-
18
15
  @Prop({ type: Object })
19
16
  title: Record<string, string>;
20
17
 
@@ -19,7 +19,7 @@ export class Feature {
19
19
  enabled: boolean;
20
20
 
21
21
  @Prop()
22
- channels: string;
22
+ channel: string;
23
23
 
24
24
  @Prop()
25
25
  game?: string;