rez_core 2.2.90 → 2.2.92

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": "2.2.90",
3
+ "version": "2.2.92",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -50,6 +50,21 @@ export class ListMasterController {
50
50
  );
51
51
  }
52
52
 
53
+ @Get('/getDataSourceList/:source')
54
+ @UseGuards(JwtAuthGuard)
55
+ @HttpCode(HttpStatus.OK)
56
+ async getListSourceType(
57
+ @Req() req: Request & { user: any },
58
+ @Param('source') source: string,
59
+ ) {
60
+ const loggedInUser = req.user.userData;
61
+
62
+ return await this.listMasterItemService.getListSourceType(
63
+ loggedInUser,
64
+ source,
65
+ );
66
+ }
67
+
53
68
  // @Post('/getResolvedListMasterItems/:type')
54
69
  // @UseGuards(JwtAuthGuard)
55
70
  // @HttpCode(HttpStatus.OK)
@@ -1,3 +1,4 @@
1
+ import { DataSource } from 'typeorm';
1
2
  import {
2
3
  BadRequestException,
3
4
  forwardRef,
@@ -19,6 +20,7 @@ export class ListMasterItemService extends EntityServiceImpl {
19
20
  @Inject(forwardRef(() => EntityServiceImpl))
20
21
  private readonly entityServiceImpl: EntityServiceImpl,
21
22
  protected readonly attributeMasterService: AttributeMasterService,
23
+ private readonly dataSource: DataSource,
22
24
  ) {
23
25
  super();
24
26
  }
@@ -183,6 +185,19 @@ export class ListMasterItemService extends EntityServiceImpl {
183
185
  return `Item with name ${code} deleted successfully from type ${listType}`;
184
186
  }
185
187
 
188
+ async getListSourceType(
189
+ loggedInUser: UserData,
190
+ source: string,
191
+ ): Promise<any> {
192
+ const data = await this.dataSource.query(
193
+ `SELECT name AS label, type AS value
194
+ FROM cr_list_master
195
+ WHERE organization_id = ? AND source = ?`,
196
+ [loggedInUser.organization_id, source],
197
+ );
198
+ return data;
199
+ }
200
+
186
201
  // async getResolvedListMasterItems(
187
202
  // loggedInUser: UserData,
188
203
  // entityData: any,
@@ -106,6 +106,7 @@ export class ActionService extends EntityServiceImpl {
106
106
  const resourceMapping = {
107
107
  stg_act_mapping_id: stageActionMappingData.id,
108
108
  organization_id: entityData.organization_id,
109
+ level_id: entityData.level_id,
109
110
  form_id: actionData.form,
110
111
  type: 'form',
111
112
  entity_type: 'ARMS',
@@ -279,7 +279,8 @@ export class PopulateWorkflowService extends EntityServiceImpl {
279
279
 
280
280
  //get view master form
281
281
  const formViewMaster = await this.dataSource.query(
282
- `SELECT id FROM cr_view_master WHERE code = "LEAD_FORM"`,
282
+ `SELECT id FROM cr_view_master WHERE code = "LEAD_FORM" and organization_id = ?`,
283
+ [organization_id],
283
284
  );
284
285
 
285
286
  // Step 4: Use the matched new item's id (if found)