jp.db.schemas 2.2.0 → 2.2.2

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 (85) hide show
  1. package/dist/index.d.ts +8 -6
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +10 -6
  4. package/dist/index.js.map +1 -1
  5. package/dist/models/account-type.enum.d.ts +9 -0
  6. package/dist/models/account-type.enum.d.ts.map +1 -0
  7. package/dist/models/account-type.enum.js +13 -0
  8. package/dist/models/account-type.enum.js.map +1 -0
  9. package/dist/models/users-balance-reason.enum.d.ts +9 -0
  10. package/dist/models/users-balance-reason.enum.d.ts.map +1 -0
  11. package/dist/models/users-balance-reason.enum.js +13 -0
  12. package/dist/models/users-balance-reason.enum.js.map +1 -0
  13. package/dist/repositories/index.d.ts +3 -2
  14. package/dist/repositories/index.d.ts.map +1 -1
  15. package/dist/repositories/index.js +5 -3
  16. package/dist/repositories/index.js.map +1 -1
  17. package/dist/repositories/settings-options.repository.d.ts +1 -1
  18. package/dist/repositories/settings-options.repository.d.ts.map +1 -1
  19. package/dist/repositories/settings-options.repository.js +2 -5
  20. package/dist/repositories/settings-options.repository.js.map +1 -1
  21. package/dist/repositories/users-achievements.repository.d.ts +10 -0
  22. package/dist/repositories/users-achievements.repository.d.ts.map +1 -0
  23. package/dist/repositories/users-achievements.repository.js +52 -0
  24. package/dist/repositories/users-achievements.repository.js.map +1 -0
  25. package/dist/repositories/users-balances.repository.d.ts +11 -0
  26. package/dist/repositories/users-balances.repository.d.ts.map +1 -0
  27. package/dist/repositories/users-balances.repository.js +44 -0
  28. package/dist/repositories/users-balances.repository.js.map +1 -0
  29. package/dist/repositories/users.repository.d.ts +0 -1
  30. package/dist/repositories/users.repository.d.ts.map +1 -1
  31. package/dist/repositories/users.repository.js +0 -4
  32. package/dist/repositories/users.repository.js.map +1 -1
  33. package/dist/repositories/welcome.repository.d.ts +1 -1
  34. package/dist/repositories/welcome.repository.d.ts.map +1 -1
  35. package/dist/repositories/welcome.repository.js +2 -2
  36. package/dist/repositories/welcome.repository.js.map +1 -1
  37. package/dist/schemas/setting.schema.d.ts +30 -0
  38. package/dist/schemas/setting.schema.d.ts.map +1 -1
  39. package/dist/schemas/setting.schema.js +12 -0
  40. package/dist/schemas/setting.schema.js.map +1 -1
  41. package/dist/schemas/settings_option.schema.d.ts +20 -0
  42. package/dist/schemas/settings_option.schema.d.ts.map +1 -1
  43. package/dist/schemas/settings_option.schema.js +8 -0
  44. package/dist/schemas/settings_option.schema.js.map +1 -1
  45. package/dist/schemas/user.schema.d.ts +40 -63
  46. package/dist/schemas/user.schema.d.ts.map +1 -1
  47. package/dist/schemas/user.schema.js +72 -21
  48. package/dist/schemas/user.schema.js.map +1 -1
  49. package/dist/schemas/users_achievement.schema.d.ts +115 -0
  50. package/dist/schemas/users_achievement.schema.d.ts.map +1 -0
  51. package/dist/schemas/users_achievement.schema.js +61 -0
  52. package/dist/schemas/users_achievement.schema.js.map +1 -0
  53. package/dist/schemas/users_balance.schema.d.ts +95 -0
  54. package/dist/schemas/users_balance.schema.d.ts.map +1 -0
  55. package/dist/schemas/{balance_history.schema.js → users_balance.schema.js} +18 -22
  56. package/dist/schemas/users_balance.schema.js.map +1 -0
  57. package/package.json +1 -1
  58. package/src/index.ts +14 -7
  59. package/src/models/account-type.enum.ts +8 -0
  60. package/src/models/users-balance-reason.enum.ts +8 -0
  61. package/src/repositories/index.ts +4 -2
  62. package/src/repositories/settings-options.repository.ts +2 -4
  63. package/src/repositories/users-achievements.repository.ts +43 -0
  64. package/src/repositories/users-balances.repository.ts +28 -0
  65. package/src/repositories/users.repository.ts +0 -7
  66. package/src/repositories/welcome.repository.ts +2 -2
  67. package/src/schemas/setting.schema.ts +9 -0
  68. package/src/schemas/settings_option.schema.ts +6 -0
  69. package/src/schemas/user.schema.ts +58 -89
  70. package/src/schemas/users_achievement.schema.ts +40 -0
  71. package/src/schemas/users_balance.schema.ts +34 -0
  72. package/dist/models/activity-log-user-login.interface copy.d.ts +0 -11
  73. package/dist/models/activity-log-user-login.interface copy.d.ts.map +0 -1
  74. package/dist/models/activity-log-user-login.interface copy.js +0 -3
  75. package/dist/models/activity-log-user-login.interface copy.js.map +0 -1
  76. package/dist/repositories/balance-history.repository.d.ts +0 -8
  77. package/dist/repositories/balance-history.repository.d.ts.map +0 -1
  78. package/dist/repositories/balance-history.repository.js +0 -34
  79. package/dist/repositories/balance-history.repository.js.map +0 -1
  80. package/dist/schemas/balance_history.schema.d.ts +0 -105
  81. package/dist/schemas/balance_history.schema.d.ts.map +0 -1
  82. package/dist/schemas/balance_history.schema.js.map +0 -1
  83. package/src/models/activity-log-user-login.interface copy.ts +0 -10
  84. package/src/repositories/balance-history.repository.ts +0 -15
  85. package/src/schemas/balance_history.schema.ts +0 -37
@@ -1,8 +1,10 @@
1
1
  import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
2
2
  import { Document, HydratedDocument } from 'mongoose';
3
+ import dayjs from 'dayjs';
4
+
5
+ import { AccountTypeEnum } from '../models/account-type.enum';
3
6
 
4
7
  import { VKUser } from './user.vk.schema';
5
- import { Purchase } from './purchase.schema';
6
8
  import { OKUser } from './user.ok.schema';
7
9
  import { YAUser } from './user.ya.schema';
8
10
  import { TGUser } from './user.tg.schema';
@@ -11,53 +13,6 @@ import { FBUser } from './user.fb.schema';
11
13
 
12
14
  export type UserDocument = HydratedDocument<User>;
13
15
 
14
- export type IUserWinnerRating = {
15
- month: string;
16
- rank: number;
17
- profit: number;
18
- }
19
-
20
- export type IUserFriend = {
21
- userIdWhoAdded: string
22
- addedUserId: string;
23
- friendId: string;
24
- confirmed: boolean;
25
- channelId: string;
26
- lastVisitChannel?: Date;
27
- };
28
-
29
- export type ILastLogin = {
30
- lastLoginClientVersion: string;
31
- lastLoginClientChannel: string;
32
- lastLoginClientDevice: string;
33
- lastLoginClientOS: string;
34
- lastLoginClientBrowser: string;
35
- lastLoginClientDeviceWidth: number;
36
- lastLoginClientDeviceHeight: number;
37
- lastLoginClientIsMobile: boolean;
38
- }
39
-
40
- export type IGameStatistics = {
41
- gamesPlayed: number;
42
- gamesWon: number;
43
- gamesTheBestSet: number;
44
- gamesMaxProfit: number;
45
- earnProfitCount: number;
46
- winSharksCount: number;
47
- fastTournamentsWonCount: number;
48
- allInWinCount: number;
49
- watchedAdvRewardCount: number;
50
- textedMessagesCount: number;
51
- sentReactionsCount: number;
52
- setTwoPairCount: number;
53
- setThreeOfAKind: number;
54
- setStraightCount: number;
55
- setFlushCount: number;
56
- setFullHouseCount: number;
57
- setFourOfAKindCount: number;
58
- setStraightFlushCount: number;
59
- }
60
-
61
16
  @Schema()
62
17
  export class User {
63
18
  @Virtual({
@@ -76,6 +31,9 @@ export class User {
76
31
  @Prop({ required: true })
77
32
  avatarUrl: string;
78
33
 
34
+ @Prop({ default: new Date() })
35
+ registerDate: Date;
36
+
79
37
  @Prop({ required: true })
80
38
  premiumExpired: Date;
81
39
 
@@ -87,6 +45,9 @@ export class User {
87
45
  @Prop({ default: '' })
88
46
  avatarAliasUrl: string;
89
47
 
48
+ @Prop({ default: '' })
49
+ avatar: string;
50
+
90
51
  @Prop({ default: 'theme__light' })
91
52
  theme: string;
92
53
 
@@ -111,6 +72,12 @@ export class User {
111
72
  @Prop({ default: 'color_schema__default' })
112
73
  colorSchema: string;
113
74
 
75
+ @Prop({ default: 0 })
76
+ experience: number;
77
+
78
+ @Prop({ default: 1 })
79
+ level: number;
80
+
114
81
  // users
115
82
 
116
83
  @Prop({ type: VKUser })
@@ -131,52 +98,54 @@ export class User {
131
98
  @Prop({ type: TGUser })
132
99
  tgUser?: TGUser;
133
100
 
134
- // other
135
-
136
- @Prop({ default: 0 })
137
- experience: number;
138
-
139
- @Prop({ default: 1 })
140
- level: number;
141
-
142
- // @Prop({ default: 1 })
143
- // everydayEnterCount: number;
144
-
145
- // @Prop({ default: new Date() })
146
- // lastEnter: Date;
147
-
148
- // @Prop({ default: false })
149
- // isBannedInChat: boolean;
150
-
151
- @Prop({ default: new Date() })
152
- registerDate: Date;
153
-
154
- // objects
155
-
156
- // @Prop({ default: {} })
157
- // lastLogin: ILastLogin;
158
- //
159
- // @Prop({ default: {} })
160
- // gameStatistics: IGameStatistics;
161
-
162
- // @Prop({ type: Array<Purchase>, default: [] })
163
- // purchases: Array<Purchase>;
164
-
165
- @Prop({ default: [] })
166
- friends: Array<IUserFriend>;
101
+ // virtuals
167
102
 
103
+ @Virtual({
104
+ get: function (this: User) {
105
+ return dayjs().isAfter(this.premiumExpired);
106
+ },
107
+ })
108
+ readonly hasPremiumAccount: string;
168
109
 
169
- @Prop({ default: [] })
170
- achievements: Array<string>;
110
+ @Virtual({
111
+ get: function (this: User) {
112
+ return this.fullNameAlias || this.fullName;
113
+ },
114
+ })
115
+ readonly publicFullName: string;
171
116
 
117
+ @Virtual({
118
+ get: function (this: User) {
119
+ return this.avatarAliasUrl || this.avatarUrl;
120
+ },
121
+ })
122
+ readonly publicAvatarUrl: string;
172
123
 
173
- hasAchievement(achievementCode: string): boolean {
174
- return this.achievements.some((item) => item === achievementCode);
175
- }
124
+ @Virtual({
125
+ get: function (this: User) {
126
+ if (this.yaUser) {
127
+ return AccountTypeEnum.YA;
128
+ } else if (this.vkUser) {
129
+ return AccountTypeEnum.VK;
130
+ } else if (this.okUser) {
131
+ return AccountTypeEnum.OK;
132
+ } else if (this.fbUser) {
133
+ return AccountTypeEnum.FB;
134
+ } else if (this.googleUser) {
135
+ return AccountTypeEnum.GOOGLE;
136
+ }
137
+
138
+ return AccountTypeEnum.GUEST;
139
+ },
140
+ })
141
+ readonly accountType: string;
176
142
 
177
- hasNoAchievement(achievementCode: string): boolean {
178
- return !this.hasAchievement(achievementCode);
179
- }
143
+ @Virtual({
144
+ get: function (this: User) {
145
+ return this.accountType === AccountTypeEnum.GUEST || !!this.yaUser?.isGuest;
146
+ },
147
+ })
148
+ readonly isGuest: string;
180
149
  }
181
150
 
182
151
  export const UserSchema = SchemaFactory.createForClass(User);
@@ -0,0 +1,40 @@
1
+ import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
2
+ import { Document, HydratedDocument } from 'mongoose';
3
+
4
+ export type UsersAchievementDocument = HydratedDocument<UsersAchievement>;
5
+
6
+ @Schema({ collection: 'users_achievements' })
7
+ export class UsersAchievement {
8
+ @Virtual({
9
+ get: function (this: Document) {
10
+ return this._id.toString();
11
+ },
12
+ })
13
+ readonly usersAchievementId: string;
14
+
15
+ @Prop({ default: new Date() })
16
+ date: Date;
17
+
18
+ @Prop()
19
+ userId: string;
20
+
21
+ @Prop()
22
+ userName: string;
23
+
24
+ @Prop()
25
+ achievementId: string;
26
+
27
+ @Prop()
28
+ achievementTitle: string;
29
+
30
+ @Prop()
31
+ achievementCode: string;
32
+
33
+ @Prop()
34
+ achievementPrize: number;
35
+
36
+ @Prop()
37
+ game: string;
38
+ }
39
+
40
+ export const UsersAchievementSchema = SchemaFactory.createForClass(UsersAchievement);
@@ -0,0 +1,34 @@
1
+ import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
2
+ import { Document, HydratedDocument } from 'mongoose';
3
+
4
+ export type UsersBalanceDocument = HydratedDocument<UsersBalance>;
5
+
6
+ @Schema({ collection: 'users_balances' })
7
+ export class UsersBalance {
8
+ @Virtual({
9
+ get: function (this: Document) {
10
+ return this._id.toString();
11
+ },
12
+ })
13
+ readonly usersBalanceId: string;
14
+
15
+ @Prop({ default: new Date() })
16
+ date: Date;
17
+
18
+ @Prop()
19
+ userId: string;
20
+
21
+ @Prop()
22
+ userName: string;
23
+
24
+ @Prop()
25
+ amount: number;
26
+
27
+ @Prop()
28
+ reason: string;
29
+
30
+ @Prop()
31
+ game: string;
32
+ }
33
+
34
+ export const UsersBalanceSchema = SchemaFactory.createForClass(UsersBalance);
@@ -1,11 +0,0 @@
1
- export interface IActivityLogUserLogin {
2
- id: string;
3
- userId: string;
4
- userName: string;
5
- event: string;
6
- game: string;
7
- channel: string;
8
- count: number;
9
- date: string;
10
- }
11
- //# sourceMappingURL=activity-log-user-login.interface%20copy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"activity-log-user-login.interface copy.d.ts","sourceRoot":"","sources":["../../src/models/activity-log-user-login.interface copy.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=activity-log-user-login.interface%20copy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"activity-log-user-login.interface copy.js","sourceRoot":"","sources":["../../src/models/activity-log-user-login.interface copy.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import { Model } from 'mongoose';
2
- import { BalanceHistory, BalanceHistoryDocument } from '../';
3
- export declare class BalanceHistoryRepository {
4
- private balanceHistoryModel;
5
- constructor(balanceHistoryModel: Model<BalanceHistoryDocument>);
6
- createBalanceHistory(gameResult: Partial<BalanceHistory>): Promise<BalanceHistory>;
7
- }
8
- //# sourceMappingURL=balance-history.repository.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"balance-history.repository.d.ts","sourceRoot":"","sources":["../../src/repositories/balance-history.repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAE7D,qBACa,wBAAwB;IACc,OAAO,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,KAAK,CAAC,sBAAsB,CAAC;IAG5F,oBAAoB,CAAE,UAAU,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;CAGnG"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.BalanceHistoryRepository = void 0;
16
- const common_1 = require("@nestjs/common");
17
- const mongoose_1 = require("@nestjs/mongoose");
18
- const mongoose_2 = require("mongoose");
19
- const __1 = require("../");
20
- let BalanceHistoryRepository = class BalanceHistoryRepository {
21
- constructor(balanceHistoryModel) {
22
- this.balanceHistoryModel = balanceHistoryModel;
23
- }
24
- async createBalanceHistory(gameResult) {
25
- return this.balanceHistoryModel.create(gameResult);
26
- }
27
- };
28
- exports.BalanceHistoryRepository = BalanceHistoryRepository;
29
- exports.BalanceHistoryRepository = BalanceHistoryRepository = __decorate([
30
- (0, common_1.Injectable)(),
31
- __param(0, (0, mongoose_1.InjectModel)(__1.BalanceHistory.name)),
32
- __metadata("design:paramtypes", [mongoose_2.Model])
33
- ], BalanceHistoryRepository);
34
- //# sourceMappingURL=balance-history.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"balance-history.repository.js","sourceRoot":"","sources":["../../src/repositories/balance-history.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAA+C;AAC/C,uCAAiC;AAEjC,2BAA6D;AAGtD,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACjC,YAAuD,mBAAkD;QAAlD,wBAAmB,GAAnB,mBAAmB,CAA+B;IACzG,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAE,UAAmC;QAClE,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC;CACJ,CAAA;AAPY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;IAEK,WAAA,IAAA,sBAAW,EAAC,kBAAc,CAAC,IAAI,CAAC,CAAA;qCAA8B,gBAAK;GADxE,wBAAwB,CAOpC"}
@@ -1,105 +0,0 @@
1
- import { Document, HydratedDocument } from 'mongoose';
2
- export type BalanceHistoryDocument = HydratedDocument<BalanceHistory>;
3
- export declare class BalanceHistory {
4
- readonly balanceHistoryId: string;
5
- date: Date;
6
- gameType: string;
7
- roomId: string;
8
- gameId: string;
9
- reason: string;
10
- balance: number;
11
- balanceAdding: number;
12
- }
13
- export declare const BalanceHistorySchema: import("mongoose").Schema<BalanceHistory, import("mongoose").Model<BalanceHistory, any, any, any, (Document<unknown, any, BalanceHistory, any, import("mongoose").DefaultSchemaOptions> & BalanceHistory & {
14
- _id: import("mongoose").Types.ObjectId;
15
- } & {
16
- __v: number;
17
- } & {
18
- id: string;
19
- }) | (Document<unknown, any, BalanceHistory, any, import("mongoose").DefaultSchemaOptions> & BalanceHistory & {
20
- _id: import("mongoose").Types.ObjectId;
21
- } & {
22
- __v: number;
23
- }), any, BalanceHistory>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, BalanceHistory, Document<unknown, {}, BalanceHistory, {
24
- id: string;
25
- }, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<BalanceHistory & {
26
- _id: import("mongoose").Types.ObjectId;
27
- } & {
28
- __v: number;
29
- }, "id"> & {
30
- id: string;
31
- }, {
32
- readonly balanceHistoryId?: import("mongoose").SchemaDefinitionProperty<string, BalanceHistory, Document<unknown, {}, BalanceHistory, {
33
- id: string;
34
- }, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<BalanceHistory & {
35
- _id: import("mongoose").Types.ObjectId;
36
- } & {
37
- __v: number;
38
- }, "id"> & {
39
- id: string;
40
- }>;
41
- date?: import("mongoose").SchemaDefinitionProperty<Date, BalanceHistory, Document<unknown, {}, BalanceHistory, {
42
- id: string;
43
- }, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<BalanceHistory & {
44
- _id: import("mongoose").Types.ObjectId;
45
- } & {
46
- __v: number;
47
- }, "id"> & {
48
- id: string;
49
- }>;
50
- gameType?: import("mongoose").SchemaDefinitionProperty<string, BalanceHistory, Document<unknown, {}, BalanceHistory, {
51
- id: string;
52
- }, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<BalanceHistory & {
53
- _id: import("mongoose").Types.ObjectId;
54
- } & {
55
- __v: number;
56
- }, "id"> & {
57
- id: string;
58
- }>;
59
- roomId?: import("mongoose").SchemaDefinitionProperty<string, BalanceHistory, Document<unknown, {}, BalanceHistory, {
60
- id: string;
61
- }, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<BalanceHistory & {
62
- _id: import("mongoose").Types.ObjectId;
63
- } & {
64
- __v: number;
65
- }, "id"> & {
66
- id: string;
67
- }>;
68
- gameId?: import("mongoose").SchemaDefinitionProperty<string, BalanceHistory, Document<unknown, {}, BalanceHistory, {
69
- id: string;
70
- }, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<BalanceHistory & {
71
- _id: import("mongoose").Types.ObjectId;
72
- } & {
73
- __v: number;
74
- }, "id"> & {
75
- id: string;
76
- }>;
77
- reason?: import("mongoose").SchemaDefinitionProperty<string, BalanceHistory, Document<unknown, {}, BalanceHistory, {
78
- id: string;
79
- }, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<BalanceHistory & {
80
- _id: import("mongoose").Types.ObjectId;
81
- } & {
82
- __v: number;
83
- }, "id"> & {
84
- id: string;
85
- }>;
86
- balance?: import("mongoose").SchemaDefinitionProperty<number, BalanceHistory, Document<unknown, {}, BalanceHistory, {
87
- id: string;
88
- }, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<BalanceHistory & {
89
- _id: import("mongoose").Types.ObjectId;
90
- } & {
91
- __v: number;
92
- }, "id"> & {
93
- id: string;
94
- }>;
95
- balanceAdding?: import("mongoose").SchemaDefinitionProperty<number, BalanceHistory, Document<unknown, {}, BalanceHistory, {
96
- id: string;
97
- }, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<BalanceHistory & {
98
- _id: import("mongoose").Types.ObjectId;
99
- } & {
100
- __v: number;
101
- }, "id"> & {
102
- id: string;
103
- }>;
104
- }, BalanceHistory>;
105
- //# sourceMappingURL=balance_history.schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"balance_history.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/balance_history.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEtD,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC;AAEtE,qBACa,cAAc;IAMvB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAGlC,IAAI,EAAE,IAAI,CAAC;IAGX,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,EAAE,MAAM,CAAC;IAGhB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAA+C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"balance_history.schema.js","sourceRoot":"","sources":["../../src/schemas/balance_history.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAwE;AAMjE,IAAM,cAAc,GAApB,MAAM,cAAc;CA4B1B,CAAA;AA5BY,wCAAc;AAMd;IALR,IAAA,kBAAO,EAAC;QACL,GAAG,EAAE;YACD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC/B,CAAC;KACJ,CAAC;;wDACgC;AAGlC;IADC,IAAA,eAAI,GAAE;8BACD,IAAI;4CAAC;AAGX;IADC,IAAA,eAAI,GAAE;;gDACU;AAGjB;IADC,IAAA,eAAI,GAAE;;8CACQ;AAGf;IADC,IAAA,eAAI,GAAE;;8CACQ;AAGf;IADC,IAAA,eAAI,GAAE;;8CACQ;AAGf;IADC,IAAA,eAAI,GAAE;;+CACS;AAGhB;IADC,IAAA,eAAI,GAAE;;qDACe;yBA3Bb,cAAc;IAD1B,IAAA,iBAAM,EAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC;GAC7B,cAAc,CA4B1B;AAEY,QAAA,oBAAoB,GAAG,wBAAa,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- export interface IActivityLogUserLogin {
2
- id: string;
3
- userId: string;
4
- userName: string;
5
- event: string;
6
- game: string;
7
- channel: string;
8
- count: number;
9
- date: string;
10
- }
@@ -1,15 +0,0 @@
1
- import { Injectable } from '@nestjs/common';
2
- import { InjectModel } from '@nestjs/mongoose';
3
- import { Model } from 'mongoose';
4
-
5
- import { BalanceHistory, BalanceHistoryDocument } from '../';
6
-
7
- @Injectable()
8
- export class BalanceHistoryRepository {
9
- constructor (@InjectModel(BalanceHistory.name) private balanceHistoryModel: Model<BalanceHistoryDocument>) {
10
- }
11
-
12
- public async createBalanceHistory (gameResult: Partial<BalanceHistory>): Promise<BalanceHistory> {
13
- return this.balanceHistoryModel.create(gameResult);
14
- }
15
- }
@@ -1,37 +0,0 @@
1
- import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
2
- import { Document, HydratedDocument } from 'mongoose';
3
-
4
- export type BalanceHistoryDocument = HydratedDocument<BalanceHistory>;
5
-
6
- @Schema({ collection: 'balance_history' })
7
- export class BalanceHistory {
8
- @Virtual({
9
- get: function (this: Document) {
10
- return this._id.toString();
11
- },
12
- })
13
- readonly balanceHistoryId: string;
14
-
15
- @Prop()
16
- date: Date;
17
-
18
- @Prop()
19
- gameType: string;
20
-
21
- @Prop()
22
- roomId: string;
23
-
24
- @Prop()
25
- gameId: string;
26
-
27
- @Prop()
28
- reason: string;
29
-
30
- @Prop()
31
- balance: number;
32
-
33
- @Prop()
34
- balanceAdding: number;
35
- }
36
-
37
- export const BalanceHistorySchema = SchemaFactory.createForClass(BalanceHistory);