rez_core 2.2.95 → 2.2.97

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": "2.2.95",
3
+ "version": "2.2.97",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -462,6 +462,18 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
462
462
  );
463
463
  }
464
464
 
465
+ async getSingleResolvedData(
466
+ loggedInUser: UserData,
467
+ entityData: any,
468
+ entityType: string,
469
+ ): Promise<any> {
470
+ return this.resolverService.getResolvedData(
471
+ loggedInUser,
472
+ entityData,
473
+ entityType,
474
+ );
475
+ }
476
+
465
477
  async getResolvedEntityData(
466
478
  entityType: string,
467
479
  entityId: number,
@@ -42,9 +42,27 @@ export class StageGroupRepository {
42
42
  return result;
43
43
  }
44
44
 
45
+ async getAllStageGroupByCondition(condition: any) {
46
+ const result = await this.stageGroupRepository.find({
47
+ where: {
48
+ ...condition,
49
+ },
50
+ order: {
51
+ sequence: 'ASC',
52
+ },
53
+ });
54
+
55
+ if (!result || result.length === 0) {
56
+ throw new NotFoundException(
57
+ 'No stage groups found for the given workflow ID',
58
+ );
59
+ }
60
+
61
+ return result;
62
+ }
63
+
45
64
  async getAllStageGroupAndStageHierarchy(
46
65
  workflow_id: number,
47
- organization_id: number,
48
66
  loggedInUser: any, // required for media service
49
67
  lead_id: number,
50
68
  ) {
@@ -53,10 +71,12 @@ export class StageGroupRepository {
53
71
  }
54
72
 
55
73
  // Step 1: Get all stage groups
56
- const stageGroups = await this.getAllStageGroup(
74
+ const stageGroups = await this.getAllStageGroupByCondition({
57
75
  workflow_id,
58
- organization_id,
59
- );
76
+ organization_id: loggedInUser.organization_id,
77
+ level_id: loggedInUser.level_id,
78
+ });
79
+
60
80
  if (!stageGroups.length) return [];
61
81
 
62
82
  // Step 2: Get all stages for these stage groups
@@ -70,7 +90,7 @@ export class StageGroupRepository {
70
90
  AND cr_wf_stage.organization_id = ?
71
91
  ORDER BY cr_wf_stage.sequence ASC
72
92
  `,
73
- [...stageGroupIds, organization_id],
93
+ [...stageGroupIds, loggedInUser.organization_id],
74
94
  );
75
95
 
76
96
  const stageIds = stagesRaw.map((s) => s.id);
@@ -76,7 +76,6 @@ export class StageGroupService extends EntityServiceImpl {
76
76
  const stageGroupAndStageHierarchy =
77
77
  (await this.stageGroupRepository.getAllStageGroupAndStageHierarchy(
78
78
  workflowLevelMapping.workflow_id,
79
- loggedInUser.organization_id,
80
79
  loggedInUser,
81
80
  lead_id,
82
81
  )) as Array<{
@@ -1,5 +0,0 @@
1
- {
2
- "recommendations": [
3
- "dbaeumer.vscode-eslint"
4
- ]
5
- }