easywork-common-lib 1.0.991 → 1.0.993
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/entities/role.entity.d.ts +2 -0
- package/dist/entities/role.entity.js +13 -0
- package/dist/entities/role.entity.js.map +1 -1
- package/dist/entities/user.entity.d.ts +13 -10
- package/dist/entities/user.entity.js +70 -49
- package/dist/entities/user.entity.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EntityBase } from "../common/database/base.entity";
|
|
2
|
+
import { Permission } from "./permission.entity";
|
|
2
3
|
export declare class Role extends EntityBase {
|
|
3
4
|
name: string;
|
|
4
5
|
description: string;
|
|
@@ -7,6 +8,7 @@ export declare class Role extends EntityBase {
|
|
|
7
8
|
defaultMenuPermissions: string[];
|
|
8
9
|
allowedMenuPermissions: string[];
|
|
9
10
|
forbiddenMenuPermissions: string[];
|
|
11
|
+
permissions?: Permission[];
|
|
10
12
|
parentRole: Role;
|
|
11
13
|
level: number;
|
|
12
14
|
getEffectivePermissions(): string[];
|
|
@@ -14,6 +14,7 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
14
14
|
const base_entity_1 = require("../common/database/base.entity");
|
|
15
15
|
const class_validator_1 = require("class-validator");
|
|
16
16
|
const typeorm_1 = require("typeorm");
|
|
17
|
+
const permission_entity_1 = require("./permission.entity");
|
|
17
18
|
let Role = class Role extends base_entity_1.EntityBase {
|
|
18
19
|
name;
|
|
19
20
|
description;
|
|
@@ -22,6 +23,7 @@ let Role = class Role extends base_entity_1.EntityBase {
|
|
|
22
23
|
defaultMenuPermissions;
|
|
23
24
|
allowedMenuPermissions;
|
|
24
25
|
forbiddenMenuPermissions;
|
|
26
|
+
permissions;
|
|
25
27
|
parentRole;
|
|
26
28
|
level;
|
|
27
29
|
getEffectivePermissions() {
|
|
@@ -83,6 +85,17 @@ __decorate([
|
|
|
83
85
|
(0, typeorm_1.Column)({ type: "varchar", array: true, nullable: true }),
|
|
84
86
|
__metadata("design:type", Array)
|
|
85
87
|
], Role.prototype, "forbiddenMenuPermissions", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, swagger_1.ApiProperty)({
|
|
90
|
+
type: () => [permission_entity_1.Permission],
|
|
91
|
+
description: "Permissions associated with the role",
|
|
92
|
+
}),
|
|
93
|
+
(0, typeorm_1.ManyToMany)(() => permission_entity_1.Permission, {
|
|
94
|
+
onDelete: "CASCADE",
|
|
95
|
+
onUpdate: "CASCADE",
|
|
96
|
+
}),
|
|
97
|
+
__metadata("design:type", Array)
|
|
98
|
+
], Role.prototype, "permissions", void 0);
|
|
86
99
|
__decorate([
|
|
87
100
|
(0, swagger_1.ApiProperty)({
|
|
88
101
|
type: Role,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.entity.js","sourceRoot":"","sources":["../../src/entities/role.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,gEAA4D;AAC5D,qDAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"role.entity.js","sourceRoot":"","sources":["../../src/entities/role.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,gEAA4D;AAC5D,qDAA4C;AAC5C,qCAA4E;AAC5E,2DAAiD;AAG1C,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,wBAAU;IAIlC,IAAI,CAAS;IAIb,WAAW,CAAS;IAIpB,WAAW,CAAU;IAIrB,SAAS,CAAU;IAOnB,sBAAsB,CAAW;IAOjC,sBAAsB,CAAW;IAOjC,wBAAwB,CAAW;IAUnC,WAAW,CAAgB;IAS3B,UAAU,CAAO;IASjB,KAAK,CAAS;IAGd,uBAAuB;QACrB,IAAI,WAAW,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC,CAAC;QAG3D,IAAI,IAAI,CAAC,UAAU,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AAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC/D,IAAA,oBAAU,GAAE;8BACD,IAAI;wCAAC;AASjB;IANC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,mBAAmB;QAChC,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mCACb;eAjEH,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CAyFhB"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { Agent, Contact } from
|
|
2
|
-
import { Course, CourseAssigned } from
|
|
3
|
-
import { EntityBase } from
|
|
4
|
-
import { Group } from
|
|
5
|
-
import { MenuPermissions } from
|
|
6
|
-
import { Profile } from
|
|
7
|
-
import { PushToken } from
|
|
8
|
-
import { Role } from
|
|
9
|
-
import { Tag } from
|
|
10
|
-
import { UserStatus } from
|
|
1
|
+
import { Agent, Contact } from "./sales";
|
|
2
|
+
import { Course, CourseAssigned } from "./capacitation";
|
|
3
|
+
import { EntityBase } from "../common/database/base.entity";
|
|
4
|
+
import { Group } from "./group.entity";
|
|
5
|
+
import { MenuPermissions } from "./menu-permissions.entity";
|
|
6
|
+
import { Profile } from "./profile.entity";
|
|
7
|
+
import { PushToken } from "./notifications/push-token.entity";
|
|
8
|
+
import { Role } from "./role.entity";
|
|
9
|
+
import { Tag } from "./tag.entity";
|
|
10
|
+
import { UserStatus } from "../common/enums/tools.enum";
|
|
11
|
+
import { SubGroup } from "./subgroup.entity";
|
|
11
12
|
export declare class User extends EntityBase {
|
|
12
13
|
username: string;
|
|
13
14
|
email: string;
|
|
@@ -33,5 +34,7 @@ export declare class User extends EntityBase {
|
|
|
33
34
|
agentProfile?: Agent;
|
|
34
35
|
createdCourses?: Course[];
|
|
35
36
|
coursesAssigned?: CourseAssigned[];
|
|
37
|
+
supervisedSubGroups?: SubGroup[];
|
|
38
|
+
assistantSubGroups?: SubGroup[];
|
|
36
39
|
searchVector: string;
|
|
37
40
|
}
|
|
@@ -23,6 +23,7 @@ const push_token_entity_1 = require("./notifications/push-token.entity");
|
|
|
23
23
|
const role_entity_1 = require("./role.entity");
|
|
24
24
|
const tag_entity_1 = require("./tag.entity");
|
|
25
25
|
const tools_enum_1 = require("../common/enums/tools.enum");
|
|
26
|
+
const subgroup_entity_1 = require("./subgroup.entity");
|
|
26
27
|
let User = class User extends base_entity_1.EntityBase {
|
|
27
28
|
username;
|
|
28
29
|
email;
|
|
@@ -45,60 +46,62 @@ let User = class User extends base_entity_1.EntityBase {
|
|
|
45
46
|
cua;
|
|
46
47
|
contact;
|
|
47
48
|
get name() {
|
|
48
|
-
return `${this.profile?.firstName ??
|
|
49
|
+
return `${this.profile?.firstName ?? ""} ${this.profile?.lastName ?? ""}`.trim();
|
|
49
50
|
}
|
|
50
51
|
agentProfile;
|
|
51
52
|
createdCourses;
|
|
52
53
|
coursesAssigned;
|
|
54
|
+
supervisedSubGroups;
|
|
55
|
+
assistantSubGroups;
|
|
53
56
|
searchVector;
|
|
54
57
|
};
|
|
55
58
|
exports.User = User;
|
|
56
59
|
__decorate([
|
|
57
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
60
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "Unique username" }),
|
|
58
61
|
(0, typeorm_1.Column)({ unique: true }),
|
|
59
62
|
__metadata("design:type", String)
|
|
60
63
|
], User.prototype, "username", void 0);
|
|
61
64
|
__decorate([
|
|
62
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
65
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "Unique email address" }),
|
|
63
66
|
(0, typeorm_1.Column)({ unique: true }),
|
|
64
67
|
__metadata("design:type", String)
|
|
65
68
|
], User.prototype, "email", void 0);
|
|
66
69
|
__decorate([
|
|
67
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
68
|
-
(0, typeorm_1.Column)({ type:
|
|
70
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "User bio", nullable: true }),
|
|
71
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
69
72
|
__metadata("design:type", String)
|
|
70
73
|
], User.prototype, "bio", void 0);
|
|
71
74
|
__decorate([
|
|
72
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
73
|
-
(0, typeorm_1.Column)({ type:
|
|
75
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "User avatar URL", nullable: true }),
|
|
76
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
74
77
|
__metadata("design:type", String)
|
|
75
78
|
], User.prototype, "avatar", void 0);
|
|
76
79
|
__decorate([
|
|
77
|
-
(0, swagger_1.ApiProperty)({ enum: tools_enum_1.UserStatus, description:
|
|
78
|
-
(0, typeorm_1.Column)({ type:
|
|
80
|
+
(0, swagger_1.ApiProperty)({ enum: tools_enum_1.UserStatus, description: "User status" }),
|
|
81
|
+
(0, typeorm_1.Column)({ type: "enum", enum: tools_enum_1.UserStatus, default: tools_enum_1.UserStatus.offline }),
|
|
79
82
|
__metadata("design:type", String)
|
|
80
83
|
], User.prototype, "status", void 0);
|
|
81
84
|
__decorate([
|
|
82
|
-
(0, swagger_1.ApiProperty)({ enum: tools_enum_1.UserStatus, description:
|
|
83
|
-
(0, typeorm_1.Column)({ type:
|
|
85
|
+
(0, swagger_1.ApiProperty)({ enum: tools_enum_1.UserStatus, description: "User status" }),
|
|
86
|
+
(0, typeorm_1.Column)({ type: "enum", enum: tools_enum_1.UserStatus, default: tools_enum_1.UserStatus.working }),
|
|
84
87
|
__metadata("design:type", String)
|
|
85
88
|
], User.prototype, "savedStatus", void 0);
|
|
86
89
|
__decorate([
|
|
87
90
|
(0, class_transformer_1.Exclude)(),
|
|
88
91
|
(0, swagger_1.ApiProperty)({
|
|
89
92
|
type: String,
|
|
90
|
-
description:
|
|
93
|
+
description: "Password hash",
|
|
91
94
|
writeOnly: true,
|
|
92
95
|
nullable: true,
|
|
93
96
|
}),
|
|
94
|
-
(0, typeorm_1.Column)({ type:
|
|
97
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
95
98
|
__metadata("design:type", String)
|
|
96
99
|
], User.prototype, "hash", void 0);
|
|
97
100
|
__decorate([
|
|
98
101
|
(0, class_transformer_1.Exclude)(),
|
|
99
102
|
(0, swagger_1.ApiProperty)({
|
|
100
103
|
type: String,
|
|
101
|
-
description:
|
|
104
|
+
description: "Two-factor authentication secret",
|
|
102
105
|
required: false,
|
|
103
106
|
writeOnly: true,
|
|
104
107
|
}),
|
|
@@ -108,7 +111,7 @@ __decorate([
|
|
|
108
111
|
__decorate([
|
|
109
112
|
(0, swagger_1.ApiProperty)({
|
|
110
113
|
type: Boolean,
|
|
111
|
-
description:
|
|
114
|
+
description: "Is two-factor authentication enabled",
|
|
112
115
|
default: false,
|
|
113
116
|
}),
|
|
114
117
|
(0, typeorm_1.Column)({ default: false }),
|
|
@@ -117,7 +120,7 @@ __decorate([
|
|
|
117
120
|
__decorate([
|
|
118
121
|
(0, swagger_1.ApiProperty)({
|
|
119
122
|
type: String,
|
|
120
|
-
description:
|
|
123
|
+
description: "User phone number",
|
|
121
124
|
required: false,
|
|
122
125
|
}),
|
|
123
126
|
(0, typeorm_1.Column)({ unique: true }),
|
|
@@ -126,7 +129,7 @@ __decorate([
|
|
|
126
129
|
__decorate([
|
|
127
130
|
(0, swagger_1.ApiProperty)({
|
|
128
131
|
type: Boolean,
|
|
129
|
-
description:
|
|
132
|
+
description: "Is user verified",
|
|
130
133
|
default: false,
|
|
131
134
|
}),
|
|
132
135
|
(0, typeorm_1.Column)({ default: false }),
|
|
@@ -135,17 +138,17 @@ __decorate([
|
|
|
135
138
|
__decorate([
|
|
136
139
|
(0, swagger_1.ApiProperty)({
|
|
137
140
|
type: Date,
|
|
138
|
-
description:
|
|
141
|
+
description: "Last login timestamp",
|
|
139
142
|
required: false,
|
|
140
143
|
}),
|
|
141
|
-
(0, typeorm_1.Column)({ type:
|
|
144
|
+
(0, typeorm_1.Column)({ type: "timestamp", nullable: true }),
|
|
142
145
|
__metadata("design:type", Date)
|
|
143
146
|
], User.prototype, "lastLogin", void 0);
|
|
144
147
|
__decorate([
|
|
145
|
-
(0, swagger_1.ApiProperty)({ type: () => profile_entity_1.Profile, description:
|
|
148
|
+
(0, swagger_1.ApiProperty)({ type: () => profile_entity_1.Profile, description: "User profile" }),
|
|
146
149
|
(0, typeorm_1.OneToOne)(() => profile_entity_1.Profile, {
|
|
147
|
-
onDelete:
|
|
148
|
-
onUpdate:
|
|
150
|
+
onDelete: "CASCADE",
|
|
151
|
+
onUpdate: "CASCADE",
|
|
149
152
|
eager: true,
|
|
150
153
|
}),
|
|
151
154
|
(0, typeorm_1.JoinColumn)(),
|
|
@@ -154,11 +157,11 @@ __decorate([
|
|
|
154
157
|
__decorate([
|
|
155
158
|
(0, swagger_1.ApiProperty)({
|
|
156
159
|
type: () => [role_entity_1.Role],
|
|
157
|
-
description:
|
|
160
|
+
description: "Roles assigned to the user",
|
|
158
161
|
}),
|
|
159
162
|
(0, typeorm_1.ManyToMany)(() => role_entity_1.Role, {
|
|
160
|
-
onDelete:
|
|
161
|
-
onUpdate:
|
|
163
|
+
onDelete: "CASCADE",
|
|
164
|
+
onUpdate: "CASCADE",
|
|
162
165
|
}),
|
|
163
166
|
(0, typeorm_1.JoinTable)(),
|
|
164
167
|
__metadata("design:type", Array)
|
|
@@ -166,92 +169,110 @@ __decorate([
|
|
|
166
169
|
__decorate([
|
|
167
170
|
(0, swagger_1.ApiProperty)({
|
|
168
171
|
type: () => [tag_entity_1.Tag],
|
|
169
|
-
description:
|
|
172
|
+
description: "Tags associated with the user",
|
|
170
173
|
}),
|
|
171
|
-
(0, typeorm_1.OneToMany)(() => tag_entity_1.Tag, tag => tag.user),
|
|
174
|
+
(0, typeorm_1.OneToMany)(() => tag_entity_1.Tag, (tag) => tag.user),
|
|
172
175
|
__metadata("design:type", Array)
|
|
173
176
|
], User.prototype, "tags", void 0);
|
|
174
177
|
__decorate([
|
|
175
178
|
(0, swagger_1.ApiProperty)({
|
|
176
179
|
type: () => [push_token_entity_1.PushToken],
|
|
177
|
-
description:
|
|
180
|
+
description: "Push tokens associated with the user",
|
|
178
181
|
}),
|
|
179
|
-
(0, typeorm_1.OneToMany)(() => push_token_entity_1.PushToken, pushToken => pushToken.user),
|
|
182
|
+
(0, typeorm_1.OneToMany)(() => push_token_entity_1.PushToken, (pushToken) => pushToken.user),
|
|
180
183
|
__metadata("design:type", Array)
|
|
181
184
|
], User.prototype, "pushTokens", void 0);
|
|
182
185
|
__decorate([
|
|
183
186
|
(0, swagger_1.ApiProperty)({
|
|
184
187
|
type: () => [group_entity_1.Group],
|
|
185
|
-
description:
|
|
188
|
+
description: "Groups assigned to the user",
|
|
186
189
|
}),
|
|
187
|
-
(0, typeorm_1.ManyToMany)(() => group_entity_1.Group, group => group.users, {
|
|
188
|
-
onDelete:
|
|
189
|
-
onUpdate:
|
|
190
|
+
(0, typeorm_1.ManyToMany)(() => group_entity_1.Group, (group) => group.users, {
|
|
191
|
+
onDelete: "CASCADE",
|
|
192
|
+
onUpdate: "CASCADE",
|
|
190
193
|
}),
|
|
191
194
|
(0, typeorm_1.JoinTable)(),
|
|
192
195
|
__metadata("design:type", Array)
|
|
193
196
|
], User.prototype, "groups", void 0);
|
|
194
197
|
__decorate([
|
|
195
|
-
(0, swagger_1.ApiProperty)({ type: () => menu_permissions_entity_1.MenuPermissions, description:
|
|
198
|
+
(0, swagger_1.ApiProperty)({ type: () => menu_permissions_entity_1.MenuPermissions, description: "Menu Permissions" }),
|
|
196
199
|
(0, typeorm_1.OneToOne)(() => menu_permissions_entity_1.MenuPermissions, {
|
|
197
|
-
onDelete:
|
|
198
|
-
onUpdate:
|
|
200
|
+
onDelete: "CASCADE",
|
|
201
|
+
onUpdate: "CASCADE",
|
|
199
202
|
eager: true,
|
|
200
203
|
}),
|
|
201
204
|
(0, typeorm_1.JoinColumn)(),
|
|
202
205
|
__metadata("design:type", menu_permissions_entity_1.MenuPermissions)
|
|
203
206
|
], User.prototype, "menuPermissions", void 0);
|
|
204
207
|
__decorate([
|
|
205
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
208
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "CUA", required: false }),
|
|
206
209
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
207
210
|
__metadata("design:type", String)
|
|
208
211
|
], User.prototype, "cua", void 0);
|
|
209
212
|
__decorate([
|
|
210
213
|
(0, swagger_1.ApiProperty)({
|
|
211
214
|
type: () => User,
|
|
212
|
-
description:
|
|
215
|
+
description: "User associated with the contact",
|
|
213
216
|
required: false,
|
|
214
217
|
}),
|
|
215
|
-
(0, typeorm_1.OneToOne)(() => sales_1.Contact, contact => contact.user, {
|
|
216
|
-
onDelete:
|
|
217
|
-
onUpdate:
|
|
218
|
+
(0, typeorm_1.OneToOne)(() => sales_1.Contact, (contact) => contact.user, {
|
|
219
|
+
onDelete: "SET NULL",
|
|
220
|
+
onUpdate: "CASCADE",
|
|
218
221
|
}),
|
|
219
222
|
__metadata("design:type", sales_1.Contact)
|
|
220
223
|
], User.prototype, "contact", void 0);
|
|
221
224
|
__decorate([
|
|
222
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
225
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "Full name of the user" }),
|
|
223
226
|
__metadata("design:type", String),
|
|
224
227
|
__metadata("design:paramtypes", [])
|
|
225
228
|
], User.prototype, "name", null);
|
|
226
229
|
__decorate([
|
|
227
230
|
(0, swagger_1.ApiProperty)({
|
|
228
231
|
type: () => sales_1.Agent,
|
|
229
|
-
description:
|
|
232
|
+
description: "Agent associated with the user",
|
|
230
233
|
required: false,
|
|
231
234
|
}),
|
|
232
|
-
(0, typeorm_1.OneToOne)(() => sales_1.Agent, agent => agent.user),
|
|
235
|
+
(0, typeorm_1.OneToOne)(() => sales_1.Agent, (agent) => agent.user),
|
|
233
236
|
__metadata("design:type", sales_1.Agent)
|
|
234
237
|
], User.prototype, "agentProfile", void 0);
|
|
235
238
|
__decorate([
|
|
236
239
|
(0, swagger_1.ApiProperty)({
|
|
237
240
|
type: () => capacitation_1.Course,
|
|
238
|
-
description:
|
|
241
|
+
description: "Courses created",
|
|
239
242
|
required: false,
|
|
240
243
|
}),
|
|
241
|
-
(0, typeorm_1.OneToMany)(() => capacitation_1.Course, course => course.createdBy),
|
|
244
|
+
(0, typeorm_1.OneToMany)(() => capacitation_1.Course, (course) => course.createdBy),
|
|
242
245
|
__metadata("design:type", Array)
|
|
243
246
|
], User.prototype, "createdCourses", void 0);
|
|
244
247
|
__decorate([
|
|
245
248
|
(0, swagger_1.ApiProperty)({
|
|
246
249
|
type: () => capacitation_1.CourseAssigned,
|
|
247
|
-
description:
|
|
250
|
+
description: "Progress of assigned courses",
|
|
248
251
|
required: false,
|
|
249
252
|
}),
|
|
250
|
-
(0, typeorm_1.OneToMany)(() => capacitation_1.CourseAssigned, courseAssigned => courseAssigned.user),
|
|
253
|
+
(0, typeorm_1.OneToMany)(() => capacitation_1.CourseAssigned, (courseAssigned) => courseAssigned.user),
|
|
251
254
|
__metadata("design:type", Array)
|
|
252
255
|
], User.prototype, "coursesAssigned", void 0);
|
|
253
256
|
__decorate([
|
|
254
|
-
(0,
|
|
257
|
+
(0, swagger_1.ApiProperty)({
|
|
258
|
+
type: () => [subgroup_entity_1.SubGroup],
|
|
259
|
+
description: "SubGroups where the user is a supervisor",
|
|
260
|
+
required: false,
|
|
261
|
+
}),
|
|
262
|
+
(0, typeorm_1.OneToMany)(() => subgroup_entity_1.SubGroup, (subGroup) => subGroup.supervisor),
|
|
263
|
+
__metadata("design:type", Array)
|
|
264
|
+
], User.prototype, "supervisedSubGroups", void 0);
|
|
265
|
+
__decorate([
|
|
266
|
+
(0, swagger_1.ApiProperty)({
|
|
267
|
+
type: () => [subgroup_entity_1.SubGroup],
|
|
268
|
+
description: "SubGroups where the user is an assistant",
|
|
269
|
+
required: false,
|
|
270
|
+
}),
|
|
271
|
+
(0, typeorm_1.ManyToMany)(() => subgroup_entity_1.SubGroup, (subGroup) => subGroup.assistants),
|
|
272
|
+
__metadata("design:type", Array)
|
|
273
|
+
], User.prototype, "assistantSubGroups", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
(0, typeorm_1.Column)({ type: "tsvector", nullable: true }),
|
|
255
276
|
__metadata("design:type", String)
|
|
256
277
|
], User.prototype, "searchVector", void 0);
|
|
257
278
|
exports.User = User = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qCAQiB;AAEjB,mCAAyC;AACzC,iDAAwD;AACxD,gEAA4D;AAC5D,yDAA4C;AAC5C,iDAAuC;AACvC,uEAA4D;AAC5D,qDAA2C;AAC3C,yEAA8D;AAC9D,+CAAqC;AACrC,6CAAmC;AACnC,2DAAwD;AACxD,uDAA6C;AAGtC,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,wBAAU;IAGlC,QAAQ,CAAU;IAIlB,KAAK,CAAU;IAIf,GAAG,CAAU;IAIb,MAAM,CAAU;IAKhB,MAAM,CAAa;IAInB,WAAW,CAAa;IAUxB,IAAI,CAAU;IAUd,eAAe,CAAU;IAQzB,kBAAkB,CAAW;IAQ7B,KAAK,CAAU;IAQf,UAAU,CAAW;IAQrB,SAAS,CAAQ;IASjB,OAAO,CAAU;IAWjB,KAAK,CAAU;IAOf,IAAI,CAAQ;IAOZ,UAAU,CAAc;IAWxB,MAAM,CAAW;IASjB,eAAe,CAAkB;IAIjC,GAAG,CAAS;IAWZ,OAAO,CAAW;IAElB,IACI,IAAI;QACN,OAAO,GAAG,IAAI,CAAC,OAAO,EA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