jp.db.schemas 2.0.27 → 2.1.0
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 +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/models/activity-log.enum.d.ts +5 -0
- package/dist/models/activity-log.enum.d.ts.map +1 -0
- package/dist/models/activity-log.enum.js +9 -0
- package/dist/models/activity-log.enum.js.map +1 -0
- package/dist/repositories/activity-log.repository.d.ts +11 -0
- package/dist/repositories/activity-log.repository.d.ts.map +1 -0
- package/dist/repositories/activity-log.repository.js +93 -0
- package/dist/repositories/activity-log.repository.js.map +1 -0
- package/dist/repositories/index.d.ts +2 -1
- package/dist/repositories/index.d.ts.map +1 -1
- package/dist/repositories/index.js +3 -1
- package/dist/repositories/index.js.map +1 -1
- package/dist/schemas/activity_log.schema.d.ts +105 -0
- package/dist/schemas/activity_log.schema.d.ts.map +1 -0
- package/dist/schemas/activity_log.schema.js +57 -0
- package/dist/schemas/activity_log.schema.js.map +1 -0
- package/package.json +31 -30
- package/readme.md +3 -3
- package/src/index.ts +226 -219
- package/src/models/activity-log.enum.ts +4 -0
- package/src/models/tournament-participant.interface.ts +5 -5
- package/src/models/tournament-status.enum.ts +6 -6
- package/src/models/tournament-template.enum.ts +3 -3
- package/src/models/tournament-winner.interface.ts +7 -7
- package/src/repositories/activity-log.repository.ts +93 -0
- package/src/repositories/admin.repository.ts +23 -23
- package/src/repositories/article.repository.ts +33 -33
- package/src/repositories/balance-history.repository.ts +15 -15
- package/src/repositories/banners.repository.ts +54 -54
- package/src/repositories/complains.repository.ts +30 -30
- package/src/repositories/daily-bonus.repository.ts +19 -19
- package/src/repositories/game-result.repository.ts +15 -15
- package/src/repositories/index.ts +47 -45
- package/src/repositories/menu.repository.ts +21 -21
- package/src/repositories/notification.repository.ts +54 -54
- package/src/repositories/premium.repository.ts +19 -19
- package/src/repositories/products.repository.ts +29 -29
- package/src/repositories/rooms.repository.ts +17 -17
- package/src/repositories/rule.repository.ts +19 -19
- package/src/repositories/scheduled-tournaments.repository.ts +30 -30
- package/src/repositories/servers.repository.ts +18 -18
- package/src/repositories/setting.repository.ts +19 -19
- package/src/repositories/simple-rooms.repository.ts +17 -17
- package/src/repositories/tournament-many-tables-rooms.repository.ts +132 -132
- package/src/repositories/tournament-one-table-rooms.repository.ts +106 -106
- package/src/repositories/users.repository.ts +124 -124
- package/src/repositories/welcome.repository.ts +19 -19
- package/src/schemas/achievement.schema.ts +40 -40
- package/src/schemas/activity_log.schema.ts +37 -0
- package/src/schemas/admin.schema.ts +22 -22
- package/src/schemas/article.schema.ts +37 -37
- package/src/schemas/balance_history.schema.ts +37 -37
- package/src/schemas/banner.schema.ts +40 -40
- package/src/schemas/channel_message.schema.ts +31 -31
- package/src/schemas/complain.schema.ts +46 -46
- package/src/schemas/daily_bonus.schema.ts +56 -56
- package/src/schemas/feature.schema.ts +28 -28
- package/src/schemas/game_result.schema.ts +68 -68
- package/src/schemas/menu.schema.ts +40 -40
- package/src/schemas/notification.schema.ts +61 -61
- package/src/schemas/premium.schema.ts +45 -45
- package/src/schemas/product.schema.ts +123 -123
- package/src/schemas/purchase.schema.ts +64 -64
- package/src/schemas/purchase_channel.schema.ts +31 -31
- package/src/schemas/rating.schema.ts +46 -46
- package/src/schemas/rooms.schema.ts +63 -63
- package/src/schemas/rule.schema.ts +45 -45
- package/src/schemas/scheduled_tournament.schema.ts +93 -93
- package/src/schemas/server.schema.ts +22 -22
- package/src/schemas/setting.schema.ts +55 -55
- package/src/schemas/simple_rooms.schema.ts +46 -46
- package/src/schemas/tournament_many_tables_rooms.schema.ts +84 -84
- package/src/schemas/tournament_one_table_rooms.schema.ts +81 -81
- package/src/schemas/user.fb.schema.ts +33 -33
- package/src/schemas/user.google.schema.ts +24 -24
- package/src/schemas/user.ok.schema.ts +52 -52
- package/src/schemas/user.schema.ts +184 -184
- package/src/schemas/user.tg.schema.ts +30 -30
- package/src/schemas/user.vk.schema.ts +70 -70
- package/src/schemas/user.ya.schema.ts +24 -24
- package/src/schemas/welcome.schema.ts +45 -45
- package/src/utils.ts +3 -3
package/src/index.ts
CHANGED
|
@@ -1,219 +1,226 @@
|
|
|
1
|
-
import { User, UserSchema } from './schemas/user.schema';
|
|
2
|
-
import type { UserDocument } from './schemas/user.schema';
|
|
3
|
-
import { FBUser, FBUserSchema } from './schemas/user.fb.schema';
|
|
4
|
-
import type { FBUserDocument } from './schemas/user.fb.schema';
|
|
5
|
-
import { GoogleUser, GoogleUserSchema } from './schemas/user.google.schema';
|
|
6
|
-
import type { GoogleUserDocument } from './schemas/user.google.schema';
|
|
7
|
-
import { OKUser, OKUserSchema } from './schemas/user.ok.schema';
|
|
8
|
-
import type { OKUserDocument } from './schemas/user.ok.schema';
|
|
9
|
-
import { TGUser, TGUserSchema } from './schemas/user.tg.schema';
|
|
10
|
-
import type { TGUserDocument } from './schemas/user.tg.schema';
|
|
11
|
-
import { VKUser, VKUserSchema } from './schemas/user.vk.schema';
|
|
12
|
-
import type { VKUserDocument } from './schemas/user.vk.schema';
|
|
13
|
-
import { YAUser, YAUserSchema } from './schemas/user.ya.schema';
|
|
14
|
-
import type { YAUserDocument } from './schemas/user.ya.schema';
|
|
15
|
-
import { Purchase, PurchaseSchema } from './schemas/purchase.schema';
|
|
16
|
-
import type { PurchaseDocument } from './schemas/purchase.schema';
|
|
17
|
-
import { Complain, ComplainSchema } from './schemas/complain.schema';
|
|
18
|
-
import type { ComplainDocument } from './schemas/complain.schema';
|
|
19
|
-
import { Notification, NotificationSchema } from './schemas/notification.schema';
|
|
20
|
-
import type { NotificationDocument } from './schemas/notification.schema';
|
|
21
|
-
import { ScheduledTournament, ScheduledTournamentSchema } from './schemas/scheduled_tournament.schema';
|
|
22
|
-
import type { ScheduledTournamentDocument } from './schemas/scheduled_tournament.schema';
|
|
23
|
-
import { Admin, AdminSchema } from './schemas/admin.schema';
|
|
24
|
-
import type { AdminDocument } from './schemas/admin.schema';
|
|
25
|
-
import { Room, RoomSchema } from './schemas/rooms.schema';
|
|
26
|
-
import type { RoomDocument } from './schemas/rooms.schema';
|
|
27
|
-
import { Article, ArticleSchema } from './schemas/article.schema';
|
|
28
|
-
import type { ArticleDocument } from './schemas/article.schema';
|
|
29
|
-
import { Banner, BannerSchema } from './schemas/banner.schema';
|
|
30
|
-
import type { BannerDocument } from './schemas/banner.schema';
|
|
31
|
-
import { Server, ServerSchema } from './schemas/server.schema';
|
|
32
|
-
import type { ServerDocument } from './schemas/server.schema';
|
|
33
|
-
import { Achievement, AchievementSchema } from './schemas/achievement.schema';
|
|
34
|
-
import type { AchievementDocument } from './schemas/achievement.schema';
|
|
35
|
-
import { ChannelMessage, ChannelMessageSchema } from './schemas/channel_message.schema';
|
|
36
|
-
import type { ChannelMessageDocument } from './schemas/channel_message.schema';
|
|
37
|
-
import { Feature, FeatureSchema } from './schemas/feature.schema';
|
|
38
|
-
import type { FeatureDocument } from './schemas/feature.schema';
|
|
39
|
-
import { Product, ProductSchema } from './schemas/product.schema';
|
|
40
|
-
import type { ProductDocument } from './schemas/product.schema';
|
|
41
|
-
import { PurchaseChannel, PurchaseChannelSchema } from './schemas/purchase_channel.schema';
|
|
42
|
-
import type { PurchaseChannelDocument } from './schemas/purchase_channel.schema';
|
|
43
|
-
import { Rating, RatingSchema } from './schemas/rating.schema';
|
|
44
|
-
import type { RatingDocument } from './schemas/rating.schema';
|
|
45
|
-
import { Setting, SettingSchema } from './schemas/setting.schema';
|
|
46
|
-
import type { SettingDocument } from './schemas/setting.schema';
|
|
47
|
-
import { Premium, PremiumSchema } from './schemas/premium.schema';
|
|
48
|
-
import type { PremiumDocument } from './schemas/premium.schema';
|
|
49
|
-
import { Menu, MenuSchema } from './schemas/menu.schema';
|
|
50
|
-
import type { MenuDocument } from './schemas/menu.schema';
|
|
51
|
-
import { GameResult, GameResultSchema } from './schemas/game_result.schema';
|
|
52
|
-
import type { GameResultDocument } from './schemas/game_result.schema';
|
|
53
|
-
import { BalanceHistory, BalanceHistorySchema } from './schemas/balance_history.schema';
|
|
54
|
-
import type { BalanceHistoryDocument } from './schemas/balance_history.schema';
|
|
55
|
-
import { SimpleRoom, SimpleRoomSchema } from './schemas/simple_rooms.schema';
|
|
56
|
-
import type { SimpleRoomDocument } from './schemas/simple_rooms.schema';
|
|
57
|
-
import { TournamentOneTableRoom, TournamentOneTableRoomSchema, } from './schemas/tournament_one_table_rooms.schema';
|
|
58
|
-
import type { TournamentOneTableRoomDocument } from './schemas/tournament_one_table_rooms.schema';
|
|
59
|
-
import { TournamentManyTablesRoom, TournamentManyTablesRoomSchema } from './schemas/tournament_many_tables_rooms.schema';
|
|
60
|
-
import type { TournamentManyTablesRoomDocument } from './schemas/tournament_many_tables_rooms.schema';
|
|
61
|
-
import { DailyBonus, DailyBonusSchema } from './schemas/daily_bonus.schema';
|
|
62
|
-
import type { DailyBonusDocument } from './schemas/daily_bonus.schema';
|
|
63
|
-
import { Rule, RuleSchema } from './schemas/rule.schema';
|
|
64
|
-
import type { RuleDocument } from './schemas/rule.schema';
|
|
65
|
-
import { Welcome, WelcomeSchema } from './schemas/welcome.schema';
|
|
66
|
-
import type { WelcomeDocument } from './schemas/welcome.schema';
|
|
67
|
-
|
|
68
|
-
import {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
1
|
+
import { User, UserSchema } from './schemas/user.schema';
|
|
2
|
+
import type { UserDocument } from './schemas/user.schema';
|
|
3
|
+
import { FBUser, FBUserSchema } from './schemas/user.fb.schema';
|
|
4
|
+
import type { FBUserDocument } from './schemas/user.fb.schema';
|
|
5
|
+
import { GoogleUser, GoogleUserSchema } from './schemas/user.google.schema';
|
|
6
|
+
import type { GoogleUserDocument } from './schemas/user.google.schema';
|
|
7
|
+
import { OKUser, OKUserSchema } from './schemas/user.ok.schema';
|
|
8
|
+
import type { OKUserDocument } from './schemas/user.ok.schema';
|
|
9
|
+
import { TGUser, TGUserSchema } from './schemas/user.tg.schema';
|
|
10
|
+
import type { TGUserDocument } from './schemas/user.tg.schema';
|
|
11
|
+
import { VKUser, VKUserSchema } from './schemas/user.vk.schema';
|
|
12
|
+
import type { VKUserDocument } from './schemas/user.vk.schema';
|
|
13
|
+
import { YAUser, YAUserSchema } from './schemas/user.ya.schema';
|
|
14
|
+
import type { YAUserDocument } from './schemas/user.ya.schema';
|
|
15
|
+
import { Purchase, PurchaseSchema } from './schemas/purchase.schema';
|
|
16
|
+
import type { PurchaseDocument } from './schemas/purchase.schema';
|
|
17
|
+
import { Complain, ComplainSchema } from './schemas/complain.schema';
|
|
18
|
+
import type { ComplainDocument } from './schemas/complain.schema';
|
|
19
|
+
import { Notification, NotificationSchema } from './schemas/notification.schema';
|
|
20
|
+
import type { NotificationDocument } from './schemas/notification.schema';
|
|
21
|
+
import { ScheduledTournament, ScheduledTournamentSchema } from './schemas/scheduled_tournament.schema';
|
|
22
|
+
import type { ScheduledTournamentDocument } from './schemas/scheduled_tournament.schema';
|
|
23
|
+
import { Admin, AdminSchema } from './schemas/admin.schema';
|
|
24
|
+
import type { AdminDocument } from './schemas/admin.schema';
|
|
25
|
+
import { Room, RoomSchema } from './schemas/rooms.schema';
|
|
26
|
+
import type { RoomDocument } from './schemas/rooms.schema';
|
|
27
|
+
import { Article, ArticleSchema } from './schemas/article.schema';
|
|
28
|
+
import type { ArticleDocument } from './schemas/article.schema';
|
|
29
|
+
import { Banner, BannerSchema } from './schemas/banner.schema';
|
|
30
|
+
import type { BannerDocument } from './schemas/banner.schema';
|
|
31
|
+
import { Server, ServerSchema } from './schemas/server.schema';
|
|
32
|
+
import type { ServerDocument } from './schemas/server.schema';
|
|
33
|
+
import { Achievement, AchievementSchema } from './schemas/achievement.schema';
|
|
34
|
+
import type { AchievementDocument } from './schemas/achievement.schema';
|
|
35
|
+
import { ChannelMessage, ChannelMessageSchema } from './schemas/channel_message.schema';
|
|
36
|
+
import type { ChannelMessageDocument } from './schemas/channel_message.schema';
|
|
37
|
+
import { Feature, FeatureSchema } from './schemas/feature.schema';
|
|
38
|
+
import type { FeatureDocument } from './schemas/feature.schema';
|
|
39
|
+
import { Product, ProductSchema } from './schemas/product.schema';
|
|
40
|
+
import type { ProductDocument } from './schemas/product.schema';
|
|
41
|
+
import { PurchaseChannel, PurchaseChannelSchema } from './schemas/purchase_channel.schema';
|
|
42
|
+
import type { PurchaseChannelDocument } from './schemas/purchase_channel.schema';
|
|
43
|
+
import { Rating, RatingSchema } from './schemas/rating.schema';
|
|
44
|
+
import type { RatingDocument } from './schemas/rating.schema';
|
|
45
|
+
import { Setting, SettingSchema } from './schemas/setting.schema';
|
|
46
|
+
import type { SettingDocument } from './schemas/setting.schema';
|
|
47
|
+
import { Premium, PremiumSchema } from './schemas/premium.schema';
|
|
48
|
+
import type { PremiumDocument } from './schemas/premium.schema';
|
|
49
|
+
import { Menu, MenuSchema } from './schemas/menu.schema';
|
|
50
|
+
import type { MenuDocument } from './schemas/menu.schema';
|
|
51
|
+
import { GameResult, GameResultSchema } from './schemas/game_result.schema';
|
|
52
|
+
import type { GameResultDocument } from './schemas/game_result.schema';
|
|
53
|
+
import { BalanceHistory, BalanceHistorySchema } from './schemas/balance_history.schema';
|
|
54
|
+
import type { BalanceHistoryDocument } from './schemas/balance_history.schema';
|
|
55
|
+
import { SimpleRoom, SimpleRoomSchema } from './schemas/simple_rooms.schema';
|
|
56
|
+
import type { SimpleRoomDocument } from './schemas/simple_rooms.schema';
|
|
57
|
+
import { TournamentOneTableRoom, TournamentOneTableRoomSchema, } from './schemas/tournament_one_table_rooms.schema';
|
|
58
|
+
import type { TournamentOneTableRoomDocument } from './schemas/tournament_one_table_rooms.schema';
|
|
59
|
+
import { TournamentManyTablesRoom, TournamentManyTablesRoomSchema } from './schemas/tournament_many_tables_rooms.schema';
|
|
60
|
+
import type { TournamentManyTablesRoomDocument } from './schemas/tournament_many_tables_rooms.schema';
|
|
61
|
+
import { DailyBonus, DailyBonusSchema } from './schemas/daily_bonus.schema';
|
|
62
|
+
import type { DailyBonusDocument } from './schemas/daily_bonus.schema';
|
|
63
|
+
import { Rule, RuleSchema } from './schemas/rule.schema';
|
|
64
|
+
import type { RuleDocument } from './schemas/rule.schema';
|
|
65
|
+
import { Welcome, WelcomeSchema } from './schemas/welcome.schema';
|
|
66
|
+
import type { WelcomeDocument } from './schemas/welcome.schema';
|
|
67
|
+
import { ActivityLog, ActivityLogSchema } from './schemas/activity_log.schema';
|
|
68
|
+
import type { ActivityLogDocument } from './schemas/activity_log.schema';
|
|
69
|
+
|
|
70
|
+
import {
|
|
71
|
+
AdminRepository,
|
|
72
|
+
ArticleRepository,
|
|
73
|
+
BannersRepository,
|
|
74
|
+
ComplainsRepository,
|
|
75
|
+
NotificationRepository,
|
|
76
|
+
ProductsRepository,
|
|
77
|
+
ScheduledTournamentsRepository,
|
|
78
|
+
ServersRepository,
|
|
79
|
+
UsersRepository,
|
|
80
|
+
MenuRepository,
|
|
81
|
+
WelcomeRepository,
|
|
82
|
+
PremiumRepository,
|
|
83
|
+
RuleRepository,
|
|
84
|
+
DailyBonusRepository,
|
|
85
|
+
SettingRepository,
|
|
86
|
+
RoomsRepository,
|
|
87
|
+
GameResultRepository,
|
|
88
|
+
BalanceHistoryRepository,
|
|
89
|
+
SimpleRoomsRepository,
|
|
90
|
+
TournamentOneTableRoomsRepository,
|
|
91
|
+
TournamentManyTablesRoomsRepository,
|
|
92
|
+
ActivityLogRepository,
|
|
93
|
+
} from './repositories'
|
|
94
|
+
|
|
95
|
+
export type {
|
|
96
|
+
UserDocument,
|
|
97
|
+
FBUserDocument,
|
|
98
|
+
GoogleUserDocument,
|
|
99
|
+
OKUserDocument,
|
|
100
|
+
TGUserDocument,
|
|
101
|
+
VKUserDocument,
|
|
102
|
+
YAUserDocument,
|
|
103
|
+
PurchaseDocument,
|
|
104
|
+
ComplainDocument,
|
|
105
|
+
NotificationDocument,
|
|
106
|
+
ScheduledTournamentDocument,
|
|
107
|
+
AdminDocument,
|
|
108
|
+
RoomDocument,
|
|
109
|
+
ArticleDocument,
|
|
110
|
+
BannerDocument,
|
|
111
|
+
ServerDocument,
|
|
112
|
+
AchievementDocument,
|
|
113
|
+
ChannelMessageDocument,
|
|
114
|
+
FeatureDocument,
|
|
115
|
+
ProductDocument,
|
|
116
|
+
PurchaseChannelDocument,
|
|
117
|
+
RatingDocument,
|
|
118
|
+
SettingDocument,
|
|
119
|
+
PremiumDocument,
|
|
120
|
+
MenuDocument,
|
|
121
|
+
WelcomeDocument,
|
|
122
|
+
RuleDocument,
|
|
123
|
+
DailyBonusDocument,
|
|
124
|
+
GameResultDocument,
|
|
125
|
+
BalanceHistoryDocument,
|
|
126
|
+
SimpleRoomDocument,
|
|
127
|
+
TournamentOneTableRoomDocument,
|
|
128
|
+
TournamentManyTablesRoomDocument,
|
|
129
|
+
ActivityLogDocument,
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
User,
|
|
134
|
+
UserSchema,
|
|
135
|
+
FBUser,
|
|
136
|
+
FBUserSchema,
|
|
137
|
+
GoogleUser,
|
|
138
|
+
GoogleUserSchema,
|
|
139
|
+
OKUser,
|
|
140
|
+
OKUserSchema,
|
|
141
|
+
TGUser,
|
|
142
|
+
TGUserSchema,
|
|
143
|
+
VKUser,
|
|
144
|
+
VKUserSchema,
|
|
145
|
+
YAUser,
|
|
146
|
+
YAUserSchema,
|
|
147
|
+
Purchase,
|
|
148
|
+
PurchaseSchema,
|
|
149
|
+
Complain,
|
|
150
|
+
ComplainSchema,
|
|
151
|
+
Notification,
|
|
152
|
+
NotificationSchema,
|
|
153
|
+
ScheduledTournament,
|
|
154
|
+
ScheduledTournamentSchema,
|
|
155
|
+
Admin,
|
|
156
|
+
AdminSchema,
|
|
157
|
+
Room,
|
|
158
|
+
RoomSchema,
|
|
159
|
+
Article,
|
|
160
|
+
ArticleSchema,
|
|
161
|
+
Banner,
|
|
162
|
+
BannerSchema,
|
|
163
|
+
Server,
|
|
164
|
+
ServerSchema,
|
|
165
|
+
Achievement,
|
|
166
|
+
AchievementSchema,
|
|
167
|
+
ChannelMessage,
|
|
168
|
+
ChannelMessageSchema,
|
|
169
|
+
Feature,
|
|
170
|
+
FeatureSchema,
|
|
171
|
+
Product,
|
|
172
|
+
ProductSchema,
|
|
173
|
+
PurchaseChannel,
|
|
174
|
+
PurchaseChannelSchema,
|
|
175
|
+
Rating,
|
|
176
|
+
RatingSchema,
|
|
177
|
+
Setting,
|
|
178
|
+
SettingSchema,
|
|
179
|
+
Menu,
|
|
180
|
+
MenuSchema,
|
|
181
|
+
DailyBonus,
|
|
182
|
+
DailyBonusSchema,
|
|
183
|
+
Rule,
|
|
184
|
+
RuleSchema,
|
|
185
|
+
Premium,
|
|
186
|
+
PremiumSchema,
|
|
187
|
+
Welcome,
|
|
188
|
+
WelcomeSchema,
|
|
189
|
+
GameResult,
|
|
190
|
+
GameResultSchema,
|
|
191
|
+
BalanceHistory,
|
|
192
|
+
BalanceHistorySchema,
|
|
193
|
+
SimpleRoom,
|
|
194
|
+
SimpleRoomSchema,
|
|
195
|
+
TournamentOneTableRoom,
|
|
196
|
+
TournamentOneTableRoomSchema,
|
|
197
|
+
TournamentManyTablesRoom,
|
|
198
|
+
TournamentManyTablesRoomSchema,
|
|
199
|
+
ActivityLog,
|
|
200
|
+
ActivityLogSchema,
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export {
|
|
204
|
+
AdminRepository,
|
|
205
|
+
ArticleRepository,
|
|
206
|
+
BannersRepository,
|
|
207
|
+
ComplainsRepository,
|
|
208
|
+
NotificationRepository,
|
|
209
|
+
ProductsRepository,
|
|
210
|
+
ScheduledTournamentsRepository,
|
|
211
|
+
ServersRepository,
|
|
212
|
+
UsersRepository,
|
|
213
|
+
MenuRepository,
|
|
214
|
+
DailyBonusRepository,
|
|
215
|
+
PremiumRepository,
|
|
216
|
+
RuleRepository,
|
|
217
|
+
WelcomeRepository,
|
|
218
|
+
SettingRepository,
|
|
219
|
+
RoomsRepository,
|
|
220
|
+
GameResultRepository,
|
|
221
|
+
BalanceHistoryRepository,
|
|
222
|
+
SimpleRoomsRepository,
|
|
223
|
+
TournamentOneTableRoomsRepository,
|
|
224
|
+
TournamentManyTablesRoomsRepository,
|
|
225
|
+
ActivityLogRepository,
|
|
226
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export interface ITournamentParticipant {
|
|
2
|
-
playerId: string;
|
|
3
|
-
playerName: string;
|
|
4
|
-
playerAvatarUrl: string;
|
|
5
|
-
}
|
|
1
|
+
export interface ITournamentParticipant {
|
|
2
|
+
playerId: string;
|
|
3
|
+
playerName: string;
|
|
4
|
+
playerAvatarUrl: string;
|
|
5
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export enum TournamentStatusEnum {
|
|
2
|
-
STATE_WAITING_FOR_START = 'STATE_WAITING_FOR_START',
|
|
3
|
-
STATE_IN_PROGRESS = 'STATE_IN_PROGRESS',
|
|
4
|
-
STATE_FINISHED = 'STATE_FINISHED',
|
|
5
|
-
STATE_CANCELLED = 'STATE_CANCELLED',
|
|
6
|
-
}
|
|
1
|
+
export enum TournamentStatusEnum {
|
|
2
|
+
STATE_WAITING_FOR_START = 'STATE_WAITING_FOR_START',
|
|
3
|
+
STATE_IN_PROGRESS = 'STATE_IN_PROGRESS',
|
|
4
|
+
STATE_FINISHED = 'STATE_FINISHED',
|
|
5
|
+
STATE_CANCELLED = 'STATE_CANCELLED',
|
|
6
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export enum TournamentTemplateEnum {
|
|
2
|
-
MASTER = 'MASTER',
|
|
3
|
-
}
|
|
1
|
+
export enum TournamentTemplateEnum {
|
|
2
|
+
MASTER = 'MASTER',
|
|
3
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface ITournamentWinner {
|
|
2
|
-
playerId: string;
|
|
3
|
-
playerName: string;
|
|
4
|
-
playerAvatarUrl: string;
|
|
5
|
-
profit: number;
|
|
6
|
-
rank: number;
|
|
7
|
-
}
|
|
1
|
+
export interface ITournamentWinner {
|
|
2
|
+
playerId: string;
|
|
3
|
+
playerName: string;
|
|
4
|
+
playerAvatarUrl: string;
|
|
5
|
+
profit: number;
|
|
6
|
+
rank: number;
|
|
7
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectModel } from '@nestjs/mongoose';
|
|
3
|
+
import { Model } from 'mongoose';
|
|
4
|
+
import dayjs from 'dayjs';
|
|
5
|
+
|
|
6
|
+
import { ActivityLog, ActivityLogDocument } from '..';
|
|
7
|
+
import { ActivityLogEnum } from '../models/activity-log.enum';
|
|
8
|
+
|
|
9
|
+
@Injectable()
|
|
10
|
+
export class ActivityLogRepository {
|
|
11
|
+
constructor(
|
|
12
|
+
@InjectModel(ActivityLog.name) private activityLogModel: Model<ActivityLogDocument>
|
|
13
|
+
) {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async findLast7DaysLogins(
|
|
17
|
+
game: string,
|
|
18
|
+
userId: string,
|
|
19
|
+
): Promise<Array<ActivityLog>> {
|
|
20
|
+
const weekAgo = dayjs().startOf('day').add(-1, 'week');
|
|
21
|
+
|
|
22
|
+
// return this.activityLogModel
|
|
23
|
+
// .find({
|
|
24
|
+
// game,
|
|
25
|
+
// userId,
|
|
26
|
+
// date: { $gte: weekAgo },
|
|
27
|
+
// })
|
|
28
|
+
// .exec();
|
|
29
|
+
|
|
30
|
+
return this.activityLogModel.aggregate([
|
|
31
|
+
{
|
|
32
|
+
$match: {
|
|
33
|
+
game,
|
|
34
|
+
userId,
|
|
35
|
+
date: { $gte: weekAgo },
|
|
36
|
+
event: ActivityLogEnum.USER_LOGIN,
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
$group: {
|
|
41
|
+
_id: {
|
|
42
|
+
day: { $dayOfMonth: "$date" },
|
|
43
|
+
},
|
|
44
|
+
userId: { $first: "$userId" },
|
|
45
|
+
userName: { $first: "$userName" },
|
|
46
|
+
date: { $first: "$date" },
|
|
47
|
+
event: { $first: "$event" },
|
|
48
|
+
game: { $first: "$game" },
|
|
49
|
+
channel: { $first: "$channel" },
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
])
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async addUserLoginEvent(
|
|
56
|
+
userId: string,
|
|
57
|
+
userName: string,
|
|
58
|
+
game: string,
|
|
59
|
+
channel: string,
|
|
60
|
+
): Promise<ActivityLog> {
|
|
61
|
+
return this.addActivityLog({
|
|
62
|
+
date: new Date(),
|
|
63
|
+
event: ActivityLogEnum.USER_LOGIN,
|
|
64
|
+
userId,
|
|
65
|
+
userName,
|
|
66
|
+
game,
|
|
67
|
+
channel,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async addUserGotBonuseEvent(
|
|
72
|
+
userId: string,
|
|
73
|
+
userName: string,
|
|
74
|
+
game: string,
|
|
75
|
+
channel: string,
|
|
76
|
+
amount: number,
|
|
77
|
+
): Promise<ActivityLog> {
|
|
78
|
+
return this.addActivityLog({
|
|
79
|
+
date: new Date(),
|
|
80
|
+
event: ActivityLogEnum.USER_GOT_BONUS,
|
|
81
|
+
userId,
|
|
82
|
+
userName,
|
|
83
|
+
game,
|
|
84
|
+
channel,
|
|
85
|
+
amount,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async addActivityLog(activityLog: Partial<ActivityLog>): Promise<ActivityLog> {
|
|
90
|
+
return this.activityLogModel.create(activityLog);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { InjectModel } from '@nestjs/mongoose';
|
|
3
|
-
import { Model } from 'mongoose';
|
|
4
|
-
|
|
5
|
-
import { Admin, AdminDocument } from '../';
|
|
6
|
-
|
|
7
|
-
@Injectable()
|
|
8
|
-
export class AdminRepository {
|
|
9
|
-
constructor (@InjectModel(Admin.name) private adminModel: Model<AdminDocument>) {
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async findById (id: string): Promise<Admin | null> {
|
|
13
|
-
return this.adminModel
|
|
14
|
-
.findOne({ _id: id })
|
|
15
|
-
.exec();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async findByLogin (login: string): Promise<Admin | null> {
|
|
19
|
-
return this.adminModel
|
|
20
|
-
.findOne({ login })
|
|
21
|
-
.exec();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectModel } from '@nestjs/mongoose';
|
|
3
|
+
import { Model } from 'mongoose';
|
|
4
|
+
|
|
5
|
+
import { Admin, AdminDocument } from '../';
|
|
6
|
+
|
|
7
|
+
@Injectable()
|
|
8
|
+
export class AdminRepository {
|
|
9
|
+
constructor (@InjectModel(Admin.name) private adminModel: Model<AdminDocument>) {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async findById (id: string): Promise<Admin | null> {
|
|
13
|
+
return this.adminModel
|
|
14
|
+
.findOne({ _id: id })
|
|
15
|
+
.exec();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async findByLogin (login: string): Promise<Admin | null> {
|
|
19
|
+
return this.adminModel
|
|
20
|
+
.findOne({ login })
|
|
21
|
+
.exec();
|
|
22
|
+
}
|
|
23
|
+
}
|