rez_core 2.2.96 → 2.2.98
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/dist/module/workflow/controller/activity-log.controller.d.ts +1 -1
- package/dist/module/workflow/controller/activity-log.controller.js +4 -3
- package/dist/module/workflow/controller/activity-log.controller.js.map +1 -1
- package/dist/module/workflow/repository/activity-log.repository.d.ts +1 -1
- package/dist/module/workflow/repository/activity-log.repository.js +4 -1
- package/dist/module/workflow/repository/activity-log.repository.js.map +1 -1
- package/dist/module/workflow/repository/stage-group.repository.d.ts +2 -1
- package/dist/module/workflow/repository/stage-group.repository.js +21 -3
- package/dist/module/workflow/repository/stage-group.repository.js.map +1 -1
- package/dist/module/workflow/service/activity-log.service.d.ts +1 -1
- package/dist/module/workflow/service/activity-log.service.js +2 -2
- package/dist/module/workflow/service/activity-log.service.js.map +1 -1
- package/dist/module/workflow/service/stage-group.service.js +1 -1
- package/dist/module/workflow/service/stage-group.service.js.map +1 -1
- package/dist/module/workflow/service/task.service.js +5 -5
- package/dist/module/workflow/service/task.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/workflow/controller/activity-log.controller.ts +2 -2
- package/src/module/workflow/repository/activity-log.repository.ts +4 -1
- package/src/module/workflow/repository/stage-group.repository.ts +25 -5
- package/src/module/workflow/service/activity-log.service.ts +2 -2
- package/src/module/workflow/service/stage-group.service.ts +0 -1
- package/src/module/workflow/service/task.service.ts +5 -5
- package/.vscode/extensions.json +0 -5
package/package.json
CHANGED
|
@@ -42,11 +42,11 @@ export class ActivityLogController {
|
|
|
42
42
|
async getAllActivityCategory(
|
|
43
43
|
@Req() req: Request & { user: any },
|
|
44
44
|
@Body('entity_type') mapped_entity_type: string,
|
|
45
|
-
|
|
45
|
+
@Body('mapped_entity_id') mapped_entity_id: string,
|
|
46
46
|
) {
|
|
47
47
|
const loggedInUser = req.user.userData;
|
|
48
48
|
const result = this.activityLogService.getAllActivityCategory(
|
|
49
|
-
|
|
49
|
+
mapped_entity_id,
|
|
50
50
|
mapped_entity_type,
|
|
51
51
|
loggedInUser,
|
|
52
52
|
);
|
|
@@ -89,7 +89,7 @@ export class ActivityLogRepository {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
async getAllActivityCategory(
|
|
92
|
-
|
|
92
|
+
mapped_entity_id: number | string,
|
|
93
93
|
mapped_entity_type: string,
|
|
94
94
|
loggedInUser: any,
|
|
95
95
|
) {
|
|
@@ -102,6 +102,9 @@ export class ActivityLogRepository {
|
|
|
102
102
|
mapped_entity_type,
|
|
103
103
|
})
|
|
104
104
|
.andWhere('log.organization_id = :organization_id', { organization_id })
|
|
105
|
+
.andWhere('log.mapped_entity_id = :mapped_entity_id', {
|
|
106
|
+
mapped_entity_id,
|
|
107
|
+
})
|
|
105
108
|
|
|
106
109
|
.getRawMany();
|
|
107
110
|
return result.map((row) => {
|
|
@@ -42,9 +42,27 @@ export class StageGroupRepository {
|
|
|
42
42
|
return result;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
async getAllStageGroupByCondition(condition: any) {
|
|
46
|
+
const result = await this.stageGroupRepository.find({
|
|
47
|
+
where: {
|
|
48
|
+
...condition,
|
|
49
|
+
},
|
|
50
|
+
order: {
|
|
51
|
+
sequence: 'ASC',
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
if (!result || result.length === 0) {
|
|
56
|
+
throw new NotFoundException(
|
|
57
|
+
'No stage groups found for the given workflow ID',
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
|
|
45
64
|
async getAllStageGroupAndStageHierarchy(
|
|
46
65
|
workflow_id: number,
|
|
47
|
-
organization_id: number,
|
|
48
66
|
loggedInUser: any, // required for media service
|
|
49
67
|
lead_id: number,
|
|
50
68
|
) {
|
|
@@ -53,10 +71,12 @@ export class StageGroupRepository {
|
|
|
53
71
|
}
|
|
54
72
|
|
|
55
73
|
// Step 1: Get all stage groups
|
|
56
|
-
const stageGroups = await this.
|
|
74
|
+
const stageGroups = await this.getAllStageGroupByCondition({
|
|
57
75
|
workflow_id,
|
|
58
|
-
organization_id,
|
|
59
|
-
|
|
76
|
+
organization_id: loggedInUser.organization_id,
|
|
77
|
+
level_id: loggedInUser.level_id,
|
|
78
|
+
});
|
|
79
|
+
|
|
60
80
|
if (!stageGroups.length) return [];
|
|
61
81
|
|
|
62
82
|
// Step 2: Get all stages for these stage groups
|
|
@@ -70,7 +90,7 @@ export class StageGroupRepository {
|
|
|
70
90
|
AND cr_wf_stage.organization_id = ?
|
|
71
91
|
ORDER BY cr_wf_stage.sequence ASC
|
|
72
92
|
`,
|
|
73
|
-
[...stageGroupIds, organization_id],
|
|
93
|
+
[...stageGroupIds, loggedInUser.organization_id],
|
|
74
94
|
);
|
|
75
95
|
|
|
76
96
|
const stageIds = stagesRaw.map((s) => s.id);
|
|
@@ -93,12 +93,12 @@ export class ActivityLogService extends EntityServiceImpl {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
async getAllActivityCategory(
|
|
96
|
-
|
|
96
|
+
mapped_entity_id: number | string,
|
|
97
97
|
mapped_entity_type: string,
|
|
98
98
|
loggedInUser,
|
|
99
99
|
) {
|
|
100
100
|
const result = this.activityLogRepository.getAllActivityCategory(
|
|
101
|
-
|
|
101
|
+
mapped_entity_id,
|
|
102
102
|
mapped_entity_type,
|
|
103
103
|
loggedInUser,
|
|
104
104
|
);
|
|
@@ -76,7 +76,6 @@ export class StageGroupService extends EntityServiceImpl {
|
|
|
76
76
|
const stageGroupAndStageHierarchy =
|
|
77
77
|
(await this.stageGroupRepository.getAllStageGroupAndStageHierarchy(
|
|
78
78
|
workflowLevelMapping.workflow_id,
|
|
79
|
-
loggedInUser.organization_id,
|
|
80
79
|
loggedInUser,
|
|
81
80
|
lead_id,
|
|
82
81
|
)) as Array<{
|
|
@@ -38,10 +38,10 @@ export class TaskService extends EntityServiceImpl {
|
|
|
38
38
|
|
|
39
39
|
try {
|
|
40
40
|
const logData = {
|
|
41
|
-
mapped_entity_id:
|
|
42
|
-
mapped_entity_type:
|
|
41
|
+
mapped_entity_id: result.mapped_entity_id,
|
|
42
|
+
mapped_entity_type: result.mapped_entity_type,
|
|
43
43
|
title: `Task added`,
|
|
44
|
-
description: `A new task ${
|
|
44
|
+
description: `A new task ${result.name} was added`,
|
|
45
45
|
category: ACTIVITY_CATEGORIES.TASK,
|
|
46
46
|
action: 'add',
|
|
47
47
|
appcode: loggedInUser.appcode,
|
|
@@ -111,7 +111,7 @@ export class TaskService extends EntityServiceImpl {
|
|
|
111
111
|
mapped_entity_id: updatedEntity.mapped_entity_id,
|
|
112
112
|
mapped_entity_type: updatedEntity.mapped_entity_type,
|
|
113
113
|
title: `Task edited`,
|
|
114
|
-
description: `${
|
|
114
|
+
description: `${updatedEntity.code} was edited`,
|
|
115
115
|
category: ACTIVITY_CATEGORIES.TASK,
|
|
116
116
|
action: 'edit',
|
|
117
117
|
appcode: loggedInUser.appcode,
|
|
@@ -124,7 +124,7 @@ export class TaskService extends EntityServiceImpl {
|
|
|
124
124
|
mapped_entity_id: updatedEntity.mapped_entity_id,
|
|
125
125
|
mapped_entity_type: updatedEntity.mapped_entity_type,
|
|
126
126
|
title: `Task completed`,
|
|
127
|
-
description: `${
|
|
127
|
+
description: `${updatedEntity.code} was marked as completed`,
|
|
128
128
|
category: ACTIVITY_CATEGORIES.TASK,
|
|
129
129
|
action: 'completed',
|
|
130
130
|
appcode: loggedInUser.appcode,
|