rez_core 3.1.44 → 3.1.46

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 (26) hide show
  1. package/dist/module/integration/controller/integration.controller.js +20 -0
  2. package/dist/module/integration/controller/integration.controller.js.map +1 -1
  3. package/dist/module/meta/controller/meta.controller.d.ts +28 -0
  4. package/dist/module/meta/controller/meta.controller.js +12 -0
  5. package/dist/module/meta/controller/meta.controller.js.map +1 -1
  6. package/dist/module/meta/repository/entity-master.repository.d.ts +29 -1
  7. package/dist/module/meta/repository/entity-master.repository.js +17 -2
  8. package/dist/module/meta/repository/entity-master.repository.js.map +1 -1
  9. package/dist/module/meta/service/entity-dynamic.service.d.ts +1 -1
  10. package/dist/module/meta/service/entity-dynamic.service.js +10 -2
  11. package/dist/module/meta/service/entity-dynamic.service.js.map +1 -1
  12. package/dist/module/meta/service/entity-master.service.d.ts +26 -0
  13. package/dist/module/meta/service/entity-master.service.js +3 -0
  14. package/dist/module/meta/service/entity-master.service.js.map +1 -1
  15. package/dist/module/workflow-automation/entity/workflow-automation.entity.d.ts +1 -1
  16. package/dist/module/workflow-automation/entity/workflow-automation.entity.js +1 -1
  17. package/dist/module/workflow-automation/entity/workflow-automation.entity.js.map +1 -1
  18. package/dist/module/workflow-automation/service/workflow-automation.service.d.ts +1 -1
  19. package/dist/tsconfig.build.tsbuildinfo +1 -1
  20. package/package.json +1 -1
  21. package/src/module/integration/controller/integration.controller.ts +20 -1
  22. package/src/module/meta/controller/meta.controller.ts +7 -0
  23. package/src/module/meta/repository/entity-master.repository.ts +17 -1
  24. package/src/module/meta/service/entity-dynamic.service.ts +12 -0
  25. package/src/module/meta/service/entity-master.service.ts +4 -0
  26. package/src/module/workflow-automation/entity/workflow-automation.entity.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "3.1.44",
3
+ "version": "3.1.46",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -478,6 +478,24 @@ export class IntegrationController {
478
478
  },
479
479
  };
480
480
  }
481
+ } else if (integration_type === 'WA' && integration_provider) {
482
+ if (integration_provider.toLowerCase() == 'tubelight') {
483
+ return {
484
+ success: true,
485
+ data: {
486
+ baseUrl: 'https://portal.tubelightcommunications.com',
487
+ agentLoginUrl: 'https://dashboard.hellotubelight.com/sign-in',
488
+ },
489
+ };
490
+ } else if (integration_provider.toLowerCase() == 'gupshup') {
491
+ return {
492
+ success: true,
493
+ data: {
494
+ baseUrl: 'https://api.gupshup.io',
495
+ agentLoginUrl: 'https://login.gupshup.io/u/login',
496
+ },
497
+ };
498
+ }
481
499
  }
482
500
  }
483
501
 
@@ -486,7 +504,8 @@ export class IntegrationController {
486
504
  @Query('level_id', ParseIntPipe) levelId: number,
487
505
  @Query('level_type') levelType: string,
488
506
  @Query('app_code') appCode: string,
489
- @Query('integration_type') integrationType: 'EMAIL' | 'SMS' | 'WA' | 'TELEPHONE',
507
+ @Query('integration_type')
508
+ integrationType: 'EMAIL' | 'SMS' | 'WA' | 'TELEPHONE',
490
509
  ) {
491
510
  try {
492
511
  const config = await this.integrationService.getSingleActiveConfig(
@@ -72,4 +72,11 @@ export class MetaController {
72
72
  await this.populateMetaService.populateMetaData(organizationId);
73
73
  return response.status(HttpStatus.OK).json(result);
74
74
  }
75
+
76
+ @Post('operation-list')
77
+ async getOperationList(@Req() req: Request & { user: any }) {
78
+ const loggedInUser = req.user.userData;
79
+ const result = await this.entityMaster.getOperationList(loggedInUser);
80
+ return result;
81
+ }
75
82
  }
@@ -1,7 +1,8 @@
1
- import { Injectable } from '@nestjs/common';
1
+ import { Inject, Injectable } from '@nestjs/common';
2
2
  import { EntityMaster } from '../entity/entity-master.entity';
3
3
  import { InjectRepository } from '@nestjs/typeorm';
4
4
  import { Repository, DataSource } from 'typeorm';
5
+ import { ListMasterService } from 'src/module/listmaster/service/list-master.service';
5
6
 
6
7
  @Injectable()
7
8
  export class EntityMasterRepository {
@@ -9,6 +10,8 @@ export class EntityMasterRepository {
9
10
  @InjectRepository(EntityMaster)
10
11
  private readonly entityMasterRepository: Repository<EntityMaster>,
11
12
  private readonly dataSource: DataSource,
13
+ @Inject('ListMasterService')
14
+ private readonly listMasterService: ListMasterService,
12
15
  ) {}
13
16
 
14
17
  async getEntityById(id: number): Promise<EntityMaster | null> {
@@ -26,4 +29,17 @@ export class EntityMasterRepository {
26
29
  },
27
30
  });
28
31
  }
32
+
33
+ async getOperationList(loggedInUser: any) {
34
+ const [text, number, date, select, multiselect, year] = await Promise.all([
35
+ this.listMasterService.getDropdownOptions('OPT', {}, [], loggedInUser),
36
+ this.listMasterService.getDropdownOptions('OPN', {}, [], loggedInUser),
37
+ this.listMasterService.getDropdownOptions('OPD', {}, [], loggedInUser),
38
+ this.listMasterService.getDropdownOptions('OPS', {}, [], loggedInUser),
39
+ this.listMasterService.getDropdownOptions('OPM', {}, [], loggedInUser),
40
+ this.listMasterService.getDropdownOptions('OPY', {}, [], loggedInUser),
41
+ ]);
42
+
43
+ return { text, number, date, select, multiselect, year };
44
+ }
29
45
  }
@@ -335,6 +335,7 @@ export class EntityDynamicService {
335
335
  item.id,
336
336
  item,
337
337
  loggedInUser,
338
+ Number(id), // pass main entity id as parent_id
338
339
  );
339
340
  targetEntityId = item.id;
340
341
  entityData = await this.getEntity(
@@ -397,6 +398,7 @@ export class EntityDynamicService {
397
398
  id: number | string,
398
399
  entityData: Record<string, any>,
399
400
  loggedInUser: any,
401
+ mainID?: number,
400
402
  ): Promise<any> {
401
403
  const organizationId = loggedInUser.organization_id;
402
404
 
@@ -433,6 +435,11 @@ export class EntityDynamicService {
433
435
  entityData.code = `${entityData.entity_type}${maxSeqNo}`;
434
436
  }
435
437
 
438
+ // Set parent_id if mainID is provided
439
+ if (mainID) {
440
+ entityData.parent_id = mainID;
441
+ }
442
+
436
443
  const bypassColumn = [
437
444
  {
438
445
  attribute_key: 'created_date',
@@ -477,6 +484,11 @@ export class EntityDynamicService {
477
484
  element_type: 'text',
478
485
  },
479
486
  { attribute_key: 'code', db_datatype: 'varchar', element_type: 'text' },
487
+ {
488
+ attribute_key: 'parent_id',
489
+ db_datatype: 'int',
490
+ element_type: 'number',
491
+ },
480
492
  ];
481
493
 
482
494
  validAttributes.push(...bypassColumn);
@@ -150,4 +150,8 @@ export class EntityMasterService {
150
150
 
151
151
  return entityMasterData;
152
152
  }
153
+
154
+ async getOperationList(loggedInUser: any) {
155
+ return await this.entityMasterRepo.getOperationList(loggedInUser);
156
+ }
153
157
  }
@@ -28,5 +28,5 @@ export class WorkflowAutomation extends BaseEntity {
28
28
  trigger_type: string;
29
29
 
30
30
  @Column({ type: 'json', nullable: true })
31
- schedule: JSON;
31
+ schedule: string;
32
32
  }