rez_core 5.0.204 → 5.0.206
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 +9 -3
- package/dist/module/workflow/repository/action-data.repository.js.map +1 -1
- package/dist/module/workflow/repository/task.repository.js +4 -4
- package/dist/module/workflow/repository/task.repository.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 +10 -3
- package/src/module/workflow/repository/task.repository.ts +14 -12
package/package.json
CHANGED
|
@@ -5,7 +5,6 @@ import { LessThan, Repository } from 'typeorm';
|
|
|
5
5
|
import { UserData } from 'src/module/user/entity/user.entity';
|
|
6
6
|
import { TaskDataEntity } from '../entity/task-data.entity';
|
|
7
7
|
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
8
|
-
import { FORM_STATUS_TO_BE_SENT } from 'src/constant/global.constant';
|
|
9
8
|
import { ConfigService } from '@nestjs/config';
|
|
10
9
|
import axios from 'axios';
|
|
11
10
|
import { WorkflowAutomationEngineService } from 'src/module/workflow-automation/service/workflow-automation-engine.service';
|
|
@@ -40,7 +39,7 @@ export class ActionDataRepository extends EntityServiceImpl {
|
|
|
40
39
|
this.reflectionHelper.getRepoService('ListMasterItems');
|
|
41
40
|
const is_mandatory = await listMasterItemsRepo.findOne({
|
|
42
41
|
where: {
|
|
43
|
-
id: act.action_requirement
|
|
42
|
+
id: act.action_requirement,
|
|
44
43
|
},
|
|
45
44
|
});
|
|
46
45
|
|
|
@@ -82,6 +81,14 @@ export class ActionDataRepository extends EntityServiceImpl {
|
|
|
82
81
|
const istOffset = 5.5 * 60; // IST is UTC +5:30 in minutes
|
|
83
82
|
const istDate = new Date(now.getTime() + istOffset * 60 * 1000);
|
|
84
83
|
|
|
84
|
+
const formStatus = await listMasterItemsRepo.findOne({
|
|
85
|
+
where: {
|
|
86
|
+
value: 'TO_BE_SENT',
|
|
87
|
+
enterprise_id: loggedInUser.enterprise_id,
|
|
88
|
+
},
|
|
89
|
+
select: ['id'],
|
|
90
|
+
});
|
|
91
|
+
|
|
85
92
|
const data = {
|
|
86
93
|
entity_type: 'LFRM',
|
|
87
94
|
name: viewMaster?.name,
|
|
@@ -90,7 +97,7 @@ export class ActionDataRepository extends EntityServiceImpl {
|
|
|
90
97
|
mapped_entity_id,
|
|
91
98
|
view_id: act.form_id,
|
|
92
99
|
form_url: dynamicFormURL,
|
|
93
|
-
status:
|
|
100
|
+
status: formStatus?.id,
|
|
94
101
|
action_id: act.id,
|
|
95
102
|
created_date: istDate,
|
|
96
103
|
pdf_template: act.pdf_template,
|
|
@@ -14,12 +14,11 @@ export class TaskRepository {
|
|
|
14
14
|
private readonly taskRepository: Repository<TaskDataEntity>,
|
|
15
15
|
private readonly entityDynamicService: EntityDynamicService,
|
|
16
16
|
private readonly reflectionHelper: ReflectionHelper,
|
|
17
|
-
private readonly entityManager:EntityManager,
|
|
18
|
-
private readonly configService: ConfigService
|
|
19
|
-
) {
|
|
20
|
-
}
|
|
17
|
+
private readonly entityManager: EntityManager,
|
|
18
|
+
private readonly configService: ConfigService,
|
|
19
|
+
) {}
|
|
21
20
|
|
|
22
|
-
schema = this.configService.get('DB_SCHEMA')
|
|
21
|
+
schema = this.configService.get('DB_SCHEMA');
|
|
23
22
|
|
|
24
23
|
async getAllTaskByUserIdAndStageId(condition) {
|
|
25
24
|
const result = await this.taskRepository.find({
|
|
@@ -39,7 +38,8 @@ export class TaskRepository {
|
|
|
39
38
|
): Promise<any> {
|
|
40
39
|
if (!action?.length) return;
|
|
41
40
|
|
|
42
|
-
const listMasterItemsRepo =
|
|
41
|
+
const listMasterItemsRepo =
|
|
42
|
+
this.reflectionHelper.getRepoService('ListMasterItems');
|
|
43
43
|
|
|
44
44
|
const listMasterItem = await listMasterItemsRepo.findOne({
|
|
45
45
|
where: {
|
|
@@ -60,9 +60,9 @@ export class TaskRepository {
|
|
|
60
60
|
for (const act of action) {
|
|
61
61
|
// search that is_mandatory is true or not in list_master_items for the given organization
|
|
62
62
|
|
|
63
|
-
const mandatoryListMasterItem = listMasterItemsRepo.find({
|
|
63
|
+
const mandatoryListMasterItem = await listMasterItemsRepo.find({
|
|
64
64
|
where: {
|
|
65
|
-
id: act.action_requirement
|
|
65
|
+
id: act.action_requirement,
|
|
66
66
|
},
|
|
67
67
|
});
|
|
68
68
|
|
|
@@ -101,7 +101,8 @@ export class TaskRepository {
|
|
|
101
101
|
enterprise_id: loggedInUser.enterprise_id,
|
|
102
102
|
name: act.name,
|
|
103
103
|
sequence: act.sequence,
|
|
104
|
-
is_mandatory:
|
|
104
|
+
is_mandatory:
|
|
105
|
+
mandatoryListMasterItem[0]?.code === 'mandatory' ? true : false,
|
|
105
106
|
mapped_entity_id,
|
|
106
107
|
mapped_entity_type,
|
|
107
108
|
due_date,
|
|
@@ -109,7 +110,7 @@ export class TaskRepository {
|
|
|
109
110
|
is_system: true,
|
|
110
111
|
status: listMasterItem?.id,
|
|
111
112
|
category: act?.action_category_code,
|
|
112
|
-
task_owner: leadData?.lead_owner,
|
|
113
|
+
task_owner: leadData[0]?.lead_owner,
|
|
113
114
|
code: taskCode,
|
|
114
115
|
});
|
|
115
116
|
await this.taskRepository.save(taskData);
|
|
@@ -134,14 +135,15 @@ export class TaskRepository {
|
|
|
134
135
|
|
|
135
136
|
if (!task) return;
|
|
136
137
|
|
|
137
|
-
const listMasterItemsRepo =
|
|
138
|
+
const listMasterItemsRepo =
|
|
139
|
+
this.reflectionHelper.getRepoService('ListMasterItems');
|
|
138
140
|
|
|
139
141
|
const listMasterItem = await listMasterItemsRepo.findOne({
|
|
140
142
|
where: {
|
|
141
143
|
code: 'completed',
|
|
142
144
|
enterprise_id: loggedInUser.enterprise_id,
|
|
143
145
|
listtype: 'TKST',
|
|
144
|
-
}
|
|
146
|
+
},
|
|
145
147
|
});
|
|
146
148
|
|
|
147
149
|
task.modified_by = loggedInUser.id;
|