rez_core 2.2.29 → 2.2.31
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/action.controller.d.ts +1 -1
- package/dist/module/workflow/repository/action.repository.d.ts +1 -1
- package/dist/module/workflow/repository/action.repository.js +2 -2
- package/dist/module/workflow/repository/action.repository.js.map +1 -1
- package/dist/module/workflow/service/action.service.d.ts +1 -1
- package/dist/module/workflow/service/comm-template.service.js +1 -0
- package/dist/module/workflow/service/comm-template.service.js.map +1 -1
- package/dist/module/workflow/service/populate-workflow.service.js +14 -0
- package/dist/module/workflow/service/populate-workflow.service.js.map +1 -1
- package/dist/module/workflow/service/workflow-meta.service.js +2 -0
- package/dist/module/workflow/service/workflow-meta.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/workflow/repository/action.repository.ts +2 -2
- package/src/module/workflow/service/comm-template.service.ts +1 -0
- package/src/module/workflow/service/populate-workflow.service.ts +24 -0
- package/src/module/workflow/service/workflow-meta.service.ts +2 -0
package/package.json
CHANGED
|
@@ -31,7 +31,7 @@ export class ActionRepository {
|
|
|
31
31
|
if (!stageActions?.length) {
|
|
32
32
|
return [
|
|
33
33
|
{
|
|
34
|
-
value: 0,
|
|
34
|
+
value: '0',
|
|
35
35
|
label: 'Generic',
|
|
36
36
|
},
|
|
37
37
|
];
|
|
@@ -113,7 +113,7 @@ export class ActionRepository {
|
|
|
113
113
|
|
|
114
114
|
// Step 6: Add fallback option
|
|
115
115
|
enrichedResult.push({
|
|
116
|
-
value: 0,
|
|
116
|
+
value: '0',
|
|
117
117
|
label: 'Generic',
|
|
118
118
|
} as any);
|
|
119
119
|
|
|
@@ -24,6 +24,7 @@ export class CommTemplateService extends EntityServiceImpl {
|
|
|
24
24
|
organization_id: loggedInUser.organization_id,
|
|
25
25
|
appcode: loggedInUser.appcode,
|
|
26
26
|
level_id: loggedInUser.level_id,
|
|
27
|
+
mapped_entity_type: 'LEAD',
|
|
27
28
|
level_type: loggedInUser.level_type,
|
|
28
29
|
}));
|
|
29
30
|
|
|
@@ -81,6 +81,30 @@ export class PopulateWorkflowService extends EntityServiceImpl {
|
|
|
81
81
|
// }
|
|
82
82
|
|
|
83
83
|
async populateWorkflowData(organization_id: number, loggedInUser: UserData) {
|
|
84
|
+
// template populate
|
|
85
|
+
// Step 1: Fetch default cr_wf_comm_template
|
|
86
|
+
const defaultCommTemplates = await this.dataSource.query(
|
|
87
|
+
`SELECT * FROM cr_wf_comm_template WHERE organization_id = -1 AND level_type = 'ORG' AND level_id = -1`,
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
if (defaultCommTemplates.length > 0) {
|
|
91
|
+
// Step 2: Insert default communication templates for the new organization
|
|
92
|
+
for (const template of defaultCommTemplates) {
|
|
93
|
+
const { id, created_date, modified_date, ...rest } = template;
|
|
94
|
+
await super.createEntity(
|
|
95
|
+
{
|
|
96
|
+
...rest,
|
|
97
|
+
organization_id,
|
|
98
|
+
level_id: organization_id,
|
|
99
|
+
entity_type: 'TEM',
|
|
100
|
+
created_date: new Date(),
|
|
101
|
+
modified_date: new Date(),
|
|
102
|
+
},
|
|
103
|
+
loggedInUser,
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
84
108
|
const defaultEntity = await this.dataSource.query(
|
|
85
109
|
`SELECT * FROM eth_entity WHERE organization_id = -1 AND level_type = 'ORG' AND level_id = -1 AND entity_type = 'ENT'`,
|
|
86
110
|
);
|
|
@@ -135,6 +135,7 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
135
135
|
status: firstStage.status,
|
|
136
136
|
current_user_id: loggedInUser.id,
|
|
137
137
|
stage_action_mapping_id: firstStage.id,
|
|
138
|
+
orgnization_id: loggedInUser.organization_id,
|
|
138
139
|
stage_group_id: stageGroup.id,
|
|
139
140
|
stage_id: firstStage.id,
|
|
140
141
|
start_date: new Date(),
|
|
@@ -170,6 +171,7 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
170
171
|
status: nextStage.status,
|
|
171
172
|
current_user_id: loggedInUser.id,
|
|
172
173
|
stage_action_mapping_id: nextStage.id,
|
|
174
|
+
organization_id: loggedInUser.organization_id,
|
|
173
175
|
start_date: now,
|
|
174
176
|
stage_group_id: nextStage?.stage_group_id,
|
|
175
177
|
stage_id: nextStage.id,
|