rez_core 1.0.60 → 1.0.61

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 (29) hide show
  1. package/dist/module/module/controller/module-access.controller.d.ts +1 -37
  2. package/dist/module/module/controller/module-access.controller.js +2 -34
  3. package/dist/module/module/controller/module-access.controller.js.map +1 -1
  4. package/dist/module/module/repository/module-access.repository.d.ts +1 -35
  5. package/dist/module/module/repository/module-access.repository.js +2 -104
  6. package/dist/module/module/repository/module-access.repository.js.map +1 -1
  7. package/dist/module/module/service/module-access.service.d.ts +1 -36
  8. package/dist/module/module/service/module-access.service.js +2 -44
  9. package/dist/module/module/service/module-access.service.js.map +1 -1
  10. package/dist/module/user/controller/role.controller.d.ts +41 -0
  11. package/dist/module/user/controller/role.controller.js +63 -0
  12. package/dist/module/user/controller/role.controller.js.map +1 -0
  13. package/dist/module/user/repository/role.repository.d.ts +35 -1
  14. package/dist/module/user/repository/role.repository.js +105 -2
  15. package/dist/module/user/repository/role.repository.js.map +1 -1
  16. package/dist/module/user/service/role.service.d.ts +35 -1
  17. package/dist/module/user/service/role.service.js +39 -2
  18. package/dist/module/user/service/role.service.js.map +1 -1
  19. package/dist/module/user/user.module.js +4 -2
  20. package/dist/module/user/user.module.js.map +1 -1
  21. package/dist/tsconfig.build.tsbuildinfo +1 -1
  22. package/package.json +1 -1
  23. package/src/module/module/controller/module-access.controller.ts +2 -36
  24. package/src/module/module/repository/module-access.repository.ts +0 -151
  25. package/src/module/module/service/module-access.service.ts +1 -62
  26. package/src/module/user/controller/role.controller.ts +55 -0
  27. package/src/module/user/repository/role.repository.ts +157 -1
  28. package/src/module/user/service/role.service.ts +70 -2
  29. package/src/module/user/user.module.ts +4 -2
@@ -17,18 +17,121 @@ const common_1 = require("@nestjs/common");
17
17
  const typeorm_1 = require("typeorm");
18
18
  const typeorm_2 = require("@nestjs/typeorm");
19
19
  const role_entity_1 = require("../entity/role.entity");
20
+ const module_access_entity_1 = require("../../module/entity/module-access.entity");
20
21
  let RoleRepository = class RoleRepository {
21
- constructor(roleRepo) {
22
+ constructor(roleRepo, moduleAccessRepo) {
22
23
  this.roleRepo = roleRepo;
24
+ this.moduleAccessRepo = moduleAccessRepo;
23
25
  }
24
26
  async findByCode(code) {
25
27
  return this.roleRepo.findOne({ where: { code } });
26
28
  }
29
+ async createRole({ name, description, status = 'ACTIVE', copyFromRoleId, }, loggedInUser) {
30
+ if (await this.isRoleNameExists(name)) {
31
+ throw new common_1.BadRequestException('Role name already exists.');
32
+ }
33
+ const sourceRole = copyFromRoleId
34
+ ? await this.roleRepo.findOne({ where: { id: copyFromRoleId } })
35
+ : null;
36
+ if (copyFromRoleId && !sourceRole) {
37
+ throw new common_1.BadRequestException('Source role not found.');
38
+ }
39
+ const newRole = this.roleRepo.create({
40
+ name,
41
+ description,
42
+ status,
43
+ created_by: loggedInUser.id,
44
+ created_date: new Date(),
45
+ });
46
+ const savedRole = await this.roleRepo.save(newRole);
47
+ savedRole.code = `ROL${savedRole.id}`;
48
+ await this.roleRepo.save(savedRole);
49
+ if (sourceRole) {
50
+ const sourcePermissions = await this.moduleAccessRepo.find({
51
+ where: { role_code: sourceRole.code },
52
+ });
53
+ const clonedPermissions = sourcePermissions.map(perm => this.moduleAccessRepo.create({
54
+ role_code: savedRole.code,
55
+ module_code: perm.module_code,
56
+ action_type: perm.action_type,
57
+ access_flag: perm.access_flag,
58
+ app_code: perm.app_code,
59
+ }));
60
+ await this.moduleAccessRepo.save(clonedPermissions);
61
+ }
62
+ return {
63
+ success: true,
64
+ msg: 'Role created successfully',
65
+ role: {
66
+ id: savedRole.id,
67
+ name: savedRole.name,
68
+ status: savedRole.status,
69
+ code: savedRole.code,
70
+ },
71
+ };
72
+ }
73
+ async updateRole(roleId, { name, description, status = 'ACTIVE', copyFromRoleId, }, loggedInUser) {
74
+ if (await this.isRoleNameExists(name, roleId)) {
75
+ throw new common_1.BadRequestException('Role name already exists.');
76
+ }
77
+ const role = await this.roleRepo.findOne({ where: { id: roleId } });
78
+ if (!role) {
79
+ throw new common_1.BadRequestException('Role not found');
80
+ }
81
+ Object.assign(role, {
82
+ name,
83
+ description: description || '',
84
+ status,
85
+ modified_by: loggedInUser.id,
86
+ modified_date: new Date(),
87
+ });
88
+ await this.roleRepo.save(role);
89
+ if (copyFromRoleId) {
90
+ const sourceRole = await this.roleRepo.findOne({ where: { id: copyFromRoleId } });
91
+ if (!sourceRole) {
92
+ throw new common_1.BadRequestException('Source role not found');
93
+ }
94
+ await this.moduleAccessRepo.delete({ role_code: role.code });
95
+ const sourcePermissions = await this.moduleAccessRepo.find({
96
+ where: { role_code: sourceRole.code },
97
+ });
98
+ const clonedPermissions = sourcePermissions.map(perm => this.moduleAccessRepo.create({
99
+ role_code: role.code,
100
+ module_code: perm.module_code,
101
+ action_type: perm.action_type,
102
+ access_flag: perm.access_flag,
103
+ app_code: perm.app_code,
104
+ }));
105
+ await this.moduleAccessRepo.save(clonedPermissions);
106
+ }
107
+ return {
108
+ success: true,
109
+ msg: 'Role updated successfully',
110
+ role: {
111
+ id: role.id,
112
+ name: role.name,
113
+ status: role.status,
114
+ code: role.code,
115
+ },
116
+ };
117
+ }
118
+ async isRoleNameExists(name, excludeRoleId) {
119
+ const query = this.roleRepo
120
+ .createQueryBuilder('role')
121
+ .where('role.name = :name', { name });
122
+ if (excludeRoleId) {
123
+ query.andWhere('role.id != :excludeRoleId', { excludeRoleId });
124
+ }
125
+ const existingRole = await query.getOne();
126
+ return !!existingRole;
127
+ }
27
128
  };
28
129
  exports.RoleRepository = RoleRepository;
29
130
  exports.RoleRepository = RoleRepository = __decorate([
30
131
  (0, common_1.Injectable)(),
31
132
  __param(0, (0, typeorm_2.InjectRepository)(role_entity_1.Role)),
32
- __metadata("design:paramtypes", [typeorm_1.Repository])
133
+ __param(1, (0, typeorm_2.InjectRepository)(module_access_entity_1.ModuleAccess)),
134
+ __metadata("design:paramtypes", [typeorm_1.Repository,
135
+ typeorm_1.Repository])
33
136
  ], RoleRepository);
34
137
  //# sourceMappingURL=role.repository.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"role.repository.js","sourceRoot":"","sources":["../../../../src/module/user/repository/role.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAAqC;AACrC,6CAAmD;AACnD,uDAA6C;AAGtC,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,QAA0B;QAA1B,aAAQ,GAAR,QAAQ,CAAkB;IAC1C,CAAC;IAEJ,KAAK,CAAC,UAAU,CAAC,IAAY;QAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAA;AATY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;qCACI,oBAAU;GAH5B,cAAc,CAS1B"}
1
+ {"version":3,"file":"role.repository.js","sourceRoot":"","sources":["../../../../src/module/user/repository/role.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAiE;AACjE,qCAAqC;AACrC,6CAAmD;AACnD,uDAA6C;AAC7C,mFAA6E;AAItE,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,QAA0B,EAEtB,gBAA0C;QAF9C,aAAQ,GAAR,QAAQ,CAAkB;QAEtB,qBAAgB,GAAhB,gBAAgB,CAA0B;IAC9D,CAAC;IAEJ,KAAK,CAAC,UAAU,CAAC,IAAY;QAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,UAAU,CACd,EACE,IAAI,EACJ,WAAW,EACX,MAAM,GAAG,QAAQ,EACjB,cAAc,GAMf,EACD,YAAsB;QAEtB,IAAI,MAAM,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CAAC,QAAQ;aACxB,kBAAkB,CAAC,MAAM,CAAC;aAC1B,KAAK,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAExC,IAAI,aAAa,EAAE,CAAC;YAClB,KAAK,CAAC,QAAQ,CAAC,2BAA2B,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC;QAC1C,OAAO,CAAC,CAAC,YAAY,CAAC;IACxB,CAAC;CACF,CAAA;AAnKY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;IAEtB,WAAA,IAAA,0BAAgB,EAAC,mCAAY,CAAC,CAAA;qCADJ,oBAAU;QAEE,oBAAU;GALxC,cAAc,CAmK1B"}
@@ -1,7 +1,41 @@
1
1
  import { EntityServiceImpl } from '../../meta/service/entity-service-impl.service';
2
2
  import { BaseEntity } from '../../meta/entity/base-entity.entity';
3
3
  import { UserData } from '../entity/user.entity';
4
+ import { RoleRepository } from '../repository/role.repository';
5
+ import { EntityManager } from 'typeorm';
4
6
  export declare class RoleService extends EntityServiceImpl {
5
- constructor();
7
+ private readonly roleRepository;
8
+ private readonly entityManager;
9
+ constructor(roleRepository: RoleRepository, entityManager: EntityManager);
6
10
  createEntity(entityData: BaseEntity, loggedInUser: UserData | null): Promise<BaseEntity>;
11
+ createRole(body: {
12
+ name: string;
13
+ description?: string;
14
+ status?: 'ACTIVE' | 'INACTIVE';
15
+ copyFromRoleId?: number;
16
+ }, loggedInUser: UserData): Promise<{
17
+ success: boolean;
18
+ msg: string;
19
+ role: {
20
+ id: number;
21
+ name: string;
22
+ status: string;
23
+ code: string;
24
+ };
25
+ }>;
26
+ updateRole(id: number, body: {
27
+ name?: string;
28
+ description?: string;
29
+ status?: 'ACTIVE' | 'INACTIVE';
30
+ copyFromRoleId?: number;
31
+ }, loggedInUser: UserData): Promise<{
32
+ success: boolean;
33
+ msg: string;
34
+ role: {
35
+ id: number;
36
+ name: string;
37
+ status: string;
38
+ code: string;
39
+ };
40
+ }>;
7
41
  }
@@ -12,18 +12,55 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RoleService = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
15
+ const global_constant_1 = require("../../../constant/global.constant");
16
+ const role_repository_1 = require("../repository/role.repository");
17
+ const typeorm_1 = require("typeorm");
15
18
  let RoleService = class RoleService extends entity_service_impl_service_1.EntityServiceImpl {
16
- constructor() {
19
+ constructor(roleRepository, entityManager) {
17
20
  super();
21
+ this.roleRepository = roleRepository;
22
+ this.entityManager = entityManager;
18
23
  }
19
24
  async createEntity(entityData, loggedInUser) {
20
25
  let role = entityData;
21
26
  return await super.createEntity(role, loggedInUser);
22
27
  }
28
+ async createRole(body, loggedInUser) {
29
+ return this.roleRepository.createRole(body, loggedInUser);
30
+ }
31
+ async updateRole(id, body, loggedInUser) {
32
+ if (!body.name) {
33
+ throw new common_1.BadRequestException('Role name is required');
34
+ }
35
+ if (body.status === 'INACTIVE') {
36
+ const entityData = await super.getEntityData(global_constant_1.ENTITYTYPE_ROLE, id);
37
+ const associatedUsers = await this.entityManager.query(`SELECT map.*
38
+ FROM cr_user_role_mapping map
39
+ JOIN cr_user usr ON map.user_id = usr.id
40
+ WHERE usr.status = 'ACTIVE' and map.role_id = ${entityData?.id}`);
41
+ if (associatedUsers.length > 0) {
42
+ throw new common_1.BadRequestException('Cannot deactivate role as it is associated with active users');
43
+ }
44
+ if (!entityData) {
45
+ throw new common_1.BadRequestException('Role not found');
46
+ }
47
+ const role = entityData;
48
+ if (role.is_system === 1) {
49
+ throw new common_1.BadRequestException('Cannot deactivate system role');
50
+ }
51
+ }
52
+ return this.roleRepository.updateRole(id, {
53
+ name: body.name,
54
+ description: body.description,
55
+ status: body.status,
56
+ copyFromRoleId: body.copyFromRoleId,
57
+ }, loggedInUser);
58
+ }
23
59
  };
24
60
  exports.RoleService = RoleService;
25
61
  exports.RoleService = RoleService = __decorate([
26
62
  (0, common_1.Injectable)(),
27
- __metadata("design:paramtypes", [])
63
+ __metadata("design:paramtypes", [role_repository_1.RoleRepository,
64
+ typeorm_1.EntityManager])
28
65
  ], RoleService);
29
66
  //# sourceMappingURL=role.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"role.service.js","sourceRoot":"","sources":["../../../../src/module/user/service/role.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,gGAAmF;AAM5E,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,+CAAiB;IAChD;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,UAAsB,EACtB,YAA6B;QAE7B,IAAI,IAAI,GAAG,UAAkB,CAAC;QAE9B,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACtD,CAAC;CACF,CAAA;AAbY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;;GACA,WAAW,CAavB"}
1
+ {"version":3,"file":"role.service.js","sourceRoot":"","sources":["../../../../src/module/user/service/role.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiE;AACjE,gGAAmF;AAInF,uEAA+D;AAC/D,mEAA+D;AAC/D,qCAAwC;AAGjC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,+CAAiB;IAChD,YACmB,cAA8B,EAC9B,aAA4B;QAG7C,KAAK,EAAE,CAAC;QAJS,mBAAc,GAAd,cAAc,CAAgB;QAC9B,kBAAa,GAAb,aAAa,CAAe;IAI/C,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,UAAsB,EACtB,YAA6B;QAE7B,IAAI,IAAI,GAAG,UAAkB,CAAC;QAE9B,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,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CAAC;CACF,CAAA;AA9EY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAGwB,gCAAc;QACf,uBAAa;GAHpC,WAAW,CA8EvB"}
@@ -28,13 +28,15 @@ const user_role_mapping_entity_1 = require("./entity/user-role-mapping.entity");
28
28
  const user_role_mapping_repository_1 = require("./repository/user-role-mapping.repository");
29
29
  const user_role_mapping_service_1 = require("./service/user-role-mapping.service");
30
30
  const role_repository_1 = require("./repository/role.repository");
31
+ const module_access_entity_1 = require("../module/entity/module-access.entity");
32
+ const role_controller_1 = require("./controller/role.controller");
31
33
  let UserModule = class UserModule {
32
34
  };
33
35
  exports.UserModule = UserModule;
34
36
  exports.UserModule = UserModule = __decorate([
35
37
  (0, common_1.Module)({
36
38
  imports: [
37
- typeorm_1.TypeOrmModule.forFeature([user_entity_1.UserData, user_session_entity_1.UserSession, role_entity_1.Role, user_role_mapping_entity_1.UserRoleMapping]),
39
+ typeorm_1.TypeOrmModule.forFeature([user_entity_1.UserData, user_session_entity_1.UserSession, role_entity_1.Role, user_role_mapping_entity_1.UserRoleMapping, module_access_entity_1.ModuleAccess]),
38
40
  entity_module_1.EntityModule,
39
41
  utils_module_1.UtilsModule,
40
42
  auth_module_1.AuthModule,
@@ -59,7 +61,7 @@ exports.UserModule = UserModule = __decorate([
59
61
  role_repository_1.RoleRepository,
60
62
  login_service_1.LoginService,
61
63
  ],
62
- controllers: [login_controller_1.LoginController, user_controller_1.UserController],
64
+ controllers: [login_controller_1.LoginController, user_controller_1.UserController, role_controller_1.RoleController],
63
65
  })
64
66
  ], UserModule);
65
67
  //# sourceMappingURL=user.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"user.module.js","sourceRoot":"","sources":["../../../src/module/user/user.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,sDAAgD;AAChD,yDAAqD;AACrD,2DAAuD;AACvD,yDAAqD;AACrD,kEAA8D;AAC9D,yEAAoE;AACpE,sEAA2D;AAC3D,oEAAgE;AAChE,2DAAuD;AACvD,gFAA4E;AAC5E,qCAAyC;AACzC,qDAAiD;AACjD,kEAA8D;AAC9D,sDAA4C;AAC5C,yDAAqD;AACrD,gFAAoE;AACpE,4FAAsF;AACtF,mFAA6E;AAC7E,kEAA8D;AA+BvD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IA7BtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,sBAAQ,EAAE,iCAAW,EAAE,kBAAI,EAAE,0CAAe,CAAC,CAAC;YACxE,4BAAY;YACZ,0BAAW;YACX,wBAAU;SACX;QACD,SAAS,EAAE;YACT,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,0BAAW,EAAE;YACjD,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,0BAAW,EAAE;YACjD,gCAAc;YACd,yCAAkB;YAClB,4BAAY;YACZ,8CAAqB;YACrB,gBAAU;YACV,wDAAyB;YACzB,kDAAsB;YACtB,gCAAc;SACf;QACD,OAAO,EAAE;YACP,aAAa;YACb,yCAAkB;YAClB,aAAa;YACb,kDAAsB;YACtB,gCAAc;YACd,4BAAY;SACb;QACD,WAAW,EAAE,CAAC,kCAAe,EAAE,gCAAc,CAAC;KAC/C,CAAC;GACW,UAAU,CAAG"}
1
+ {"version":3,"file":"user.module.js","sourceRoot":"","sources":["../../../src/module/user/user.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,sDAAgD;AAChD,yDAAqD;AACrD,2DAAuD;AACvD,yDAAqD;AACrD,kEAA8D;AAC9D,yEAAoE;AACpE,sEAA2D;AAC3D,oEAAgE;AAChE,2DAAuD;AACvD,gFAA4E;AAC5E,qCAAyC;AACzC,qDAAiD;AACjD,kEAA8D;AAC9D,sDAA4C;AAC5C,yDAAqD;AACrD,gFAAoE;AACpE,4FAAsF;AACtF,mFAA6E;AAC7E,kEAA8D;AAC9D,gFAAqE;AACrE,kEAA8D;AA+BvD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IA7BtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,sBAAQ,EAAE,iCAAW,EAAE,kBAAI,EAAE,0CAAe,EAAC,mCAAY,CAAC,CAAC;YACrF,4BAAY;YACZ,0BAAW;YACX,wBAAU;SACX;QACD,SAAS,EAAE;YACT,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,0BAAW,EAAE;YACjD,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,0BAAW,EAAE;YACjD,gCAAc;YACd,yCAAkB;YAClB,4BAAY;YACZ,8CAAqB;YACrB,gBAAU;YACV,wDAAyB;YACzB,kDAAsB;YACtB,gCAAc;SACf;QACD,OAAO,EAAE;YACP,aAAa;YACb,yCAAkB;YAClB,aAAa;YACb,kDAAsB;YACtB,gCAAc;YACd,4BAAY;SACb;QACD,WAAW,EAAE,CAAC,kCAAe,EAAE,gCAAc,EAAC,gCAAc,CAAC;KAC9D,CAAC;GACW,UAAU,CAAG"}