@temboplus/afloat 0.1.39 → 0.1.41
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/esm/src/features/admin/repository.js +4 -4
- package/esm/src/models/permission.d.ts +1 -0
- package/esm/src/models/permission.d.ts.map +1 -1
- package/esm/src/models/permission.js +1 -0
- package/esm/src/models/user/managed-user.d.ts +8 -2
- package/esm/src/models/user/managed-user.d.ts.map +1 -1
- package/esm/src/models/user/managed-user.js +22 -0
- package/package.json +1 -1
- package/script/src/features/admin/repository.js +4 -4
- package/script/src/models/permission.d.ts +1 -0
- package/script/src/models/permission.d.ts.map +1 -1
- package/script/src/models/permission.js +1 -0
- package/script/src/models/user/managed-user.d.ts +8 -2
- package/script/src/models/user/managed-user.d.ts.map +1 -1
- package/script/src/models/user/managed-user.js +22 -0
|
@@ -77,7 +77,7 @@ export class UserManagementRepository extends BaseRepository {
|
|
|
77
77
|
const requiredPerm = Permissions.UserManagement.ArchiveUser;
|
|
78
78
|
if (!auth.checkPermission(requiredPerm)) {
|
|
79
79
|
throw new PermissionError({
|
|
80
|
-
message: "You are not authorized to archive
|
|
80
|
+
message: "You are not authorized to archive users.",
|
|
81
81
|
requiredPermissions: [requiredPerm],
|
|
82
82
|
});
|
|
83
83
|
}
|
|
@@ -93,10 +93,10 @@ export class UserManagementRepository extends BaseRepository {
|
|
|
93
93
|
*/
|
|
94
94
|
async unArchiveUser(id) {
|
|
95
95
|
const auth = this.getAuthForPermissionCheck();
|
|
96
|
-
const requiredPerm = Permissions.UserManagement.
|
|
96
|
+
const requiredPerm = Permissions.UserManagement.UnArchiveUser;
|
|
97
97
|
if (!auth.checkPermission(requiredPerm)) {
|
|
98
98
|
throw new PermissionError({
|
|
99
|
-
message: "You are not authorized to un-archive
|
|
99
|
+
message: "You are not authorized to un-archive users.",
|
|
100
100
|
requiredPermissions: [requiredPerm],
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -223,7 +223,7 @@ export class UserManagementRepository extends BaseRepository {
|
|
|
223
223
|
*/
|
|
224
224
|
async getRole(id) {
|
|
225
225
|
const auth = this.getAuthForPermissionCheck();
|
|
226
|
-
const requiredPerm = Permissions.Role.
|
|
226
|
+
const requiredPerm = Permissions.Role.ViewRole;
|
|
227
227
|
if (!auth.checkPermission(requiredPerm)) {
|
|
228
228
|
throw new PermissionError({
|
|
229
229
|
message: "You are not authorized to view role details.",
|
|
@@ -44,6 +44,7 @@ export declare const Permissions: {
|
|
|
44
44
|
readonly CreateUser: "login.create";
|
|
45
45
|
readonly UpdateUser: "login.update";
|
|
46
46
|
readonly ArchiveUser: "login.archive";
|
|
47
|
+
readonly UnArchiveUser: "login.unarchive";
|
|
47
48
|
readonly ResetPassword: "login.resetPassword";
|
|
48
49
|
};
|
|
49
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../../src/src/models/permission.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../../src/src/models/permission.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Cd,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,OAAO,WAAW,CAAC,MAAM,CAAC,GAC1D,OAAO,WAAW,CAAC,QAAQ,CAAC,MAAM,OAAO,WAAW,CAAC,QAAQ,CAAC,GAC9D,OAAO,WAAW,CAAC,cAAc,CAAC,MAAM,OAAO,WAAW,CAAC,cAAc,CAAC,GAC1E,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,OAAO,WAAW,CAAC,IAAI,CAAC,GACtD,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -49,6 +49,7 @@ export interface ManagedUserData {
|
|
|
49
49
|
roleId: string;
|
|
50
50
|
resetPassword: boolean;
|
|
51
51
|
isActive: boolean;
|
|
52
|
+
isArchived: boolean;
|
|
52
53
|
role?: RoleData;
|
|
53
54
|
createdAt: string;
|
|
54
55
|
updatedAt: string;
|
|
@@ -62,6 +63,7 @@ export declare class ManagedUser extends UserEntity {
|
|
|
62
63
|
readonly roleId: string;
|
|
63
64
|
readonly resetPassword: boolean;
|
|
64
65
|
readonly isActive: boolean;
|
|
66
|
+
readonly isArchived: boolean;
|
|
65
67
|
readonly role?: Role;
|
|
66
68
|
readonly createdAt: Date;
|
|
67
69
|
readonly updatedAt: Date;
|
|
@@ -70,6 +72,10 @@ export declare class ManagedUser extends UserEntity {
|
|
|
70
72
|
* Check if user account is active
|
|
71
73
|
*/
|
|
72
74
|
isAccountActive(): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Check if user account is archived
|
|
77
|
+
*/
|
|
78
|
+
isAccountArchived(): boolean;
|
|
73
79
|
/**
|
|
74
80
|
* Check if user needs to reset password
|
|
75
81
|
*/
|
|
@@ -78,9 +84,9 @@ export declare class ManagedUser extends UserEntity {
|
|
|
78
84
|
* Get comprehensive account status
|
|
79
85
|
*/
|
|
80
86
|
getAccountStatus(): {
|
|
81
|
-
status: "active" | "inactive" | "password_reset_required";
|
|
87
|
+
status: "active" | "inactive" | "archived" | "password_reset_required";
|
|
82
88
|
label: string;
|
|
83
|
-
color: "success" | "warning" | "error";
|
|
89
|
+
color: "success" | "warning" | "error" | "default";
|
|
84
90
|
description: string;
|
|
85
91
|
};
|
|
86
92
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-user.d.ts","sourceRoot":"","sources":["../../../../src/src/models/user/managed-user.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;gBAErC,IAAI,EAAE,cAAc;IAQhC;;OAEG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIhC;;OAEG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO;IAItC;;OAEG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO;CAGvC;AAID,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,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AS,EAAE,IAAI,CAAC;IAChC,SAAgB,SAAS,EAAE,IAAI,CAAC;gBAEpB,IAAI,EAAE,eAAe;IA0BjC;;OAEG;IACH,eAAe,IAAI,OAAO;IAI1B;;OAEG;IACH,iBAAiB,IAAI,OAAO;IAI5B;;OAEG;IACH,kBAAkB,IAAI,OAAO;IAI7B;;OAEG;IACH,gBAAgB,IAAI;QAClB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,yBAAyB,CAAC;QACvE,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;QACnD,WAAW,EAAE,MAAM,CAAC;KACrB;IAoCD;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACH,iBAAiB,IAAI,MAAM;IAY3B,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,WAAW,GAAG,SAAS;IAa/C,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,WAAW,EAAE;IAMlD,MAAM,IAAI,GAAG;CAgBd"}
|
|
@@ -98,6 +98,12 @@ export class ManagedUser extends UserEntity {
|
|
|
98
98
|
writable: true,
|
|
99
99
|
value: void 0
|
|
100
100
|
});
|
|
101
|
+
Object.defineProperty(this, "isArchived", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
configurable: true,
|
|
104
|
+
writable: true,
|
|
105
|
+
value: void 0
|
|
106
|
+
});
|
|
101
107
|
Object.defineProperty(this, "role", {
|
|
102
108
|
enumerable: true,
|
|
103
109
|
configurable: true,
|
|
@@ -120,6 +126,7 @@ export class ManagedUser extends UserEntity {
|
|
|
120
126
|
this.roleId = data.roleId;
|
|
121
127
|
this.resetPassword = data.resetPassword;
|
|
122
128
|
this.isActive = data.isActive;
|
|
129
|
+
this.isArchived = data.isArchived;
|
|
123
130
|
this.createdAt = new Date(data.createdAt);
|
|
124
131
|
this.updatedAt = new Date(data.updatedAt);
|
|
125
132
|
if (data.role) {
|
|
@@ -137,6 +144,12 @@ export class ManagedUser extends UserEntity {
|
|
|
137
144
|
isAccountActive() {
|
|
138
145
|
return this.isActive;
|
|
139
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Check if user account is archived
|
|
149
|
+
*/
|
|
150
|
+
isAccountArchived() {
|
|
151
|
+
return this.isArchived;
|
|
152
|
+
}
|
|
140
153
|
/**
|
|
141
154
|
* Check if user needs to reset password
|
|
142
155
|
*/
|
|
@@ -147,6 +160,14 @@ export class ManagedUser extends UserEntity {
|
|
|
147
160
|
* Get comprehensive account status
|
|
148
161
|
*/
|
|
149
162
|
getAccountStatus() {
|
|
163
|
+
if (this.isArchived) {
|
|
164
|
+
return {
|
|
165
|
+
status: "archived",
|
|
166
|
+
label: "Archived",
|
|
167
|
+
color: "default",
|
|
168
|
+
description: "Account has been archived and is no longer accessible",
|
|
169
|
+
};
|
|
170
|
+
}
|
|
150
171
|
if (!this.isActive) {
|
|
151
172
|
return {
|
|
152
173
|
status: "inactive",
|
|
@@ -225,6 +246,7 @@ export class ManagedUser extends UserEntity {
|
|
|
225
246
|
roleId: this.roleId,
|
|
226
247
|
resetPassword: this.resetPassword,
|
|
227
248
|
isActive: this.isActive,
|
|
249
|
+
isArchived: this.isArchived,
|
|
228
250
|
role: this.role?.toJSON(),
|
|
229
251
|
createdAt: this.createdAt.toISOString(),
|
|
230
252
|
updatedAt: this.updatedAt.toISOString(),
|
package/package.json
CHANGED
|
@@ -80,7 +80,7 @@ class UserManagementRepository extends base_repository_js_1.BaseRepository {
|
|
|
80
80
|
const requiredPerm = index_js_1.Permissions.UserManagement.ArchiveUser;
|
|
81
81
|
if (!auth.checkPermission(requiredPerm)) {
|
|
82
82
|
throw new index_js_2.PermissionError({
|
|
83
|
-
message: "You are not authorized to archive
|
|
83
|
+
message: "You are not authorized to archive users.",
|
|
84
84
|
requiredPermissions: [requiredPerm],
|
|
85
85
|
});
|
|
86
86
|
}
|
|
@@ -96,10 +96,10 @@ class UserManagementRepository extends base_repository_js_1.BaseRepository {
|
|
|
96
96
|
*/
|
|
97
97
|
async unArchiveUser(id) {
|
|
98
98
|
const auth = this.getAuthForPermissionCheck();
|
|
99
|
-
const requiredPerm = index_js_1.Permissions.UserManagement.
|
|
99
|
+
const requiredPerm = index_js_1.Permissions.UserManagement.UnArchiveUser;
|
|
100
100
|
if (!auth.checkPermission(requiredPerm)) {
|
|
101
101
|
throw new index_js_2.PermissionError({
|
|
102
|
-
message: "You are not authorized to un-archive
|
|
102
|
+
message: "You are not authorized to un-archive users.",
|
|
103
103
|
requiredPermissions: [requiredPerm],
|
|
104
104
|
});
|
|
105
105
|
}
|
|
@@ -226,7 +226,7 @@ class UserManagementRepository extends base_repository_js_1.BaseRepository {
|
|
|
226
226
|
*/
|
|
227
227
|
async getRole(id) {
|
|
228
228
|
const auth = this.getAuthForPermissionCheck();
|
|
229
|
-
const requiredPerm = index_js_1.Permissions.Role.
|
|
229
|
+
const requiredPerm = index_js_1.Permissions.Role.ViewRole;
|
|
230
230
|
if (!auth.checkPermission(requiredPerm)) {
|
|
231
231
|
throw new index_js_2.PermissionError({
|
|
232
232
|
message: "You are not authorized to view role details.",
|
|
@@ -44,6 +44,7 @@ export declare const Permissions: {
|
|
|
44
44
|
readonly CreateUser: "login.create";
|
|
45
45
|
readonly UpdateUser: "login.update";
|
|
46
46
|
readonly ArchiveUser: "login.archive";
|
|
47
|
+
readonly UnArchiveUser: "login.unarchive";
|
|
47
48
|
readonly ResetPassword: "login.resetPassword";
|
|
48
49
|
};
|
|
49
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../../src/src/models/permission.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../../src/src/models/permission.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Cd,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,OAAO,WAAW,CAAC,MAAM,CAAC,GAC1D,OAAO,WAAW,CAAC,QAAQ,CAAC,MAAM,OAAO,WAAW,CAAC,QAAQ,CAAC,GAC9D,OAAO,WAAW,CAAC,cAAc,CAAC,MAAM,OAAO,WAAW,CAAC,cAAc,CAAC,GAC1E,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,OAAO,WAAW,CAAC,IAAI,CAAC,GACtD,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -49,6 +49,7 @@ export interface ManagedUserData {
|
|
|
49
49
|
roleId: string;
|
|
50
50
|
resetPassword: boolean;
|
|
51
51
|
isActive: boolean;
|
|
52
|
+
isArchived: boolean;
|
|
52
53
|
role?: RoleData;
|
|
53
54
|
createdAt: string;
|
|
54
55
|
updatedAt: string;
|
|
@@ -62,6 +63,7 @@ export declare class ManagedUser extends UserEntity {
|
|
|
62
63
|
readonly roleId: string;
|
|
63
64
|
readonly resetPassword: boolean;
|
|
64
65
|
readonly isActive: boolean;
|
|
66
|
+
readonly isArchived: boolean;
|
|
65
67
|
readonly role?: Role;
|
|
66
68
|
readonly createdAt: Date;
|
|
67
69
|
readonly updatedAt: Date;
|
|
@@ -70,6 +72,10 @@ export declare class ManagedUser extends UserEntity {
|
|
|
70
72
|
* Check if user account is active
|
|
71
73
|
*/
|
|
72
74
|
isAccountActive(): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Check if user account is archived
|
|
77
|
+
*/
|
|
78
|
+
isAccountArchived(): boolean;
|
|
73
79
|
/**
|
|
74
80
|
* Check if user needs to reset password
|
|
75
81
|
*/
|
|
@@ -78,9 +84,9 @@ export declare class ManagedUser extends UserEntity {
|
|
|
78
84
|
* Get comprehensive account status
|
|
79
85
|
*/
|
|
80
86
|
getAccountStatus(): {
|
|
81
|
-
status: "active" | "inactive" | "password_reset_required";
|
|
87
|
+
status: "active" | "inactive" | "archived" | "password_reset_required";
|
|
82
88
|
label: string;
|
|
83
|
-
color: "success" | "warning" | "error";
|
|
89
|
+
color: "success" | "warning" | "error" | "default";
|
|
84
90
|
description: string;
|
|
85
91
|
};
|
|
86
92
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-user.d.ts","sourceRoot":"","sources":["../../../../src/src/models/user/managed-user.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;gBAErC,IAAI,EAAE,cAAc;IAQhC;;OAEG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIhC;;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,GAAG;CAgBd"}
|
|
@@ -102,6 +102,12 @@ class ManagedUser extends UserEntity {
|
|
|
102
102
|
writable: true,
|
|
103
103
|
value: void 0
|
|
104
104
|
});
|
|
105
|
+
Object.defineProperty(this, "isArchived", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
configurable: true,
|
|
108
|
+
writable: true,
|
|
109
|
+
value: void 0
|
|
110
|
+
});
|
|
105
111
|
Object.defineProperty(this, "role", {
|
|
106
112
|
enumerable: true,
|
|
107
113
|
configurable: true,
|
|
@@ -124,6 +130,7 @@ class ManagedUser extends UserEntity {
|
|
|
124
130
|
this.roleId = data.roleId;
|
|
125
131
|
this.resetPassword = data.resetPassword;
|
|
126
132
|
this.isActive = data.isActive;
|
|
133
|
+
this.isArchived = data.isArchived;
|
|
127
134
|
this.createdAt = new Date(data.createdAt);
|
|
128
135
|
this.updatedAt = new Date(data.updatedAt);
|
|
129
136
|
if (data.role) {
|
|
@@ -141,6 +148,12 @@ class ManagedUser extends UserEntity {
|
|
|
141
148
|
isAccountActive() {
|
|
142
149
|
return this.isActive;
|
|
143
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Check if user account is archived
|
|
153
|
+
*/
|
|
154
|
+
isAccountArchived() {
|
|
155
|
+
return this.isArchived;
|
|
156
|
+
}
|
|
144
157
|
/**
|
|
145
158
|
* Check if user needs to reset password
|
|
146
159
|
*/
|
|
@@ -151,6 +164,14 @@ class ManagedUser extends UserEntity {
|
|
|
151
164
|
* Get comprehensive account status
|
|
152
165
|
*/
|
|
153
166
|
getAccountStatus() {
|
|
167
|
+
if (this.isArchived) {
|
|
168
|
+
return {
|
|
169
|
+
status: "archived",
|
|
170
|
+
label: "Archived",
|
|
171
|
+
color: "default",
|
|
172
|
+
description: "Account has been archived and is no longer accessible",
|
|
173
|
+
};
|
|
174
|
+
}
|
|
154
175
|
if (!this.isActive) {
|
|
155
176
|
return {
|
|
156
177
|
status: "inactive",
|
|
@@ -229,6 +250,7 @@ class ManagedUser extends UserEntity {
|
|
|
229
250
|
roleId: this.roleId,
|
|
230
251
|
resetPassword: this.resetPassword,
|
|
231
252
|
isActive: this.isActive,
|
|
253
|
+
isArchived: this.isArchived,
|
|
232
254
|
role: this.role?.toJSON(),
|
|
233
255
|
createdAt: this.createdAt.toISOString(),
|
|
234
256
|
updatedAt: this.updatedAt.toISOString(),
|