rez_core 5.0.81 → 5.0.83
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.repository.js +30 -29
- package/dist/module/workflow/repository/action.repository.js.map +1 -1
- package/dist/module/workflow/service/workflow-meta.service.d.ts +3 -1
- package/dist/module/workflow/service/workflow-meta.service.js +19 -7
- 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 +34 -31
- package/src/module/workflow/service/workflow-meta.service.ts +17 -12
package/package.json
CHANGED
|
@@ -248,46 +248,49 @@ export class ActionRepository {
|
|
|
248
248
|
const actionIds = stageActions.map((sa) => sa.action_id);
|
|
249
249
|
|
|
250
250
|
// Step 2: Fetch all actions with category details
|
|
251
|
-
const
|
|
252
|
-
|
|
251
|
+
const actionRepo = this.reflectionHelper.getRepoService('ActionEntity');
|
|
252
|
+
|
|
253
|
+
const actions = await actionRepo
|
|
254
|
+
.createQueryBuilder("a")
|
|
253
255
|
.select([
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
256
|
+
"a.id AS action_id",
|
|
257
|
+
"a.name AS action_name",
|
|
258
|
+
"a.reason_code AS action_reason_code",
|
|
259
|
+
"a.default_reason_code AS default_reason_code",
|
|
260
|
+
"a.default_value AS default_value",
|
|
261
|
+
"a.mode AS mode",
|
|
262
|
+
"a.action_category AS action_category_id",
|
|
263
|
+
"ac.reason_code AS category_reason_code",
|
|
264
|
+
"ac.modalname AS modalname",
|
|
265
|
+
"ac.logo AS logo",
|
|
266
|
+
"ac.name AS action_category_name",
|
|
267
|
+
"a.dependent_action_id AS dependent_action_id",
|
|
266
268
|
])
|
|
267
|
-
.from('frm_wf_action', 'a')
|
|
268
269
|
.leftJoin(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
"frm_wf_action_category",
|
|
271
|
+
"ac",
|
|
272
|
+
"ac.id = a.action_category::bigint"
|
|
272
273
|
)
|
|
273
|
-
.where(
|
|
274
|
-
.andWhere(
|
|
274
|
+
.where("a.organization_id = :orgId", { orgId: organization_id })
|
|
275
|
+
.andWhere("a.id IN (:...actionIds)", { actionIds })
|
|
276
|
+
.orderBy("a.sequence", "ASC")
|
|
275
277
|
.getRawMany();
|
|
276
278
|
|
|
277
279
|
// Step 3: Fetch action_data
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
+
const actionDataRepo = this.reflectionHelper.getRepoService('ActionDataEntity');
|
|
281
|
+
|
|
282
|
+
const actionData = await actionDataRepo
|
|
283
|
+
.createQueryBuilder("ad")
|
|
280
284
|
.select([
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
+
"ad.action_id AS action_id",
|
|
286
|
+
"ad.is_current AS is_current",
|
|
287
|
+
"ad.is_mandatory AS is_mandatory",
|
|
288
|
+
"ad.is_done AS is_done",
|
|
285
289
|
])
|
|
286
|
-
.
|
|
287
|
-
.
|
|
288
|
-
.andWhere(
|
|
289
|
-
.andWhere(
|
|
290
|
-
.andWhere('ad.mapped_entity_type = :mapped_entity_type', {
|
|
290
|
+
.where("ad.stage_id = :stageId", { stageId: stage_id })
|
|
291
|
+
.andWhere("ad.action_id IN (:...actionIds)", { actionIds })
|
|
292
|
+
.andWhere("ad.mapped_entity_id = :mapped_entity_id", { mapped_entity_id })
|
|
293
|
+
.andWhere("ad.mapped_entity_type = :mapped_entity_type", {
|
|
291
294
|
mapped_entity_type,
|
|
292
295
|
})
|
|
293
296
|
.getRawMany();
|
|
@@ -19,6 +19,7 @@ import { ActivityLogService } from './activity-log.service';
|
|
|
19
19
|
import { EntityModificationService } from './entity-modification.service';
|
|
20
20
|
import { TaskService } from './task.service';
|
|
21
21
|
import { ActionCategory } from '../entity/action-category.entity';
|
|
22
|
+
import { StageGroup } from '../entity/stage-group.entity';
|
|
22
23
|
|
|
23
24
|
@Injectable()
|
|
24
25
|
export class WorkflowMetaService extends EntityServiceImpl {
|
|
@@ -38,6 +39,8 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
38
39
|
private readonly configService: ConfigService,
|
|
39
40
|
@InjectRepository(ActionCategory)
|
|
40
41
|
private readonly actionCategoryRepo: Repository<ActionCategory>,
|
|
42
|
+
@InjectRepository(StageGroup)
|
|
43
|
+
private readonly stageGroupRepo: Repository<StageGroup>,
|
|
41
44
|
) {
|
|
42
45
|
super();
|
|
43
46
|
}
|
|
@@ -88,25 +91,25 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
88
91
|
|
|
89
92
|
if (!latestMovement) return null;
|
|
90
93
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
);
|
|
94
|
+
let stageGroup = await this.stageGroupRepo.findOne({
|
|
95
|
+
where: {id: latestMovement?.stage_group_id}
|
|
96
|
+
});
|
|
94
97
|
|
|
95
98
|
return {
|
|
96
99
|
...latestMovement,
|
|
97
|
-
stage_group_name:
|
|
100
|
+
stage_group_name: stageGroup?.name,
|
|
98
101
|
};
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
// get group name for the current stage
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
);
|
|
105
|
+
const stageGroup = await this.stageGroupRepo.findOne({
|
|
106
|
+
where: {id: currentStage?.stage_group_id}
|
|
107
|
+
});
|
|
105
108
|
|
|
106
109
|
// Return the found or newly created current stage movement
|
|
107
110
|
return {
|
|
108
111
|
...currentStage,
|
|
109
|
-
stage_group_name:
|
|
112
|
+
stage_group_name: stageGroup?.name,
|
|
110
113
|
};
|
|
111
114
|
}
|
|
112
115
|
|
|
@@ -126,13 +129,15 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
126
129
|
return { hasNextStage: false, nextStage: null };
|
|
127
130
|
}
|
|
128
131
|
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
const stageGroup = await this.stageGroupRepo.findOne({
|
|
133
|
+
where: {
|
|
134
|
+
id: nextStage?.stage_group_id,
|
|
135
|
+
}
|
|
136
|
+
})
|
|
132
137
|
|
|
133
138
|
return {
|
|
134
139
|
hasNextStage: !!nextStage,
|
|
135
|
-
nextStage: { ...nextStage, stage_group_name:
|
|
140
|
+
nextStage: { ...nextStage, stage_group_name: stageGroup?.name },
|
|
136
141
|
};
|
|
137
142
|
}
|
|
138
143
|
|