rez_core 2.2.255 → 2.2.257

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 (36) hide show
  1. package/dist/module/communication/communication.module.js +7 -8
  2. package/dist/module/communication/communication.module.js.map +1 -1
  3. package/dist/module/communication/entity/integration-source.entity.d.ts +6 -0
  4. package/dist/module/communication/entity/integration-source.entity.js +33 -0
  5. package/dist/module/communication/entity/integration-source.entity.js.map +1 -0
  6. package/dist/module/listmaster/service/list-master.service.js +1 -0
  7. package/dist/module/listmaster/service/list-master.service.js.map +1 -1
  8. package/dist/module/meta/controller/meta.controller.d.ts +6 -1
  9. package/dist/module/meta/controller/meta.controller.js +23 -2
  10. package/dist/module/meta/controller/meta.controller.js.map +1 -1
  11. package/dist/module/meta/repository/entity-master.repository.d.ts +1 -0
  12. package/dist/module/meta/repository/entity-master.repository.js +8 -0
  13. package/dist/module/meta/repository/entity-master.repository.js.map +1 -1
  14. package/dist/module/meta/service/entity-master.service.d.ts +8 -2
  15. package/dist/module/meta/service/entity-master.service.js +37 -2
  16. package/dist/module/meta/service/entity-master.service.js.map +1 -1
  17. package/dist/module/meta/service/entity-table.service.js.map +1 -1
  18. package/dist/module/workflow/controller/action.controller.d.ts +1 -0
  19. package/dist/module/workflow/repository/action.repository.d.ts +1 -0
  20. package/dist/module/workflow/repository/action.repository.js +2 -0
  21. package/dist/module/workflow/repository/action.repository.js.map +1 -1
  22. package/dist/module/workflow/service/action.service.d.ts +1 -0
  23. package/dist/tsconfig.build.tsbuildinfo +1 -1
  24. package/package.json +1 -1
  25. package/src/module/communication/communication.module.ts +7 -8
  26. package/src/module/communication/entity/integration-source.entity.ts +14 -0
  27. package/src/module/listmaster/service/list-master.service.ts +1 -0
  28. package/src/module/meta/controller/meta.controller.ts +20 -0
  29. package/src/module/meta/repository/entity-master.repository.ts +12 -0
  30. package/src/module/meta/service/entity-master.service.ts +91 -2
  31. package/src/module/meta/service/entity-table.service.ts +0 -2
  32. package/src/module/workflow/repository/action.repository.ts +2 -0
  33. package/dist/module/communication/controller/webhook.controller.d.ts +0 -4
  34. package/dist/module/communication/controller/webhook.controller.js +0 -38
  35. package/dist/module/communication/controller/webhook.controller.js.map +0 -1
  36. package/src/module/communication/controller/webhook.controller.ts +0 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.2.255",
3
+ "version": "2.2.257",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -45,19 +45,18 @@ import { GoogleService } from './service/calendar-event.service';
45
45
  import { WrapperService } from './service/wrapper.service';
46
46
  import { WrapperController } from './controller/wrapper.controller';
47
47
  import { IcsMeetingModule } from '../ics/ics.module';
48
- import { WebhookController } from './controller/webhook.controller';
48
+ import { IntegrationConfig } from './entity/integration-source.entity';
49
49
 
50
50
  @Module({
51
51
  imports: [
52
- TypeOrmModule.forFeature([CommunicationConfig, CommunicationHub]),
52
+ TypeOrmModule.forFeature([
53
+ CommunicationConfig,
54
+ CommunicationHub,
55
+ IntegrationConfig,
56
+ ]),
53
57
  IcsMeetingModule,
54
58
  ],
55
- controllers: [
56
- CommunicationController,
57
- GoogleController,
58
- WrapperController,
59
- WebhookController,
60
- ],
59
+ controllers: [CommunicationController, GoogleController, WrapperController],
61
60
  providers: [
62
61
  // Main Services
63
62
  CommunicationService,
@@ -0,0 +1,14 @@
1
+ import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
2
+ import { Column, Entity } from 'typeorm';
3
+
4
+ @Entity({ name: 'cr_integration_master' })
5
+ export class IntegrationConfig extends BaseEntity {
6
+ @Column({ name: 'logo', type: 'varchar', length: 100 })
7
+ logo: string;
8
+
9
+ @Column({ name: 'base_url', type: 'varchar', length: 100 })
10
+ base_url: string;
11
+
12
+ @Column({ name: 'integration_type', type: 'varchar', length: 20 })
13
+ integration_type: string;
14
+ }
@@ -22,6 +22,7 @@ export class ListMasterService {
22
22
  private readonly entityManager: EntityManager,
23
23
  @Inject(forwardRef(() => EntityServiceImpl))
24
24
  private readonly entityServiceImpl: EntityServiceImpl,
25
+ @Inject(forwardRef(() => EntityMasterService))
25
26
  private readonly entityMasterService: EntityMasterService,
26
27
  private readonly listMasterRepo: ListMasterRepository,
27
28
  private readonly listItemsRepo: ListMasterItemsRepository,
@@ -11,6 +11,7 @@ import { EntityTableService } from '../service/entity-table.service';
11
11
  import { Response } from 'express';
12
12
  import { JwtAuthGuard } from '../../auth/guards/jwt.guard';
13
13
  import { PopulateMetaService } from '../service/populate-meta.service';
14
+ import { EntityMasterService } from '../service/entity-master.service';
14
15
 
15
16
  @Controller('meta')
16
17
  @UseGuards(JwtAuthGuard)
@@ -18,6 +19,7 @@ export class MetaController {
18
19
  constructor(
19
20
  private readonly entityTableService: EntityTableService,
20
21
  private readonly populateMetaService: PopulateMetaService,
22
+ private readonly entityMaster: EntityMasterService,
21
23
  ) {}
22
24
 
23
25
  @Post('get-table-data')
@@ -41,6 +43,24 @@ export class MetaController {
41
43
  });
42
44
  }
43
45
 
46
+ @Post('get-filter-data')
47
+ async getFilterData(
48
+ @Query('entity_type') entityType: string,
49
+ @Res() response: Response,
50
+ @Req() req: Request & { user: any },
51
+ ) {
52
+ const loggedInUser = req.user.userData;
53
+ const entitydata = await this.entityMaster.getFilterMetaData(
54
+ entityType,
55
+ loggedInUser,
56
+ );
57
+ return response.status(HttpStatus.OK).json({
58
+ success: true,
59
+ data: entitydata,
60
+ message: 'Data fetch successfully!',
61
+ });
62
+ }
63
+
44
64
  @Post('populate')
45
65
  async populateMetaData(
46
66
  @Query('organization_id') organizationId: number,
@@ -14,4 +14,16 @@ export class EntityMasterRepository {
14
14
  async getEntityById(id: number): Promise<EntityMaster | null> {
15
15
  return await this.entityMasterRepository.findOne({ where: { id } });
16
16
  }
17
+
18
+ async getEntityByMappedEntityType(
19
+ mappedEntityType: string,
20
+ organizationId: number,
21
+ ): Promise<EntityMaster | null> {
22
+ return await this.entityMasterRepository.findOne({
23
+ where: {
24
+ mapped_entity_type: mappedEntityType,
25
+ organization_id: organizationId,
26
+ },
27
+ });
28
+ }
17
29
  }
@@ -1,8 +1,10 @@
1
- import { Injectable } from '@nestjs/common';
2
- import { Repository } from 'typeorm';
1
+ import { forwardRef, Inject, Injectable } from '@nestjs/common';
2
+ import { DataSource, Repository } from 'typeorm';
3
3
  import { InjectRepository } from '@nestjs/typeorm';
4
4
  import { EntityMaster } from '../entity/entity-master.entity';
5
5
  import { EntityMasterRepository } from '../repository/entity-master.repository';
6
+ import { ListMasterService } from 'src/module/listmaster/service/list-master.service';
7
+ import { SavedFilterRepositoryService } from 'src/module/filter/repository/saved-filter.repository';
6
8
 
7
9
  @Injectable()
8
10
  export class EntityMasterService {
@@ -11,6 +13,10 @@ export class EntityMasterService {
11
13
  private entityMasterRepository: Repository<EntityMaster>,
12
14
 
13
15
  private entityMasterRepo: EntityMasterRepository,
16
+ private readonly dataSource: DataSource,
17
+ @Inject('ListMasterService')
18
+ private readonly listMasterService: ListMasterService,
19
+ private readonly savedFilterRepoService: SavedFilterRepositoryService,
14
20
  ) {}
15
21
 
16
22
  async getEntityById(id: number): Promise<EntityMaster | null> {
@@ -61,4 +67,87 @@ export class EntityMasterService {
61
67
  where: { mapped_entity_type: mappedEntityType },
62
68
  });
63
69
  }
70
+
71
+ async getFilterMetaData(entityType: string, loggedInUser: any) {
72
+ // Step 1: Get entity_master record by mapped_entity_type
73
+ const entityMasterData =
74
+ await this.entityMasterRepo.getEntityByMappedEntityType(
75
+ entityType,
76
+ loggedInUser.organization_id,
77
+ );
78
+
79
+ if (!entityMasterData) {
80
+ throw new Error(
81
+ `Entity master with mapped_entity_type "${entityType}" not found.`,
82
+ );
83
+ }
84
+
85
+ // Step 2: Get attribute_master (instead of entity_table_column)
86
+ const attributes = await this.dataSource.query(
87
+ `SELECT *
88
+ FROM cr_attribute_master
89
+ WHERE mapped_entity_type = ?
90
+ AND organization_id = ? `,
91
+ [entityMasterData.mapped_entity_type, loggedInUser.organization_id],
92
+ );
93
+
94
+ // Step 3: Attach column_list from attribute_master
95
+ entityMasterData['attribute_list'] = attributes;
96
+
97
+ // Step 4: Keep existing operation_list logic
98
+ entityMasterData['operation_list'] = {
99
+ text: await this.listMasterService.getDropdownOptions(
100
+ 'OPT',
101
+ {},
102
+ [],
103
+ loggedInUser,
104
+ ),
105
+ number: await this.listMasterService.getDropdownOptions(
106
+ 'OPN',
107
+ {},
108
+ [],
109
+ loggedInUser,
110
+ ),
111
+ date: await this.listMasterService.getDropdownOptions(
112
+ 'OPD',
113
+ {},
114
+ [],
115
+ loggedInUser,
116
+ ),
117
+ select: await this.listMasterService.getDropdownOptions(
118
+ 'OPS',
119
+ {},
120
+ [],
121
+ loggedInUser,
122
+ ),
123
+ multiselect: await this.listMasterService.getDropdownOptions(
124
+ 'OPM',
125
+ {},
126
+ [],
127
+ loggedInUser,
128
+ ),
129
+ year: await this.listMasterService.getDropdownOptions(
130
+ 'OPY',
131
+ {},
132
+ [],
133
+ loggedInUser,
134
+ ),
135
+ };
136
+
137
+ // Step 5: Keep filters as is
138
+ entityMasterData['default_filter'] =
139
+ await this.savedFilterRepoService.getDefaultFilterByEntityType(
140
+ entityType,
141
+ );
142
+
143
+ if (loggedInUser.id) {
144
+ entityMasterData['saved_filter'] =
145
+ await this.savedFilterRepoService.getSavedFiltersByUserIdAndEntityType(
146
+ loggedInUser.id,
147
+ entityType,
148
+ );
149
+ }
150
+
151
+ return entityMasterData;
152
+ }
64
153
  }
@@ -4,9 +4,7 @@ import { EntityTableColumnRepository } from '../repository/entity-table-column.r
4
4
  import { EntityTableDto } from '../dto/entity-table.dto';
5
5
  import { DISPLAY_LIST } from '../../../constant/global.constant';
6
6
  import { ListMasterService } from 'src/module/listmaster/service/list-master.service';
7
- import { SavedFilterService } from 'src/module/filter/service/saved-filter.service';
8
7
  import { SavedFilterRepositoryService } from 'src/module/filter/repository/saved-filter.repository';
9
- import { UserData } from 'src/module/user/entity/user.entity';
10
8
 
11
9
  @Injectable()
12
10
  export class EntityTableService {
@@ -204,6 +204,7 @@ export class ActionRepository {
204
204
  'ac.modalName AS modalName',
205
205
  'ac.logo AS logo',
206
206
  'ac.name AS action_category_name',
207
+ 'a.dependent_action_id AS dependent_action_id',
207
208
  ])
208
209
  .from('cr_wf_action', 'a')
209
210
  .leftJoin('cr_wf_action_category', 'ac', 'ac.id = a.action_category')
@@ -249,6 +250,7 @@ export class ActionRepository {
249
250
 
250
251
  return {
251
252
  value: row.action_id,
253
+ dependent_action_id: row.dependent_action_id,
252
254
  label: row.action_name,
253
255
  modalName: row.modalName,
254
256
  logo: row.logo,
@@ -1,4 +0,0 @@
1
- import { Response } from 'express';
2
- export declare class WebhookController {
3
- handleTubelightWebhook(req: any, res: Response): void;
4
- }
@@ -1,38 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.WebhookController = void 0;
16
- const common_1 = require("@nestjs/common");
17
- let WebhookController = class WebhookController {
18
- handleTubelightWebhook(req, res) {
19
- const apiKey = req.headers['x-api-key'];
20
- console.log('API Key:', apiKey);
21
- console.log('handleTubelightWebhook: START');
22
- console.log(req);
23
- res.status(200).send('Webhook received');
24
- }
25
- };
26
- exports.WebhookController = WebhookController;
27
- __decorate([
28
- (0, common_1.Post)('tubelight'),
29
- __param(0, (0, common_1.Req)()),
30
- __param(1, (0, common_1.Res)()),
31
- __metadata("design:type", Function),
32
- __metadata("design:paramtypes", [Object, Object]),
33
- __metadata("design:returntype", void 0)
34
- ], WebhookController.prototype, "handleTubelightWebhook", null);
35
- exports.WebhookController = WebhookController = __decorate([
36
- (0, common_1.Controller)('webhook')
37
- ], WebhookController);
38
- //# sourceMappingURL=webhook.controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webhook.controller.js","sourceRoot":"","sources":["../../../../src/module/communication/controller/webhook.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4D;AAIrD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAE5B,sBAAsB,CAAQ,GAAQ,EAAS,GAAa;QAC1D,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC3C,CAAC;CACF,CAAA;AATY,8CAAiB;AAE5B;IADC,IAAA,aAAI,EAAC,WAAW,CAAC;IACM,WAAA,IAAA,YAAG,GAAE,CAAA;IAAY,WAAA,IAAA,YAAG,GAAE,CAAA;;;;+DAM7C;4BARU,iBAAiB;IAD7B,IAAA,mBAAU,EAAC,SAAS,CAAC;GACT,iBAAiB,CAS7B"}
@@ -1,14 +0,0 @@
1
- import { Controller, Post, Req, Res } from '@nestjs/common';
2
- import { Response } from 'express';
3
-
4
- @Controller('webhook')
5
- export class WebhookController {
6
- @Post('tubelight')
7
- handleTubelightWebhook(@Req() req: any, @Res() res: Response) {
8
- const apiKey = req.headers['x-api-key'];
9
- console.log('API Key:', apiKey);
10
- console.log('handleTubelightWebhook: START');
11
- console.log(req);
12
- res.status(200).send('Webhook received');
13
- }
14
- }