rez_core 6.5.14 → 6.5.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.
- package/dist/app.module.js +2 -2
- package/dist/app.module.js.map +1 -1
- package/dist/module/enterprise/enterprise.module.js +4 -11
- package/dist/module/enterprise/enterprise.module.js.map +1 -1
- package/dist/module/enterprise/service/brand-profile.service.d.ts +0 -0
- package/dist/module/enterprise/service/brand-profile.service.js +1 -0
- package/dist/module/enterprise/service/brand-profile.service.js.map +1 -0
- package/dist/module/enterprise/service/brand.service.d.ts +0 -3
- package/dist/module/enterprise/service/brand.service.js +0 -17
- package/dist/module/enterprise/service/brand.service.js.map +1 -1
- package/dist/module/enterprise/service/school.service.d.ts +0 -0
- package/dist/module/enterprise/service/school.service.js +1 -0
- package/dist/module/enterprise/service/school.service.js.map +1 -0
- package/dist/module/meta/entity.module.js +1 -3
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/module/module.module.js +1 -3
- package/dist/module/module/module.module.js.map +1 -1
- package/dist/module/module/repository/module-access.repository.d.ts +4 -5
- package/dist/module/module/repository/module-access.repository.js +28 -21
- package/dist/module/module/repository/module-access.repository.js.map +1 -1
- package/dist/module/workflow-automation/workflow-automation.module.js +1 -1
- package/dist/module/workflow-automation/workflow-automation.module.js.map +1 -1
- package/dist/table.config.d.ts +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/app.module.ts +2 -2
- package/src/module/enterprise/enterprise.module.ts +10 -15
- package/src/module/enterprise/service/brand-profile.service.ts +10 -0
- package/src/module/enterprise/service/brand.service.ts +75 -5
- package/src/module/enterprise/service/school.service.ts +5 -0
- package/src/module/meta/entity.module.ts +1 -3
- package/src/module/module/module.module.ts +3 -5
- package/src/module/module/repository/module-access.repository.ts +41 -36
- package/src/module/workflow-automation/workflow-automation.module.ts +1 -1
package/package.json
CHANGED
package/src/app.module.ts
CHANGED
|
@@ -31,7 +31,6 @@ import { ExportModule } from './module/export/export.module';
|
|
|
31
31
|
|
|
32
32
|
@Module({
|
|
33
33
|
imports: [
|
|
34
|
-
EntityModule,
|
|
35
34
|
DatabaseModule,
|
|
36
35
|
EnterpriseModule,
|
|
37
36
|
UtilsModule,
|
|
@@ -62,7 +61,8 @@ import { ExportModule } from './module/export/export.module';
|
|
|
62
61
|
MicroserviceClientsModule,
|
|
63
62
|
LinkedAttributesModule,
|
|
64
63
|
EntityJSONModule,
|
|
65
|
-
ExportModule
|
|
64
|
+
ExportModule,
|
|
65
|
+
EntityModule,
|
|
66
66
|
],
|
|
67
67
|
})
|
|
68
68
|
export class AppModule { }
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Module } from '@nestjs/common';
|
|
2
2
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
3
|
-
import {
|
|
4
|
-
import { OrganizationController } from './controller/organization.controller';
|
|
5
|
-
import { OrganizationAppMapping } from './entity/organization-app-mapping.entity';
|
|
3
|
+
import { OrganizationService } from './service/organization.service';
|
|
6
4
|
import { OrganizationData } from './entity/organization.entity';
|
|
5
|
+
import { OrganizationController } from './controller/organization.controller';
|
|
7
6
|
import { OrganizationAppMappingService } from './service/organization-app-mapping.service';
|
|
8
|
-
import {
|
|
7
|
+
import { OrganizationAppMapping } from './entity/organization-app-mapping.entity';
|
|
8
|
+
// import { BrandData } from './entity/brand.entity';
|
|
9
|
+
// import { SchoolData } from './entity/school.entity';
|
|
10
|
+
// import { BrandRepository } from './repository/brand.repository';
|
|
9
11
|
import { UtilsModule } from 'src/utils/utils.module';
|
|
10
|
-
import { EntityModule } from '../meta/entity.module';
|
|
11
12
|
import { OrganizationRepository } from './repository/organization.repository';
|
|
12
13
|
import { SchoolRepository } from './repository/school.repository';
|
|
13
|
-
import { WorkflowAutomationModule } from '../workflow-automation/workflow-automation.module';
|
|
14
14
|
import { EnterpriseService } from './service/enterprise.service';
|
|
15
|
-
import { BrandService } from './service/brand.service';
|
|
16
15
|
import { EnterpriseRepository } from './repository/enterprise.repository';
|
|
17
16
|
import { EnterpriseData } from './entity/enterprise.entity';
|
|
18
17
|
import { EnterpriseController } from './controller/enterprise.controller';
|
|
@@ -22,10 +21,9 @@ import { EnterpriseController } from './controller/enterprise.controller';
|
|
|
22
21
|
TypeOrmModule.forFeature([
|
|
23
22
|
OrganizationData,
|
|
24
23
|
OrganizationAppMapping,
|
|
25
|
-
EnterpriseData
|
|
24
|
+
EnterpriseData,
|
|
26
25
|
]),
|
|
27
26
|
UtilsModule,
|
|
28
|
-
EntityModule,
|
|
29
27
|
],
|
|
30
28
|
controllers: [OrganizationController, EnterpriseController],
|
|
31
29
|
providers: [
|
|
@@ -35,11 +33,8 @@ import { EnterpriseController } from './controller/enterprise.controller';
|
|
|
35
33
|
OrganizationRepository,
|
|
36
34
|
EnterpriseService,
|
|
37
35
|
EnterpriseRepository,
|
|
38
|
-
{
|
|
39
|
-
provide: 'BrandService',
|
|
40
|
-
useClass: BrandService,
|
|
41
|
-
},
|
|
42
36
|
],
|
|
43
37
|
exports: [OrganizationService, OrganizationRepository, EnterpriseService, EnterpriseRepository],
|
|
44
38
|
})
|
|
45
|
-
export class EnterpriseModule {
|
|
39
|
+
export class EnterpriseModule {
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// import { Inject, Injectable } from '@nestjs/common';
|
|
2
|
+
// import { firstValueFrom } from 'rxjs';
|
|
3
|
+
// import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
4
|
+
//
|
|
5
|
+
// @Injectable()
|
|
6
|
+
// export class BrandProfileService extends EntityServiceImpl {
|
|
7
|
+
// constructor() {
|
|
8
|
+
// super();
|
|
9
|
+
// }
|
|
10
|
+
// }
|
|
@@ -1,5 +1,75 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
@Injectable()
|
|
5
|
-
export class BrandService
|
|
1
|
+
// import { Injectable } from '@nestjs/common';
|
|
2
|
+
// import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
+
//
|
|
4
|
+
// @Injectable()
|
|
5
|
+
// export class BrandService {
|
|
6
|
+
// constructor(
|
|
7
|
+
// @InjectRepository(Brand)
|
|
8
|
+
// ) {
|
|
9
|
+
//
|
|
10
|
+
// }
|
|
11
|
+
//
|
|
12
|
+
// async getEntityData(
|
|
13
|
+
// entityType: string,
|
|
14
|
+
// id: number,
|
|
15
|
+
// loggedInUser,
|
|
16
|
+
// ): Promise<any> {
|
|
17
|
+
// const brandResponse = await super.getEntityData(
|
|
18
|
+
// entityType,
|
|
19
|
+
// id,
|
|
20
|
+
// loggedInUser,
|
|
21
|
+
// );
|
|
22
|
+
//
|
|
23
|
+
// return brandResponse;
|
|
24
|
+
// }
|
|
25
|
+
//
|
|
26
|
+
// async createEntity(body: any, userData): Promise<any> {
|
|
27
|
+
// const { entity_type, ...data } = body;
|
|
28
|
+
//
|
|
29
|
+
// const brandData = await super.createEntity(
|
|
30
|
+
// {
|
|
31
|
+
// ...data,
|
|
32
|
+
//
|
|
33
|
+
// entity_type: 'ORG',
|
|
34
|
+
// type: 'BRN',
|
|
35
|
+
// parent_id: userData.organization_id,
|
|
36
|
+
// },
|
|
37
|
+
// userData,
|
|
38
|
+
// );
|
|
39
|
+
//
|
|
40
|
+
// // save brand profile
|
|
41
|
+
//
|
|
42
|
+
// const brandProfile = await super.createEntity(
|
|
43
|
+
// {
|
|
44
|
+
// ...body,
|
|
45
|
+
// parent_id: brandData.id,
|
|
46
|
+
// organization_id: brandData.organization_id,
|
|
47
|
+
// entity_type: 'BRNP',
|
|
48
|
+
// },
|
|
49
|
+
// userData,
|
|
50
|
+
// );
|
|
51
|
+
//
|
|
52
|
+
// return brandProfile;
|
|
53
|
+
// }
|
|
54
|
+
//
|
|
55
|
+
// async updateEntity(body: any, userData): Promise<any> {
|
|
56
|
+
// // update brand table
|
|
57
|
+
// const { id, entity_type, organization_id, ...newBody } = body;
|
|
58
|
+
//
|
|
59
|
+
// const brandProfile = await super.updateEntity(body, userData);
|
|
60
|
+
//
|
|
61
|
+
// // update brand
|
|
62
|
+
// await super.updateEntity(
|
|
63
|
+
// {
|
|
64
|
+
// ...newBody,
|
|
65
|
+
// id: brandProfile.parent_id,
|
|
66
|
+
// parent_id: userData.organization_id,
|
|
67
|
+
// entity_type: 'ORG',
|
|
68
|
+
// type: 'BRN',
|
|
69
|
+
// },
|
|
70
|
+
// userData,
|
|
71
|
+
// );
|
|
72
|
+
//
|
|
73
|
+
// return brandProfile;
|
|
74
|
+
// }
|
|
75
|
+
// }
|
|
@@ -77,12 +77,11 @@ import { EntityRelationRepository } from './repository/entity-relation.repositor
|
|
|
77
77
|
AppMaster,
|
|
78
78
|
EntityRelation,
|
|
79
79
|
EntityRelationData,
|
|
80
|
-
EntityUpdateService
|
|
81
80
|
]),
|
|
82
81
|
forwardRef(() => ListMasterModule),
|
|
83
82
|
forwardRef(() => FilterModule),
|
|
84
83
|
UtilsModule,
|
|
85
|
-
WorkflowAutomationModule,
|
|
84
|
+
forwardRef(() => WorkflowAutomationModule),
|
|
86
85
|
|
|
87
86
|
],
|
|
88
87
|
providers: [
|
|
@@ -123,7 +122,6 @@ import { EntityRelationRepository } from './repository/entity-relation.repositor
|
|
|
123
122
|
ResolverService,
|
|
124
123
|
EntityMasterRepository,
|
|
125
124
|
EntityRelationRepository,
|
|
126
|
-
AppMasterRespository
|
|
127
125
|
],
|
|
128
126
|
exports: [
|
|
129
127
|
EntityMasterService,
|
|
@@ -14,8 +14,6 @@ import { UserRoleMapping } from '../user/entity/user-role-mapping.entity';
|
|
|
14
14
|
import { UserModule } from '../user/user.module';
|
|
15
15
|
import { Role } from '../user/entity/role.entity';
|
|
16
16
|
import { ModuleAccess } from './entity/module-access.entity';
|
|
17
|
-
import { ListMasterModule } from '../listmaster/listmaster.module';
|
|
18
|
-
import { EntityModule } from '../meta/entity.module';
|
|
19
17
|
|
|
20
18
|
@Module({
|
|
21
19
|
imports: [
|
|
@@ -29,15 +27,15 @@ import { EntityModule } from '../meta/entity.module';
|
|
|
29
27
|
]),
|
|
30
28
|
UtilsModule,
|
|
31
29
|
UserModule,
|
|
32
|
-
EntityModule
|
|
33
30
|
],
|
|
34
31
|
controllers: [MenuController, ModuleAccessController],
|
|
35
32
|
providers: [
|
|
36
33
|
ModuleAccessService,
|
|
37
34
|
MenuService,
|
|
38
35
|
MenuRepository,
|
|
39
|
-
ModuleAccessRepository
|
|
36
|
+
ModuleAccessRepository,
|
|
40
37
|
],
|
|
41
38
|
exports: [ModuleAccessService,MenuService],
|
|
42
39
|
})
|
|
43
|
-
export class ModuleAccessModule {
|
|
40
|
+
export class ModuleAccessModule {
|
|
41
|
+
}
|
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
import { BadRequestException, Injectable } from '@nestjs/common';
|
|
2
2
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
-
import { In,
|
|
3
|
+
import { In, IsNull, Not, Or, Repository } from 'typeorm';
|
|
4
4
|
import { Role } from 'src/module/user/entity/role.entity';
|
|
5
5
|
import { ModuleAccess } from '../entity/module-access.entity';
|
|
6
6
|
import { ModuleAction } from '../entity/module-action.entity';
|
|
7
7
|
import { ModuleData } from '../entity/module.entity';
|
|
8
|
-
import {
|
|
8
|
+
import { ReflectionHelper } from '../../../utils/service/reflection-helper.service';
|
|
9
9
|
|
|
10
10
|
@Injectable()
|
|
11
11
|
export class ModuleAccessRepository {
|
|
12
12
|
constructor(
|
|
13
13
|
@InjectRepository(Role)
|
|
14
14
|
private readonly roleRepo: Repository<Role>,
|
|
15
|
-
|
|
16
15
|
@InjectRepository(ModuleData)
|
|
17
16
|
private readonly moduleRepo: Repository<ModuleData>,
|
|
18
|
-
|
|
19
17
|
@InjectRepository(ModuleAccess)
|
|
20
18
|
private readonly moduleAccessRepo: Repository<ModuleAccess>,
|
|
21
|
-
|
|
22
19
|
@InjectRepository(ModuleAction)
|
|
23
20
|
private readonly moduleActionRepo: Repository<ModuleAction>,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
private readonly dataSource: DataSource,
|
|
28
|
-
) {}
|
|
21
|
+
private readonly reflectionHelper: ReflectionHelper,
|
|
22
|
+
) {
|
|
23
|
+
}
|
|
29
24
|
|
|
30
25
|
async getRoles({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
appcode,
|
|
27
|
+
level_type,
|
|
28
|
+
level_id,
|
|
29
|
+
}: {
|
|
35
30
|
appcode: string;
|
|
36
31
|
level_type?: string;
|
|
37
32
|
level_id?: number;
|
|
@@ -63,26 +58,30 @@ export class ModuleAccessRepository {
|
|
|
63
58
|
}
|
|
64
59
|
|
|
65
60
|
async getModules({
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
appcode,
|
|
62
|
+
loggedInUser,
|
|
63
|
+
}: {
|
|
69
64
|
appcode: string;
|
|
70
65
|
loggedInUser: any;
|
|
71
66
|
}) {
|
|
72
67
|
let modules: any[];
|
|
73
68
|
if (loggedInUser.level_type == 'SCH') {
|
|
74
69
|
modules = await this.moduleRepo.find({
|
|
75
|
-
where: {
|
|
70
|
+
where: {
|
|
71
|
+
module_level: 'MAINMOD',
|
|
76
72
|
app: {
|
|
77
|
-
code: appcode
|
|
73
|
+
code: appcode,
|
|
78
74
|
},
|
|
79
|
-
level_type: 'SCH'
|
|
75
|
+
level_type: 'SCH',
|
|
80
76
|
},
|
|
81
77
|
});
|
|
82
78
|
} else {
|
|
83
79
|
modules = await this.moduleRepo.find({
|
|
84
|
-
where: {
|
|
85
|
-
|
|
80
|
+
where: {
|
|
81
|
+
module_level: 'MAINMOD', app: {
|
|
82
|
+
code: appcode,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
86
85
|
});
|
|
87
86
|
}
|
|
88
87
|
|
|
@@ -116,7 +115,7 @@ export class ModuleAccessRepository {
|
|
|
116
115
|
where: {
|
|
117
116
|
id: In(fetchedRoleIds),
|
|
118
117
|
app: {
|
|
119
|
-
code: appcode
|
|
118
|
+
code: appcode,
|
|
120
119
|
},
|
|
121
120
|
},
|
|
122
121
|
});
|
|
@@ -125,7 +124,7 @@ export class ModuleAccessRepository {
|
|
|
125
124
|
where: {
|
|
126
125
|
id: In(roleIds.map((id) => Number(id))),
|
|
127
126
|
app: {
|
|
128
|
-
code: appcode
|
|
127
|
+
code: appcode,
|
|
129
128
|
},
|
|
130
129
|
},
|
|
131
130
|
});
|
|
@@ -137,14 +136,14 @@ export class ModuleAccessRepository {
|
|
|
137
136
|
where: {
|
|
138
137
|
role_id: In(roles.map((role) => role.id)),
|
|
139
138
|
app: {
|
|
140
|
-
code: appcode
|
|
139
|
+
code: appcode,
|
|
141
140
|
},
|
|
142
|
-
level_type: levelType
|
|
141
|
+
level_type: levelType,
|
|
143
142
|
},
|
|
144
143
|
relations: {
|
|
145
144
|
app: true,
|
|
146
|
-
module: true
|
|
147
|
-
}
|
|
145
|
+
module: true,
|
|
146
|
+
},
|
|
148
147
|
});
|
|
149
148
|
|
|
150
149
|
return roles.map((role) => ({
|
|
@@ -159,13 +158,19 @@ export class ModuleAccessRepository {
|
|
|
159
158
|
level_type: access.level_type,
|
|
160
159
|
app_id: access.app_id,
|
|
161
160
|
code: access.module.module_code,
|
|
162
|
-
appcode: access.app.code
|
|
161
|
+
appcode: access.app.code,
|
|
163
162
|
})),
|
|
164
163
|
}));
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
async getAllModulesByLevel(mainModIds: string[], appcode: string, levelType) {
|
|
168
|
-
const
|
|
167
|
+
const appMasterRepo = this.reflectionHelper.getRepoService('AppMaster');
|
|
168
|
+
|
|
169
|
+
const appMaster = await appMasterRepo.find({
|
|
170
|
+
where: {
|
|
171
|
+
code: appcode
|
|
172
|
+
}
|
|
173
|
+
});
|
|
169
174
|
|
|
170
175
|
if (!appMaster) {
|
|
171
176
|
return {};
|
|
@@ -175,10 +180,10 @@ export class ModuleAccessRepository {
|
|
|
175
180
|
mainModIds.length === 1 && mainModIds[0] === '-1'
|
|
176
181
|
? await this.moduleRepo.find({
|
|
177
182
|
where: { module_level: 'MAINMOD', app_id: appMaster[0].id },
|
|
178
|
-
|
|
183
|
+
})
|
|
179
184
|
: await this.moduleRepo.find({
|
|
180
|
-
|
|
181
|
-
|
|
185
|
+
where: { id: In(mainModIds), module_level: 'MAINMOD', app: { code: appcode } },
|
|
186
|
+
});
|
|
182
187
|
|
|
183
188
|
if (!mainModules.length) return {};
|
|
184
189
|
|
|
@@ -242,7 +247,7 @@ export class ModuleAccessRepository {
|
|
|
242
247
|
(mod) =>
|
|
243
248
|
mod.wbs_code.startsWith(`${parentWbs}.`) &&
|
|
244
249
|
mod.wbs_code.split('.').length ===
|
|
245
|
-
|
|
250
|
+
parentWbs.split('.').length + 1,
|
|
246
251
|
)
|
|
247
252
|
.map((mod) => ({
|
|
248
253
|
name: mod.name,
|
|
@@ -287,11 +292,11 @@ export class ModuleAccessRepository {
|
|
|
287
292
|
code: access.role_code,
|
|
288
293
|
},
|
|
289
294
|
module: {
|
|
290
|
-
module_code: access.module_code
|
|
295
|
+
module_code: access.module_code,
|
|
291
296
|
},
|
|
292
297
|
action_type: access.action_type,
|
|
293
298
|
app: {
|
|
294
|
-
code: access.appcode
|
|
299
|
+
code: access.appcode,
|
|
295
300
|
},
|
|
296
301
|
level_type: access.level_type,
|
|
297
302
|
},
|
|
@@ -28,7 +28,7 @@ import { WorkflowScheduleModule } from '../workflow-schedule/workflow-schedule.m
|
|
|
28
28
|
ListMasterData,
|
|
29
29
|
ActionCategory
|
|
30
30
|
]),
|
|
31
|
-
FilterModule,
|
|
31
|
+
forwardRef(() => FilterModule),
|
|
32
32
|
forwardRef(() => EntityModule),
|
|
33
33
|
DiscoveryModule, // 👈 enables provider scanning
|
|
34
34
|
],
|