rez_core 2.2.216 → 2.2.217
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/package.json
CHANGED
|
@@ -81,6 +81,19 @@ export class PopulateWorkflowService extends EntityServiceImpl {
|
|
|
81
81
|
// }
|
|
82
82
|
|
|
83
83
|
async populateWorkflowData(organization_id: number, loggedInUser: UserData) {
|
|
84
|
+
let statusRow = await this.dataSource.query(
|
|
85
|
+
`SELECT * FROM cr_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = ?`,
|
|
86
|
+
[organization_id],
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
if (statusRow.length === 0) {
|
|
90
|
+
statusRow = await this.dataSource.query(
|
|
91
|
+
`SELECT * FROM cr_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = -1`,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const statusValue = statusRow[0]?.id;
|
|
96
|
+
|
|
84
97
|
// template populate
|
|
85
98
|
// Step 1: Fetch default cr_wf_comm_template
|
|
86
99
|
const defaultCommTemplates = await this.dataSource.query(
|
|
@@ -97,6 +110,7 @@ export class PopulateWorkflowService extends EntityServiceImpl {
|
|
|
97
110
|
organization_id,
|
|
98
111
|
level_id: organization_id,
|
|
99
112
|
entity_type: 'TEM',
|
|
113
|
+
status: statusValue,
|
|
100
114
|
created_date: new Date(),
|
|
101
115
|
modified_date: new Date(),
|
|
102
116
|
},
|
|
@@ -149,19 +163,6 @@ export class PopulateWorkflowService extends EntityServiceImpl {
|
|
|
149
163
|
);
|
|
150
164
|
const [workflows, stageGroups, stages] = factoryData;
|
|
151
165
|
|
|
152
|
-
let statusRow = await this.dataSource.query(
|
|
153
|
-
`SELECT * FROM cr_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = ?`,
|
|
154
|
-
[organization_id],
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
if (statusRow.length === 0) {
|
|
158
|
-
statusRow = await this.dataSource.query(
|
|
159
|
-
`SELECT * FROM cr_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = -1`,
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
const statusValue = statusRow[0]?.id;
|
|
164
|
-
|
|
165
166
|
// === 1. Workflow mapping
|
|
166
167
|
const workflowIdMap: Record<number, number> = {};
|
|
167
168
|
for (const row of workflows) {
|