@tomei/sso 0.43.1 → 0.44.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  import { ObjectBase } from '@tomei/general';
2
2
  import { User } from '../login-user/user';
3
+ import { Transaction } from 'sequelize';
3
4
  export declare class GroupReportingUser extends ObjectBase {
4
5
  ObjectId: string;
5
6
  ObjectName: string;
@@ -22,4 +23,6 @@ export declare class GroupReportingUser extends ObjectBase {
22
23
  private constructor();
23
24
  static init(dbTransaction: any, GroupReportingUserId?: string): Promise<GroupReportingUser>;
24
25
  createGroupReportingUser(loginUser: User, dbTransaction: any, groupCode: string, userId: number, rank: number, status: 'Active' | 'Inactive'): Promise<GroupReportingUser>;
26
+ static findAllGroupReportingUsers(loginUser: User, dbTransaction: any, groupCode?: string): Promise<GroupReportingUser[]>;
27
+ static removeGroupReportingUser(loginUser: User, dbTransaction: Transaction, groupReportingUserId: number): Promise<void>;
25
28
  }
@@ -135,6 +135,73 @@ class GroupReportingUser extends general_1.ObjectBase {
135
135
  }
136
136
  });
137
137
  }
138
+ static findAllGroupReportingUsers(loginUser, dbTransaction, groupCode) {
139
+ return __awaiter(this, void 0, void 0, function* () {
140
+ try {
141
+ const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
142
+ const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'GROUP_REPORTING_USER_VIEW');
143
+ if (!isPrivileged) {
144
+ throw new general_1.ClassError('Group', 'GroupReportingUserErrMsg05', 'You do not have the privilege to view group reporting user');
145
+ }
146
+ yield group_1.Group.init(dbTransaction, groupCode);
147
+ const result = yield GroupReportingUser._Repo.findAll({
148
+ where: {
149
+ GroupCode: groupCode,
150
+ },
151
+ order: [
152
+ ['Rank', 'ASC'],
153
+ ],
154
+ transaction: dbTransaction,
155
+ });
156
+ const reportingUser = [];
157
+ if (result.length > 0) {
158
+ for (let i = 0; i < result.length; i++) {
159
+ reportingUser.push(new GroupReportingUser(result[i].get({ plain: true })));
160
+ }
161
+ }
162
+ return reportingUser;
163
+ }
164
+ catch (error) {
165
+ throw error;
166
+ }
167
+ });
168
+ }
169
+ static removeGroupReportingUser(loginUser, dbTransaction, groupReportingUserId) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ try {
172
+ const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
173
+ const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'GROUP_REPORTING_USER_REMOVE');
174
+ if (!isPrivileged) {
175
+ throw new general_1.ClassError('GroupReportingUser', 'GroupReportingUserErrMsg06', 'Insufficient privileges to remove a user from the group');
176
+ }
177
+ const groupReportingUser = yield GroupReportingUser.init(dbTransaction, groupReportingUserId.toString());
178
+ yield GroupReportingUser._Repo.destroy(groupReportingUserId, dbTransaction);
179
+ const entityValueBefore = {
180
+ GroupReportingUserId: groupReportingUser.GroupReportingUserId,
181
+ GroupCode: groupReportingUser.GroupCode,
182
+ UserId: groupReportingUser.UserId,
183
+ Rank: groupReportingUser.Rank,
184
+ Status: groupReportingUser.Status,
185
+ CreatedById: groupReportingUser.CreatedById,
186
+ CreatedAt: groupReportingUser.CreatedAt,
187
+ UpdatedById: groupReportingUser.UpdatedById,
188
+ UpdatedAt: groupReportingUser.UpdatedAt,
189
+ };
190
+ const activity = new activity_history_1.Activity();
191
+ activity.ActivityId = activity.createId();
192
+ activity.Action = activity_history_1.ActionEnum.DELETE;
193
+ activity.Description = 'Remove Group Reporting User';
194
+ activity.EntityType = 'GroupReportingUser';
195
+ activity.EntityId = groupReportingUserId.toString();
196
+ activity.EntityValueBefore = JSON.stringify(entityValueBefore);
197
+ activity.EntityValueAfter = JSON.stringify({});
198
+ yield activity.create(loginUser.ObjectId, dbTransaction);
199
+ }
200
+ catch (error) {
201
+ throw error;
202
+ }
203
+ });
204
+ }
138
205
  }
139
206
  exports.GroupReportingUser = GroupReportingUser;
140
207
  GroupReportingUser._Repo = new group_reporting_user_repository_1.GroupReportingUserRepository();
@@ -1 +1 @@
1
- {"version":3,"file":"group-reporting-user.js","sourceRoot":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AAkB,CAAC,MAAM;oBACjC,IAAI,EAAE,kBAAkB,CAAC,IAAI;oBAC7B,MAAM,EAAE,kBAAkB,CAAC,MAAM;oBACjC,WAAW,EAAE,kBAAkB,CAAC,WAAW;oBAC3C,SAAS,EAAE,kBAAkB,CAAC,SAAS;oBACvC,WAAW,EAAE,kBAAkB,CAAC,WAAW;oBAC3C,SAAS,EAAE,kBAAkB,CAAC,SAAS;iBACxC,CAAC;gBAEF,MAAM,QAAQ,GAAG,IAAI,2BAAQ,EAAE,CAAC;gBAQhC,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBAC1C,QAAQ,CAAC,MAAM,GAAG,6BAAU,CAAC,MAAM,CAAC;gBACpC,QAAQ,CAAC,WAAW,GAAG,6BAA6B,CAAC;gBACrD,QAAQ,CAAC,UAAU,GAAG,oBAAoB,CAAC;gBAC3C,QAAQ,CAAC,QAAQ,GAAG,oBAAoB,CAAC,QAAQ,EAAE,CAAC;gBACpD,QAAQ,CAAC,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;gBAC/D,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;gBAI/C,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;aAC1D;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,KAAK,CAAC;aACb;QACH,CAAC;KAAA;;AA9VH,gDA+VC;AAhVgB,wBAAK,GAAG,IAAI,8DAA4B,EAAE,CAAC"}
@@ -2,4 +2,5 @@ import GroupReportingUserModel from '../../models/group-reporting-user.entity';
2
2
  import { RepositoryBase, IRepositoryBase } from '@tomei/general';
3
3
  export declare class GroupReportingUserRepository extends RepositoryBase<GroupReportingUserModel> implements IRepositoryBase<GroupReportingUserModel> {
4
4
  constructor();
5
+ destroy(groupReportingUserId: number, dbTransaction: any): Promise<void>;
5
6
  }
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.GroupReportingUserRepository = void 0;
4
13
  const group_reporting_user_entity_1 = require("../../models/group-reporting-user.entity");
@@ -7,6 +16,16 @@ class GroupReportingUserRepository extends general_1.RepositoryBase {
7
16
  constructor() {
8
17
  super(group_reporting_user_entity_1.default);
9
18
  }
19
+ destroy(groupReportingUserId, dbTransaction) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ yield group_reporting_user_entity_1.default.destroy({
22
+ where: {
23
+ GroupReportingUserId: groupReportingUserId,
24
+ },
25
+ transaction: dbTransaction,
26
+ });
27
+ });
28
+ }
10
29
  }
11
30
  exports.GroupReportingUserRepository = GroupReportingUserRepository;
12
31
  //# sourceMappingURL=group-reporting-user.repository.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"group-reporting-user.repository.js","sourceRoot":"","sources":["../../../../src/components/group-reporting-user/group-reporting-user.repository.ts"],"names":[],"mappings":";;;AAAA,0FAA+E;AAC/E,4CAAiE;AAEjE,MAAa,4BACX,SAAQ,wBAAuC;IAG/C;QACE,KAAK,CAAC,qCAAuB,CAAC,CAAC;IACjC,CAAC;CACF;AAPD,oEAOC"}
1
+ {"version":3,"file":"group-reporting-user.repository.js","sourceRoot":"","sources":["../../../../src/components/group-reporting-user/group-reporting-user.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0FAA+E;AAC/E,4CAAiE;AAEjE,MAAa,4BACX,SAAQ,wBAAuC;IAG/C;QACE,KAAK,CAAC,qCAAuB,CAAC,CAAC;IACjC,CAAC;IAEK,OAAO,CACX,oBAA4B,EAC5B,aAAkB;;YAElB,MAAM,qCAAuB,CAAC,OAAO,CAAC;gBACpC,KAAK,EAAE;oBACL,oBAAoB,EAAE,oBAAoB;iBAC3C;gBACD,WAAW,EAAE,aAAa;aAC3B,CAAC,CAAC;QACL,CAAC;KAAA;CACF;AAnBD,oEAmBC"}