rez_core 6.5.68 → 6.5.70

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "6.5.68",
3
+ "version": "6.5.70",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -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: { organization_id: organization_id, code: 'STATUS_ACTIVE' },
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', organization_id: organization_id },
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', organization_id: organization_id },
56
+ where: { value: 'ONE_TO_ONE', enterprise_id: enterprise_id },
57
57
  });
58
58
 
59
59
  // Step 1: Insert basic metadata tables
@@ -76,7 +76,7 @@ export class PopulateMetaService {
76
76
  transformedData = factoryData.map(
77
77
  ({ id, created_date, modified_date, ...rest }) => ({
78
78
  ...rest,
79
- organization_id,
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
- organization_id: -1,
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,
@@ -27,7 +27,6 @@ export class EntityDynamicService extends EntityServiceImpl{
27
27
  loggedInUser: any,
28
28
  mainID?: number,
29
29
  ): Promise<any> {
30
- const organizationId = loggedInUser.organization_id;
31
30
  const enterprise_id = loggedInUser.enterprise_id;
32
31
 
33
32
  const tableName = await this.getTableName(entityType, enterprise_id);
@@ -44,9 +43,6 @@ export class EntityDynamicService extends EntityServiceImpl{
44
43
  if (loggedInUser) {
45
44
  entityData.created_by = loggedInUser.id;
46
45
 
47
- if (!entityData.organization_id)
48
- entityData.organization_id = loggedInUser.organization_id;
49
-
50
46
  if (!entityData.enterprise_id)
51
47
  entityData.enterprise_id = loggedInUser.enterprise_id;
52
48
 
@@ -66,7 +62,7 @@ export class EntityDynamicService extends EntityServiceImpl{
66
62
  const statusList = listMasterItemsRepo.find({
67
63
  where: {
68
64
  code: STATUS_ACTIVE,
69
- organization_id: organizationId,
65
+ enterprise_id: enterprise_id,
70
66
  },
71
67
  });
72
68
 
@@ -104,7 +100,6 @@ export class EntityDynamicService extends EntityServiceImpl{
104
100
  const bypassColumns = [
105
101
  'created_date',
106
102
  'created_by',
107
- 'organization_id',
108
103
  'enterprise_id',
109
104
  'level_type',
110
105
  'level_id',
@@ -163,7 +158,6 @@ export class EntityDynamicService extends EntityServiceImpl{
163
158
  ): Promise<any> {
164
159
  const entityType = data.entity_type;
165
160
  const enterpriseId = loggedInUser.enterprise_id;
166
- const organizationId = loggedInUser.organization_id;
167
161
 
168
162
  const repo = this.reflectionHelper.getRepoService('EntityRelation');
169
163
 
@@ -213,7 +207,6 @@ export class EntityDynamicService extends EntityServiceImpl{
213
207
  this.reflectionHelper.getRepoService('EntityRelationData');
214
208
 
215
209
  await relationRepo.save({
216
- organizationId: organizationId,
217
210
  enterprise_id: enterpriseId,
218
211
  source_entity_id: mainID,
219
212
  source_entity_type: entityType,
@@ -323,7 +316,6 @@ export class EntityDynamicService extends EntityServiceImpl{
323
316
  loggedInUser: any,
324
317
  ): Promise<any> {
325
318
  const entityType = data.entity_type;
326
- const organizationId = loggedInUser.organization_id;
327
319
  const enterpriseId = loggedInUser.enterprise_id;
328
320
  const { mappedEntities, ...mainData } = data;
329
321
 
@@ -402,7 +394,6 @@ export class EntityDynamicService extends EntityServiceImpl{
402
394
  const entityRelationDataRepo =
403
395
  this.reflectionHelper.getRepoService('EntityRelationData');
404
396
  await entityRelationDataRepo.save({
405
- organizationId: organizationId,
406
397
  enterprise_id: enterpriseId,
407
398
  source_entity_id: data.id,
408
399
  source_entity_type: entityType,
@@ -463,9 +454,6 @@ export class EntityDynamicService extends EntityServiceImpl{
463
454
  if (loggedInUser) {
464
455
  entityData.modified_by = loggedInUser.id;
465
456
 
466
- if (!entityData.organization_id && entityData.entity_type !== 'ORG')
467
- entityData.organization_id = loggedInUser.organization_id;
468
-
469
457
  if (!entityData.enterprise_id)
470
458
  entityData.enterprise_id = loggedInUser.enterprise_id;
471
459
  }
@@ -480,7 +468,6 @@ export class EntityDynamicService extends EntityServiceImpl{
480
468
  'created_by',
481
469
  'modified_date',
482
470
  'modified_by',
483
- 'organization_id',
484
471
  'enterprise_id',
485
472
  'level_type',
486
473
  'level_id',