jp.db.schemas 2.2.14 → 2.2.16

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 (112) hide show
  1. package/dist/repositories/menu.repository.d.ts.map +1 -1
  2. package/dist/repositories/menu.repository.js +1 -0
  3. package/dist/repositories/menu.repository.js.map +1 -1
  4. package/dist/repositories/products.repository.d.ts.map +1 -1
  5. package/dist/repositories/products.repository.js +1 -0
  6. package/dist/repositories/products.repository.js.map +1 -1
  7. package/dist/repositories/rating.repository.d.ts +1 -1
  8. package/dist/repositories/rating.repository.d.ts.map +1 -1
  9. package/dist/repositories/rating.repository.js +0 -2
  10. package/dist/repositories/rating.repository.js.map +1 -1
  11. package/dist/repositories/setting.repository.d.ts.map +1 -1
  12. package/dist/repositories/setting.repository.js +1 -0
  13. package/dist/repositories/setting.repository.js.map +1 -1
  14. package/dist/repositories/users.repository.d.ts +1 -0
  15. package/dist/repositories/users.repository.d.ts.map +1 -1
  16. package/dist/repositories/users.repository.js +18 -0
  17. package/dist/repositories/users.repository.js.map +1 -1
  18. package/dist/schemas/activity_log.schema.js +1 -1
  19. package/dist/schemas/activity_log.schema.js.map +1 -1
  20. package/dist/schemas/purchase.schema.js +1 -1
  21. package/dist/schemas/purchase.schema.js.map +1 -1
  22. package/dist/schemas/rating.schema.d.ts +2 -12
  23. package/dist/schemas/rating.schema.d.ts.map +1 -1
  24. package/dist/schemas/rating.schema.js +1 -5
  25. package/dist/schemas/rating.schema.js.map +1 -1
  26. package/dist/schemas/user.schema.js +2 -2
  27. package/dist/schemas/user.schema.js.map +1 -1
  28. package/dist/schemas/users_achievement.schema.js +1 -1
  29. package/dist/schemas/users_achievement.schema.js.map +1 -1
  30. package/dist/schemas/users_balance.schema.js +1 -1
  31. package/dist/schemas/users_balance.schema.js.map +1 -1
  32. package/package.json +37 -37
  33. package/readme.md +3 -3
  34. package/src/index.ts +277 -277
  35. package/src/models/account-type.enum.ts +8 -8
  36. package/src/models/activity-log-user-login.interface.ts +10 -10
  37. package/src/models/activity-log.enum.ts +8 -8
  38. package/src/models/currency.enum.ts +6 -6
  39. package/src/models/experiences-level-edge.enum.ts +4 -4
  40. package/src/models/experiences-level-rank.enum.ts +5 -5
  41. package/src/models/rating-add-bulk-item.interface.ts +7 -7
  42. package/src/models/rating-monthly-result.interface.ts +12 -12
  43. package/src/models/tournament-participant.interface.ts +5 -5
  44. package/src/models/tournament-status.enum.ts +6 -6
  45. package/src/models/tournament-template.enum.ts +3 -3
  46. package/src/models/tournament-winner.interface.ts +7 -7
  47. package/src/models/users-balance-reason.enum.ts +8 -8
  48. package/src/repositories/achievement.repository.ts +22 -22
  49. package/src/repositories/activity-log.repository.ts +209 -209
  50. package/src/repositories/admin.repository.ts +20 -20
  51. package/src/repositories/article.repository.ts +24 -24
  52. package/src/repositories/banners.repository.ts +67 -67
  53. package/src/repositories/complains.repository.ts +31 -31
  54. package/src/repositories/daily-bonus.repository.ts +33 -33
  55. package/src/repositories/friend.repository.ts +16 -16
  56. package/src/repositories/game-result.repository.ts +19 -19
  57. package/src/repositories/game-statistic.repository.ts +22 -22
  58. package/src/repositories/index.ts +57 -57
  59. package/src/repositories/many-tables-tournament-rooms.repository.ts +167 -167
  60. package/src/repositories/menu.repository.ts +21 -20
  61. package/src/repositories/notification.repository.ts +59 -59
  62. package/src/repositories/one-table-tournament-rooms.repository.ts +142 -142
  63. package/src/repositories/premium.repository.ts +22 -22
  64. package/src/repositories/products.repository.ts +33 -32
  65. package/src/repositories/purchase.repository.ts +111 -111
  66. package/src/repositories/rating.repository.ts +77 -79
  67. package/src/repositories/rule.repository.ts +20 -20
  68. package/src/repositories/servers.repository.ts +16 -16
  69. package/src/repositories/setting.repository.ts +26 -25
  70. package/src/repositories/settings-options.repository.ts +17 -17
  71. package/src/repositories/simple-rooms.repository.ts +16 -16
  72. package/src/repositories/users-achievements.repository.ts +46 -46
  73. package/src/repositories/users-balances.repository.ts +65 -65
  74. package/src/repositories/users.repository.ts +179 -153
  75. package/src/repositories/welcome.repository.ts +22 -22
  76. package/src/schemas/achievement.schema.ts +34 -34
  77. package/src/schemas/activity_log.schema.ts +37 -37
  78. package/src/schemas/admin.schema.ts +22 -22
  79. package/src/schemas/article.schema.ts +37 -37
  80. package/src/schemas/banner.schema.ts +37 -37
  81. package/src/schemas/channel_message.schema.ts +32 -32
  82. package/src/schemas/complain.schema.ts +46 -46
  83. package/src/schemas/daily_bonus.schema.ts +46 -46
  84. package/src/schemas/feature.schema.ts +28 -28
  85. package/src/schemas/friend.schema.ts +46 -46
  86. package/src/schemas/game_result.schema.ts +68 -68
  87. package/src/schemas/game_statistic.schema.ts +34 -34
  88. package/src/schemas/many_tables_tournament_rooms.schema.ts +87 -87
  89. package/src/schemas/menu.schema.ts +37 -37
  90. package/src/schemas/notification.schema.ts +61 -61
  91. package/src/schemas/one_table_tournament_rooms.schema.ts +84 -84
  92. package/src/schemas/premium.schema.ts +34 -34
  93. package/src/schemas/product.schema.ts +111 -111
  94. package/src/schemas/purchase.schema.ts +61 -61
  95. package/src/schemas/purchase_channel.schema.ts +32 -32
  96. package/src/schemas/rating.schema.ts +34 -37
  97. package/src/schemas/rule.schema.ts +34 -34
  98. package/src/schemas/server.schema.ts +22 -22
  99. package/src/schemas/setting.schema.ts +49 -49
  100. package/src/schemas/settings_option.schema.ts +41 -41
  101. package/src/schemas/simple_rooms.schema.ts +49 -49
  102. package/src/schemas/user.fb.schema.ts +33 -33
  103. package/src/schemas/user.google.schema.ts +24 -24
  104. package/src/schemas/user.ok.schema.ts +53 -53
  105. package/src/schemas/user.schema.ts +185 -185
  106. package/src/schemas/user.tg.schema.ts +30 -30
  107. package/src/schemas/user.vk.schema.ts +70 -70
  108. package/src/schemas/user.ya.schema.ts +24 -24
  109. package/src/schemas/users_achievement.schema.ts +41 -41
  110. package/src/schemas/users_balance.schema.ts +34 -34
  111. package/src/schemas/welcome.schema.ts +37 -37
  112. package/src/utils.ts +7 -7
@@ -1,185 +1,185 @@
1
- import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
2
- import { Document, HydratedDocument } from 'mongoose';
3
- import dayjs from 'dayjs';
4
-
5
- import { AccountTypeEnum } from '../models/account-type.enum';
6
-
7
- import { VKUser } from './user.vk.schema';
8
- import { OKUser } from './user.ok.schema';
9
- import { YAUser } from './user.ya.schema';
10
- import { TGUser } from './user.tg.schema';
11
- import { GoogleUser } from './user.google.schema';
12
- import { FBUser } from './user.fb.schema';
13
- import { ExperiencesLevelEdgeEnum } from '../models/experiences-level-edge.enum';
14
- import { ExperiencesLevelRankEnum } from '../models/experiences-level-rank.enum';
15
-
16
- export type UserDocument = HydratedDocument<User>;
17
-
18
- @Schema()
19
- export class User {
20
- @Virtual({
21
- get: function (this: Document) {
22
- return this._id.toString();
23
- },
24
- })
25
- readonly userId: string;
26
-
27
- @Prop({ required: true })
28
- fullName: string;
29
-
30
- @Prop({ required: true })
31
- balance: number;
32
-
33
- @Prop({ required: true })
34
- avatarUrl: string;
35
-
36
- @Prop({ default: new Date() })
37
- registerDate: Date;
38
-
39
- @Prop({ required: true })
40
- premiumExpired: Date;
41
-
42
- // settings
43
-
44
- @Prop({ default: '' })
45
- fullNameAlias: string;
46
-
47
- @Prop({ default: '' })
48
- avatarAliasUrl: string;
49
-
50
- @Prop({ default: '' })
51
- avatar: string;
52
-
53
- @Prop({ default: 'theme__light' })
54
- theme: string;
55
-
56
- @Prop({ default: 'language__ru' })
57
- language: string;
58
-
59
- @Prop({ default: 'avatar_frame__default' })
60
- avatarFrame: string;
61
-
62
- @Prop({ default: 'card_skin__default' })
63
- cardSkin: string;
64
-
65
- @Prop({ default: 'game_sounds__on' })
66
- gameSounds: string;
67
-
68
- @Prop({ default: 'bg_pattern__default' })
69
- bgPattern: string;
70
-
71
- @Prop({ default: 'room_table__on' })
72
- roomTable: string;
73
-
74
- @Prop({ default: 'color_schema__default' })
75
- colorSchema: string;
76
-
77
- @Prop({ default: 0 })
78
- experience: number;
79
-
80
- @Prop({ default: 1 })
81
- level: number;
82
-
83
- // users
84
-
85
- @Prop({ type: VKUser })
86
- vkUser?: VKUser;
87
-
88
- @Prop({ type: OKUser })
89
- okUser?: OKUser;
90
-
91
- @Prop({ type: YAUser })
92
- yaUser?: YAUser;
93
-
94
- @Prop({ type: GoogleUser })
95
- googleUser?: GoogleUser;
96
-
97
- @Prop({ type: FBUser })
98
- fbUser?: FBUser;
99
-
100
- @Prop({ type: TGUser })
101
- tgUser?: TGUser;
102
-
103
- // virtuals
104
-
105
- @Virtual({
106
- get: function (this: User) {
107
- return dayjs().isAfter(this.premiumExpired);
108
- },
109
- })
110
- readonly hasPremiumAccount: boolean;
111
-
112
- @Virtual({
113
- get: function (this: User) {
114
- return this.fullNameAlias || this.fullName;
115
- },
116
- })
117
- readonly publicFullName: string;
118
-
119
- @Virtual({
120
- get: function (this: User) {
121
- return this.avatarAliasUrl || this.avatarUrl;
122
- },
123
- })
124
- readonly publicAvatarUrl: string;
125
-
126
- @Virtual({
127
- get: function (this: User) {
128
- if (this.yaUser) {
129
- return AccountTypeEnum.YA;
130
- } else if (this.vkUser) {
131
- return AccountTypeEnum.VK;
132
- } else if (this.okUser) {
133
- return AccountTypeEnum.OK;
134
- } else if (this.fbUser) {
135
- return AccountTypeEnum.FB;
136
- } else if (this.googleUser) {
137
- return AccountTypeEnum.GOOGLE;
138
- }
139
-
140
- return AccountTypeEnum.GUEST;
141
- },
142
- })
143
- readonly accountType: string;
144
-
145
- @Virtual({
146
- get: function (this: User) {
147
- return (
148
- this.accountType === AccountTypeEnum.GUEST || !!this.yaUser?.isGuest
149
- );
150
- },
151
- })
152
- readonly isGuest: boolean;
153
-
154
- @Virtual({
155
- get: function (this: User) {
156
- return this.language.replace('language__', '');
157
- },
158
- })
159
- readonly normalizedLang: string;
160
-
161
- @Virtual({
162
- get: function (this: User) {
163
- if (this.level < ExperiencesLevelEdgeEnum.PLAYER) {
164
- return ExperiencesLevelRankEnum.NEW;
165
- } else if (
166
- this.level >= ExperiencesLevelEdgeEnum.PLAYER &&
167
- this.level < ExperiencesLevelEdgeEnum.PROFI
168
- ) {
169
- return ExperiencesLevelRankEnum.PLAYER;
170
- } else {
171
- return ExperiencesLevelRankEnum.PROFI;
172
- }
173
- },
174
- })
175
- readonly levelRank: string;
176
-
177
- @Virtual({
178
- get: function (this: User) {
179
- return this.gameSounds === 'game_sounds__on';
180
- },
181
- })
182
- readonly gameSoundsOn: boolean;
183
- }
184
-
185
- export const UserSchema = SchemaFactory.createForClass(User);
1
+ import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
2
+ import { Document, HydratedDocument } from 'mongoose';
3
+ import dayjs from 'dayjs';
4
+
5
+ import { AccountTypeEnum } from '../models/account-type.enum';
6
+
7
+ import { VKUser } from './user.vk.schema';
8
+ import { OKUser } from './user.ok.schema';
9
+ import { YAUser } from './user.ya.schema';
10
+ import { TGUser } from './user.tg.schema';
11
+ import { GoogleUser } from './user.google.schema';
12
+ import { FBUser } from './user.fb.schema';
13
+ import { ExperiencesLevelEdgeEnum } from '../models/experiences-level-edge.enum';
14
+ import { ExperiencesLevelRankEnum } from '../models/experiences-level-rank.enum';
15
+
16
+ export type UserDocument = HydratedDocument<User>;
17
+
18
+ @Schema()
19
+ export class User {
20
+ @Virtual({
21
+ get: function (this: Document) {
22
+ return this._id.toString();
23
+ },
24
+ })
25
+ readonly userId: string;
26
+
27
+ @Prop({ required: true })
28
+ fullName: string;
29
+
30
+ @Prop({ required: true })
31
+ balance: number;
32
+
33
+ @Prop({ required: true })
34
+ avatarUrl: string;
35
+
36
+ @Prop({ default: Date.now })
37
+ registerDate: Date;
38
+
39
+ @Prop({ required: true })
40
+ premiumExpired: Date;
41
+
42
+ // settings
43
+
44
+ @Prop({ default: '' })
45
+ fullNameAlias: string;
46
+
47
+ @Prop({ default: '' })
48
+ avatarAliasUrl: string;
49
+
50
+ @Prop({ default: '' })
51
+ avatar: string;
52
+
53
+ @Prop({ default: 'theme__light' })
54
+ theme: string;
55
+
56
+ @Prop({ default: 'language__ru' })
57
+ language: string;
58
+
59
+ @Prop({ default: 'avatar_frame__default' })
60
+ avatarFrame: string;
61
+
62
+ @Prop({ default: 'card_skin__default' })
63
+ cardSkin: string;
64
+
65
+ @Prop({ default: 'game_sounds__on' })
66
+ gameSounds: string;
67
+
68
+ @Prop({ default: 'bg_pattern__default' })
69
+ bgPattern: string;
70
+
71
+ @Prop({ default: 'room_table__on' })
72
+ roomTable: string;
73
+
74
+ @Prop({ default: 'color_schema__default' })
75
+ colorSchema: string;
76
+
77
+ @Prop({ default: 0 })
78
+ experience: number;
79
+
80
+ @Prop({ default: 1 })
81
+ level: number;
82
+
83
+ // users
84
+
85
+ @Prop({ type: VKUser })
86
+ vkUser?: VKUser;
87
+
88
+ @Prop({ type: OKUser })
89
+ okUser?: OKUser;
90
+
91
+ @Prop({ type: YAUser })
92
+ yaUser?: YAUser;
93
+
94
+ @Prop({ type: GoogleUser })
95
+ googleUser?: GoogleUser;
96
+
97
+ @Prop({ type: FBUser })
98
+ fbUser?: FBUser;
99
+
100
+ @Prop({ type: TGUser })
101
+ tgUser?: TGUser;
102
+
103
+ // virtuals
104
+
105
+ @Virtual({
106
+ get: function (this: User) {
107
+ return dayjs().isBefore(this.premiumExpired);
108
+ },
109
+ })
110
+ readonly hasPremiumAccount: boolean;
111
+
112
+ @Virtual({
113
+ get: function (this: User) {
114
+ return this.fullNameAlias || this.fullName;
115
+ },
116
+ })
117
+ readonly publicFullName: string;
118
+
119
+ @Virtual({
120
+ get: function (this: User) {
121
+ return this.avatarAliasUrl || this.avatarUrl;
122
+ },
123
+ })
124
+ readonly publicAvatarUrl: string;
125
+
126
+ @Virtual({
127
+ get: function (this: User) {
128
+ if (this.yaUser) {
129
+ return AccountTypeEnum.YA;
130
+ } else if (this.vkUser) {
131
+ return AccountTypeEnum.VK;
132
+ } else if (this.okUser) {
133
+ return AccountTypeEnum.OK;
134
+ } else if (this.fbUser) {
135
+ return AccountTypeEnum.FB;
136
+ } else if (this.googleUser) {
137
+ return AccountTypeEnum.GOOGLE;
138
+ }
139
+
140
+ return AccountTypeEnum.GUEST;
141
+ },
142
+ })
143
+ readonly accountType: string;
144
+
145
+ @Virtual({
146
+ get: function (this: User) {
147
+ return (
148
+ this.accountType === AccountTypeEnum.GUEST || !!this.yaUser?.isGuest
149
+ );
150
+ },
151
+ })
152
+ readonly isGuest: boolean;
153
+
154
+ @Virtual({
155
+ get: function (this: User) {
156
+ return this.language.replace('language__', '');
157
+ },
158
+ })
159
+ readonly normalizedLang: string;
160
+
161
+ @Virtual({
162
+ get: function (this: User) {
163
+ if (this.level < ExperiencesLevelEdgeEnum.PLAYER) {
164
+ return ExperiencesLevelRankEnum.NEW;
165
+ } else if (
166
+ this.level >= ExperiencesLevelEdgeEnum.PLAYER &&
167
+ this.level < ExperiencesLevelEdgeEnum.PROFI
168
+ ) {
169
+ return ExperiencesLevelRankEnum.PLAYER;
170
+ } else {
171
+ return ExperiencesLevelRankEnum.PROFI;
172
+ }
173
+ },
174
+ })
175
+ readonly levelRank: string;
176
+
177
+ @Virtual({
178
+ get: function (this: User) {
179
+ return this.gameSounds === 'game_sounds__on';
180
+ },
181
+ })
182
+ readonly gameSoundsOn: boolean;
183
+ }
184
+
185
+ export const UserSchema = SchemaFactory.createForClass(User);
@@ -1,30 +1,30 @@
1
- import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
- import { HydratedDocument } from 'mongoose';
3
-
4
- export type TGUserDocument = HydratedDocument<TGUser>;
5
-
6
- @Schema()
7
- export class TGUser {
8
- @Prop()
9
- id: number;
10
-
11
- @Prop()
12
- firstName: string;
13
-
14
- @Prop()
15
- lastName?: string;
16
-
17
- @Prop()
18
- username?: string;
19
-
20
- @Prop()
21
- languageCode?: string;
22
-
23
- @Prop()
24
- photoUrl?: string;
25
-
26
- @Prop()
27
- allowsWriteToPm?: boolean;
28
- }
29
-
30
- export const TGUserSchema = SchemaFactory.createForClass(TGUser);
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument } from 'mongoose';
3
+
4
+ export type TGUserDocument = HydratedDocument<TGUser>;
5
+
6
+ @Schema()
7
+ export class TGUser {
8
+ @Prop()
9
+ id: number;
10
+
11
+ @Prop()
12
+ firstName: string;
13
+
14
+ @Prop()
15
+ lastName?: string;
16
+
17
+ @Prop()
18
+ username?: string;
19
+
20
+ @Prop()
21
+ languageCode?: string;
22
+
23
+ @Prop()
24
+ photoUrl?: string;
25
+
26
+ @Prop()
27
+ allowsWriteToPm?: boolean;
28
+ }
29
+
30
+ export const TGUserSchema = SchemaFactory.createForClass(TGUser);
@@ -1,70 +1,70 @@
1
- import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
- import { HydratedDocument } from 'mongoose';
3
-
4
- export type VKUserCityDocument = HydratedDocument<VKUserCity>;
5
-
6
- @Schema()
7
- export class VKUserCity {
8
- @Prop()
9
- id: number;
10
-
11
- @Prop()
12
- title: string;
13
- }
14
-
15
- export const VKUserCitySchema = SchemaFactory.createForClass(VKUserCity);
16
-
17
- export type VKUserDocument = HydratedDocument<VKUser>;
18
-
19
- @Schema()
20
- export class VKUser {
21
- @Prop()
22
- id: number;
23
-
24
- @Prop()
25
- first_name: string;
26
-
27
- @Prop()
28
- last_name: string;
29
-
30
- @Prop()
31
- sex: number;
32
-
33
- @Prop()
34
- bdate: string;
35
-
36
- @Prop()
37
- city: VKUserCity;
38
-
39
- @Prop()
40
- country: VKUserCity;
41
-
42
- @Prop()
43
- photo_100: string;
44
-
45
- @Prop()
46
- photo_200: string;
47
-
48
- @Prop()
49
- photo_max_orig: string;
50
-
51
- @Prop()
52
- timezone: number;
53
-
54
- @Prop()
55
- is_closed: boolean;
56
-
57
- @Prop()
58
- can_access_closed: boolean;
59
-
60
- @Prop()
61
- can_invite_to_chats: boolean;
62
-
63
- @Prop()
64
- is_app_ios: boolean;
65
-
66
- @Prop()
67
- is_vk_user_id?: boolean;
68
- }
69
-
70
- export const VKUserSchema = SchemaFactory.createForClass(VKUser);
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument } from 'mongoose';
3
+
4
+ export type VKUserCityDocument = HydratedDocument<VKUserCity>;
5
+
6
+ @Schema()
7
+ export class VKUserCity {
8
+ @Prop()
9
+ id: number;
10
+
11
+ @Prop()
12
+ title: string;
13
+ }
14
+
15
+ export const VKUserCitySchema = SchemaFactory.createForClass(VKUserCity);
16
+
17
+ export type VKUserDocument = HydratedDocument<VKUser>;
18
+
19
+ @Schema()
20
+ export class VKUser {
21
+ @Prop()
22
+ id: number;
23
+
24
+ @Prop()
25
+ first_name: string;
26
+
27
+ @Prop()
28
+ last_name: string;
29
+
30
+ @Prop()
31
+ sex: number;
32
+
33
+ @Prop()
34
+ bdate: string;
35
+
36
+ @Prop()
37
+ city: VKUserCity;
38
+
39
+ @Prop()
40
+ country: VKUserCity;
41
+
42
+ @Prop()
43
+ photo_100: string;
44
+
45
+ @Prop()
46
+ photo_200: string;
47
+
48
+ @Prop()
49
+ photo_max_orig: string;
50
+
51
+ @Prop()
52
+ timezone: number;
53
+
54
+ @Prop()
55
+ is_closed: boolean;
56
+
57
+ @Prop()
58
+ can_access_closed: boolean;
59
+
60
+ @Prop()
61
+ can_invite_to_chats: boolean;
62
+
63
+ @Prop()
64
+ is_app_ios: boolean;
65
+
66
+ @Prop()
67
+ is_vk_user_id?: boolean;
68
+ }
69
+
70
+ export const VKUserSchema = SchemaFactory.createForClass(VKUser);
@@ -1,24 +1,24 @@
1
- import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
- import { HydratedDocument } from 'mongoose';
3
-
4
- export type YAUserDocument = HydratedDocument<YAUser>;
5
-
6
- @Schema()
7
- export class YAUser {
8
- @Prop()
9
- userId: string;
10
-
11
- @Prop()
12
- fullName: string;
13
-
14
- @Prop()
15
- language: string;
16
-
17
- @Prop()
18
- avatarUrl: string;
19
-
20
- @Prop()
21
- isGuest: boolean;
22
- }
23
-
24
- export const YAUserSchema = SchemaFactory.createForClass(YAUser);
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument } from 'mongoose';
3
+
4
+ export type YAUserDocument = HydratedDocument<YAUser>;
5
+
6
+ @Schema()
7
+ export class YAUser {
8
+ @Prop()
9
+ userId: string;
10
+
11
+ @Prop()
12
+ fullName: string;
13
+
14
+ @Prop()
15
+ language: string;
16
+
17
+ @Prop()
18
+ avatarUrl: string;
19
+
20
+ @Prop()
21
+ isGuest: boolean;
22
+ }
23
+
24
+ export const YAUserSchema = SchemaFactory.createForClass(YAUser);