rez_core 4.0.20 → 4.0.21
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/.vscode/extensions.json +5 -0
- package/dist/module/workflow/controller/action-template-mapping.controller.js +2 -2
- package/dist/module/workflow/controller/action-template-mapping.controller.js.map +1 -1
- package/dist/module/workflow/repository/action-data.repository.js +2 -2
- package/dist/module/workflow/repository/action-data.repository.js.map +1 -1
- package/dist/module/workflow/service/action-template-mapping.service.d.ts +1 -1
- package/dist/module/workflow/service/action-template-mapping.service.js +16 -6
- package/dist/module/workflow/service/action-template-mapping.service.js.map +1 -1
- package/dist/module/workflow/service/action.service.js +2 -1
- package/dist/module/workflow/service/action.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/workflow/controller/action-template-mapping.controller.ts +2 -2
- package/src/module/workflow/repository/action-data.repository.ts +2 -2
- package/src/module/workflow/service/action-template-mapping.service.ts +21 -9
- package/src/module/workflow/service/action.service.ts +2 -1
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ export class ActionTemplateMappingController {
|
|
|
17
17
|
private readonly actionTemplateMappingService: ActionTemplateMappingService,
|
|
18
18
|
) {}
|
|
19
19
|
|
|
20
|
-
@Post('/get-template')
|
|
20
|
+
@Post('/get-template-by-mode')
|
|
21
21
|
@HttpCode(HttpStatus.OK)
|
|
22
22
|
async getTemplate(
|
|
23
23
|
@Body() body: { stage_id: number; action_id: number; mode: number },
|
|
@@ -27,8 +27,8 @@ export class ActionTemplateMappingController {
|
|
|
27
27
|
const result = this.actionTemplateMappingService.getTemplateByMode(
|
|
28
28
|
body.stage_id,
|
|
29
29
|
body.action_id,
|
|
30
|
-
body.mode,
|
|
31
30
|
loggedInUser,
|
|
31
|
+
body.mode,
|
|
32
32
|
);
|
|
33
33
|
return result;
|
|
34
34
|
}
|
|
@@ -269,7 +269,7 @@ export class ActionDataRepository extends EntityServiceImpl {
|
|
|
269
269
|
|
|
270
270
|
const { level_id } = loggedInUser;
|
|
271
271
|
|
|
272
|
-
const url = `${baseUrl}/
|
|
272
|
+
const url = `${baseUrl}/organization/public/${level_id}?entity_type=ORGP&${queryParams}`;
|
|
273
273
|
|
|
274
274
|
const response = await axios.get(url);
|
|
275
275
|
console.log('Internal Entity API response:', response.data);
|
|
@@ -281,7 +281,7 @@ export class ActionDataRepository extends EntityServiceImpl {
|
|
|
281
281
|
console.error('Internal Entity API call failed:', error.message);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
const org_slug = organizationData?.slug;
|
|
284
|
+
const org_slug = organizationData[0]?.slug;
|
|
285
285
|
|
|
286
286
|
// fetch required var from config or env
|
|
287
287
|
const profile = this.configService.get('PROFILE');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { level } from 'winston';
|
|
1
2
|
import { Injectable } from '@nestjs/common';
|
|
2
3
|
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
3
4
|
import { DataSource } from 'typeorm';
|
|
@@ -10,8 +11,8 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
|
|
|
10
11
|
async getTemplateByMode(
|
|
11
12
|
stage_id: number,
|
|
12
13
|
action_id: number,
|
|
13
|
-
mode: number,
|
|
14
14
|
loggedInUser,
|
|
15
|
+
mode?: number,
|
|
15
16
|
) {
|
|
16
17
|
const stageAction = await this.dataSource.query(
|
|
17
18
|
`
|
|
@@ -24,6 +25,17 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
|
|
|
24
25
|
|
|
25
26
|
const stgActMappingId = stageAction[0].id;
|
|
26
27
|
|
|
28
|
+
if (!mode) {
|
|
29
|
+
const getModeFromAction = await this.dataSource.query(
|
|
30
|
+
`
|
|
31
|
+
SELECT mode FROM frm_wf_action
|
|
32
|
+
WHERE id = ?
|
|
33
|
+
`,
|
|
34
|
+
[action_id],
|
|
35
|
+
);
|
|
36
|
+
mode = getModeFromAction[0]?.mode;
|
|
37
|
+
}
|
|
38
|
+
|
|
27
39
|
const templates = await this.dataSource.query(
|
|
28
40
|
`
|
|
29
41
|
SELECT template_code FROM frm_wf_action_resources_mapping
|
|
@@ -31,12 +43,6 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
|
|
|
31
43
|
`,
|
|
32
44
|
[stgActMappingId],
|
|
33
45
|
);
|
|
34
|
-
const listMasterItemData = await this.dataSource.query(
|
|
35
|
-
`SELECT code FROM frm_list_master_items WHERE id = ?`,
|
|
36
|
-
[mode],
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
if (!listMasterItemData?.length) return [];
|
|
40
46
|
|
|
41
47
|
const templateCodes = templates.map((t) => t.template_code);
|
|
42
48
|
if (!templateCodes.length) return [];
|
|
@@ -45,9 +51,15 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
|
|
|
45
51
|
`
|
|
46
52
|
SELECT id, name
|
|
47
53
|
FROM frm_wf_comm_template
|
|
48
|
-
WHERE code IN (?) AND mode = ? AND organization_id = ?
|
|
54
|
+
WHERE code IN (?) AND mode = ? AND organization_id = ? AND level_type = ? AND level_id = ?
|
|
49
55
|
`,
|
|
50
|
-
[
|
|
56
|
+
[
|
|
57
|
+
templateCodes,
|
|
58
|
+
mode,
|
|
59
|
+
loggedInUser.organization_id,
|
|
60
|
+
loggedInUser.level_type,
|
|
61
|
+
loggedInUser.level_id,
|
|
62
|
+
],
|
|
51
63
|
);
|
|
52
64
|
|
|
53
65
|
return commTemplates;
|
|
@@ -191,7 +191,8 @@ export class ActionService extends EntityServiceImpl {
|
|
|
191
191
|
entity_type: 'WFAR',
|
|
192
192
|
} as any;
|
|
193
193
|
|
|
194
|
-
await super.createEntity(resourceMapping, loggedInUser);
|
|
194
|
+
const res = await super.createEntity(resourceMapping, loggedInUser);
|
|
195
|
+
console.log(res);
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
198
|
|