rez_core 5.0.19 → 5.0.20
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/stage-group.repository.d.ts +5 -1
- package/dist/module/workflow/repository/stage-group.repository.js +18 -12
- package/dist/module/workflow/repository/stage-group.repository.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/workflow/repository/stage-group.repository.ts +16 -16
package/package.json
CHANGED
|
@@ -6,14 +6,20 @@ import {
|
|
|
6
6
|
} from '@nestjs/common';
|
|
7
7
|
import { StageGroup } from '../entity/stage-group.entity';
|
|
8
8
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
9
|
-
import { DataSource, Repository } from 'typeorm';
|
|
9
|
+
import { DataSource, In, Repository } from 'typeorm';
|
|
10
10
|
import { MediaDataService } from 'src/module/meta/service/media-data.service';
|
|
11
|
+
import { Stage } from '../entity/stage.entity';
|
|
12
|
+
import { TaskDataEntity } from '../entity/task-data.entity';
|
|
11
13
|
|
|
12
14
|
@Injectable()
|
|
13
15
|
export class StageGroupRepository {
|
|
14
16
|
constructor(
|
|
15
17
|
@InjectRepository(StageGroup)
|
|
16
18
|
private readonly stageGroupRepository: Repository<StageGroup>,
|
|
19
|
+
@InjectRepository(Stage)
|
|
20
|
+
private readonly stageRepository: Repository<Stage>,
|
|
21
|
+
@InjectRepository(TaskDataEntity)
|
|
22
|
+
private readonly taskDataRepo: Repository<TaskDataEntity>,
|
|
17
23
|
private readonly dataSource: DataSource,
|
|
18
24
|
private readonly mediaDataService: MediaDataService,
|
|
19
25
|
) {}
|
|
@@ -83,22 +89,16 @@ export class StageGroupRepository {
|
|
|
83
89
|
// -------------------------------------------------------------
|
|
84
90
|
|
|
85
91
|
const stageGroupIds = stageGroups.map((sg) => Number(sg.id));
|
|
86
|
-
const stageGroupPlaceholders = stageGroupIds
|
|
87
|
-
.map((_, idx) => `$${idx + 1}`)
|
|
88
|
-
.join(", ");
|
|
89
|
-
|
|
90
|
-
const params_stage = [...stageGroupIds, Number(loggedInUser.organization_id)];
|
|
91
92
|
|
|
92
|
-
const stagesRaw = await this.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
);
|
|
93
|
+
const stagesRaw: any[] = await this.stageRepository.find({
|
|
94
|
+
where: {
|
|
95
|
+
stage_group_id: In(stageGroupIds),
|
|
96
|
+
organization_id: loggedInUser.organization_id
|
|
97
|
+
},
|
|
98
|
+
order: {
|
|
99
|
+
sequence: 'ASC',
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
102
|
|
|
103
103
|
const stageIds = stagesRaw.map((s) => Number(s.id));
|
|
104
104
|
|