rez_core 6.5.69 → 6.5.71
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/module/enterprise/controller/meta.controller.d.ts +1 -1
- package/dist/module/enterprise/controller/meta.controller.js +7 -6
- package/dist/module/enterprise/controller/meta.controller.js.map +1 -1
- package/dist/module/enterprise/service/populate-meta.service.d.ts +1 -1
- package/dist/module/enterprise/service/populate-meta.service.js +7 -11
- package/dist/module/enterprise/service/populate-meta.service.js.map +1 -1
- package/dist/module/meta/entity.module.js +2 -1
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/workflow/repository/task.repository.js +1 -0
- package/dist/module/workflow/repository/task.repository.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/enterprise/controller/meta.controller.ts +2 -1
- package/src/module/enterprise/service/populate-meta.service.ts +7 -11
- package/src/module/meta/entity.module.ts +2 -1
- package/src/module/workflow/repository/task.repository.ts +2 -1
package/package.json
CHANGED
|
@@ -11,13 +11,14 @@ export class MetaController {
|
|
|
11
11
|
@Post('populate')
|
|
12
12
|
@HttpCode(HttpStatus.OK)
|
|
13
13
|
async populateMetaData(
|
|
14
|
+
@Query('enterprise_id') enterpriseId: number,
|
|
14
15
|
@Query('organization_id') organizationId: number,
|
|
15
16
|
@Res() response: Response,
|
|
16
17
|
@Req() req: Request & { user: any },
|
|
17
18
|
) {
|
|
18
19
|
const loggedInUser = req.user.userData;
|
|
19
20
|
const result =
|
|
20
|
-
await this.populateMetaService.populateMetaData(organizationId);
|
|
21
|
+
await this.populateMetaService.populateMetaData(enterpriseId, organizationId);
|
|
21
22
|
return response.status(HttpStatus.OK).json(result);
|
|
22
23
|
}
|
|
23
24
|
}
|
|
@@ -8,7 +8,7 @@ export class PopulateMetaService {
|
|
|
8
8
|
) {
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
async populateMetaData(organization_id: number) {
|
|
11
|
+
async populateMetaData(enterprise_id: number, organization_id: number) {
|
|
12
12
|
const metadataTables = [
|
|
13
13
|
'frm_entity_master',
|
|
14
14
|
'frm_entity_attribute',
|
|
@@ -37,7 +37,7 @@ export class PopulateMetaService {
|
|
|
37
37
|
if (!listMasterItemsRepo) return;
|
|
38
38
|
|
|
39
39
|
const getStatus = (await listMasterItemsRepo.find({
|
|
40
|
-
where: {
|
|
40
|
+
where: { enterprise_id: enterprise_id, code: 'STATUS_ACTIVE' },
|
|
41
41
|
})) as any[];
|
|
42
42
|
|
|
43
43
|
let status: any;
|
|
@@ -49,11 +49,11 @@ export class PopulateMetaService {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
let oneToManyId = await listMasterItemsRepo?.find({
|
|
52
|
-
where: { value: 'ONE_TO_MANY',
|
|
52
|
+
where: { value: 'ONE_TO_MANY', enterprise_id: enterprise_id },
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
let oneToOneId = await listMasterItemsRepo?.find({
|
|
56
|
-
where: { value: 'ONE_TO_ONE',
|
|
56
|
+
where: { value: 'ONE_TO_ONE', enterprise_id: enterprise_id },
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
// Step 1: Insert basic metadata tables
|
|
@@ -67,7 +67,7 @@ export class PopulateMetaService {
|
|
|
67
67
|
|
|
68
68
|
const factoryData = await transformRepo?.find({
|
|
69
69
|
where: {
|
|
70
|
-
|
|
70
|
+
enterprise_id: -1,
|
|
71
71
|
level_type: 'ORG',
|
|
72
72
|
level_id: -1,
|
|
73
73
|
},
|
|
@@ -76,7 +76,7 @@ export class PopulateMetaService {
|
|
|
76
76
|
transformedData = factoryData.map(
|
|
77
77
|
({ id, created_date, modified_date, ...rest }) => ({
|
|
78
78
|
...rest,
|
|
79
|
-
|
|
79
|
+
enterprise_id,
|
|
80
80
|
level_type: 'ORG',
|
|
81
81
|
level_id: organization_id,
|
|
82
82
|
is_workflow: rest.is_workflow == 1 ? true : false,
|
|
@@ -87,7 +87,7 @@ export class PopulateMetaService {
|
|
|
87
87
|
transformRepo = attributeMasterRepo;
|
|
88
88
|
const factoryData = await transformRepo?.find({
|
|
89
89
|
where: {
|
|
90
|
-
|
|
90
|
+
enterprise_id: -1,
|
|
91
91
|
level_type: 'ORG',
|
|
92
92
|
level_id: -1,
|
|
93
93
|
},
|
|
@@ -96,7 +96,6 @@ export class PopulateMetaService {
|
|
|
96
96
|
transformedData = factoryData.map(
|
|
97
97
|
({ id, created_date, modified_date, ...rest }) => ({
|
|
98
98
|
...rest,
|
|
99
|
-
organization_id,
|
|
100
99
|
level_type: 'ORG',
|
|
101
100
|
level_id: organization_id,
|
|
102
101
|
// is_unique: rest.is_unique == 1 ? true : false,
|
|
@@ -118,7 +117,6 @@ export class PopulateMetaService {
|
|
|
118
117
|
transformedData = factoryData.map(
|
|
119
118
|
({ id, created_date, modified_date, ...rest }) => ({
|
|
120
119
|
...rest,
|
|
121
|
-
organization_id,
|
|
122
120
|
level_type: 'ORG',
|
|
123
121
|
level_id: organization_id,
|
|
124
122
|
status: status,
|
|
@@ -171,7 +169,6 @@ export class PopulateMetaService {
|
|
|
171
169
|
const { id, mapped_entity_type, display_type, ...rest } = entityTable;
|
|
172
170
|
entityTable = {
|
|
173
171
|
...rest,
|
|
174
|
-
organization_id,
|
|
175
172
|
mapped_entity_type: mapped_entity_type,
|
|
176
173
|
level_type: 'ORG',
|
|
177
174
|
level_id: organization_id,
|
|
@@ -198,7 +195,6 @@ export class PopulateMetaService {
|
|
|
198
195
|
const { id, created_date, modified_date, ...columnRest } = column;
|
|
199
196
|
const newColumn = {
|
|
200
197
|
...columnRest,
|
|
201
|
-
organization_id,
|
|
202
198
|
parent_id: newId,
|
|
203
199
|
level_type: 'ORG',
|
|
204
200
|
level_id: organization_id,
|
|
@@ -82,6 +82,7 @@ import { AppMasterModule } from '../app_master/app-master.module';
|
|
|
82
82
|
providers: [
|
|
83
83
|
EntityMasterService,
|
|
84
84
|
EntityServiceImpl,
|
|
85
|
+
{provide: 'EntityDynamicService', useClass: EntityDynamicService},
|
|
85
86
|
EntityDynamicService,
|
|
86
87
|
{ provide: 'CommonService', useClass: CommonService },
|
|
87
88
|
AttributeMasterRepository,
|
|
@@ -129,7 +130,7 @@ import { AppMasterModule } from '../app_master/app-master.module';
|
|
|
129
130
|
AttributeMasterService,
|
|
130
131
|
MasterService,
|
|
131
132
|
ResolverService,
|
|
132
|
-
EntityDynamicService,
|
|
133
|
+
'EntityDynamicService',
|
|
133
134
|
'CommonService',
|
|
134
135
|
'EntityRelationService',
|
|
135
136
|
],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
1
|
+
import { Inject, Injectable } from '@nestjs/common';
|
|
2
2
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
3
|
import { TaskDataEntity } from '../entity/task-data.entity';
|
|
4
4
|
import { EntityManager, Repository } from 'typeorm';
|
|
@@ -12,6 +12,7 @@ export class TaskRepository {
|
|
|
12
12
|
constructor(
|
|
13
13
|
@InjectRepository(TaskDataEntity)
|
|
14
14
|
private readonly taskRepository: Repository<TaskDataEntity>,
|
|
15
|
+
@Inject('EntityDynamicService')
|
|
15
16
|
private readonly entityDynamicService: EntityDynamicService,
|
|
16
17
|
private readonly reflectionHelper: ReflectionHelper,
|
|
17
18
|
private readonly entityManager:EntityManager,
|