rez_core 5.0.81 → 5.0.82

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "5.0.81",
3
+ "version": "5.0.82",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -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
- const getGroupName = await this.dataSource.query(
92
- `SELECT name FROM frm_wf_stage_group WHERE id = ${latestMovement?.stage_group_id}`,
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: getGroupName[0]?.name,
100
+ stage_group_name: stageGroup?.name,
98
101
  };
99
102
  }
100
103
 
101
104
  // get group name for the current stage
102
- const getGroupName = await this.dataSource.query(
103
- `SELECT name FROM frm_wf_stage_group WHERE id = ${currentStage?.stage_group_id}`,
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: getGroupName[0]?.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 groupName = await this.dataSource.query(
130
- `SELECT name FROM frm_wf_stage_group WHERE id = ${nextStage?.stage_group_id}`,
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: groupName[0]?.name },
140
+ nextStage: { ...nextStage, stage_group_name: stageGroup?.name },
136
141
  };
137
142
  }
138
143