rez_core 4.0.152 → 4.0.154
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/repository/action-data.repository.js +1 -0
- package/dist/module/workflow/repository/action-data.repository.js.map +1 -1
- package/dist/module/workflow/service/task.service.js +31 -11
- 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/repository/action-data.repository.ts +1 -0
- package/src/module/workflow/service/task.service.ts +36 -14
package/package.json
CHANGED
|
@@ -154,6 +154,29 @@ export class TaskService extends EntityServiceImpl {
|
|
|
154
154
|
loggedInUser.organization_id,
|
|
155
155
|
]);
|
|
156
156
|
|
|
157
|
+
const oldStatusQuery = `
|
|
158
|
+
SELECT *
|
|
159
|
+
FROM frm_wf_task_data
|
|
160
|
+
WHERE id = ?
|
|
161
|
+
AND organization_id = ?
|
|
162
|
+
LIMIT 1;
|
|
163
|
+
`;
|
|
164
|
+
|
|
165
|
+
const [oldRow] = await this.dataSource.query(oldStatusQuery, [
|
|
166
|
+
entityData.id,
|
|
167
|
+
loggedInUser.organization_id,
|
|
168
|
+
]);
|
|
169
|
+
|
|
170
|
+
const oldStatusRows = await this.dataSource.query(taskStatusQuery, [
|
|
171
|
+
oldRow.status,
|
|
172
|
+
loggedInUser.organization_id,
|
|
173
|
+
]);
|
|
174
|
+
|
|
175
|
+
const isStatusChanged =
|
|
176
|
+
statusRows.length > 0 &&
|
|
177
|
+
oldStatusRows.length > 0 &&
|
|
178
|
+
statusRows[0].name !== oldStatusRows[0].name;
|
|
179
|
+
|
|
157
180
|
const isCompletedStatus =
|
|
158
181
|
statusRows.length > 0 &&
|
|
159
182
|
statusRows[0].name?.toLowerCase() === 'completed';
|
|
@@ -183,20 +206,7 @@ export class TaskService extends EntityServiceImpl {
|
|
|
183
206
|
}
|
|
184
207
|
|
|
185
208
|
try {
|
|
186
|
-
|
|
187
|
-
const editLogData = {
|
|
188
|
-
mapped_entity_id: updatedEntity.mapped_entity_id,
|
|
189
|
-
mapped_entity_type: updatedEntity.mapped_entity_type,
|
|
190
|
-
title: `Task edited`,
|
|
191
|
-
description: `${updatedEntity.code} was edited`,
|
|
192
|
-
category: ACTIVITY_CATEGORIES.TASK,
|
|
193
|
-
action: 'edit',
|
|
194
|
-
appcode: loggedInUser.appcode,
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
await this.activityLogService.logActivity(editLogData, loggedInUser);
|
|
198
|
-
|
|
199
|
-
if (isCompletedStatus) {
|
|
209
|
+
if (isCompletedStatus && isStatusChanged) {
|
|
200
210
|
const completedLogData = {
|
|
201
211
|
mapped_entity_id: updatedEntity.mapped_entity_id,
|
|
202
212
|
mapped_entity_type: updatedEntity.mapped_entity_type,
|
|
@@ -211,6 +221,18 @@ export class TaskService extends EntityServiceImpl {
|
|
|
211
221
|
completedLogData,
|
|
212
222
|
loggedInUser,
|
|
213
223
|
);
|
|
224
|
+
} else {
|
|
225
|
+
const editLogData = {
|
|
226
|
+
mapped_entity_id: updatedEntity.mapped_entity_id,
|
|
227
|
+
mapped_entity_type: updatedEntity.mapped_entity_type,
|
|
228
|
+
title: `Task edited`,
|
|
229
|
+
description: `${updatedEntity.code} was edited`,
|
|
230
|
+
category: ACTIVITY_CATEGORIES.TASK,
|
|
231
|
+
action: 'edit',
|
|
232
|
+
appcode: loggedInUser.appcode,
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
await this.activityLogService.logActivity(editLogData, loggedInUser);
|
|
214
236
|
}
|
|
215
237
|
} catch (error) {
|
|
216
238
|
console.error(
|