rez_core 2.2.23 → 2.2.25

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.
Files changed (31) hide show
  1. package/dist/module/workflow/controller/action-category.controller.js +1 -2
  2. package/dist/module/workflow/controller/action-category.controller.js.map +1 -1
  3. package/dist/module/workflow/controller/stage-group.controller.js +2 -2
  4. package/dist/module/workflow/controller/stage-group.controller.js.map +1 -1
  5. package/dist/module/workflow/controller/stage.controller.js +4 -4
  6. package/dist/module/workflow/controller/stage.controller.js.map +1 -1
  7. package/dist/module/workflow/repository/stage-group.repository.d.ts +1 -1
  8. package/dist/module/workflow/repository/stage-group.repository.js +2 -3
  9. package/dist/module/workflow/repository/stage-group.repository.js.map +1 -1
  10. package/dist/module/workflow/repository/stage.repository.d.ts +1 -1
  11. package/dist/module/workflow/repository/stage.repository.js +3 -4
  12. package/dist/module/workflow/repository/stage.repository.js.map +1 -1
  13. package/dist/module/workflow/service/action-category.service.d.ts +1 -1
  14. package/dist/module/workflow/service/action-category.service.js +3 -4
  15. package/dist/module/workflow/service/action-category.service.js.map +1 -1
  16. package/dist/module/workflow/service/stage-group.service.d.ts +1 -1
  17. package/dist/module/workflow/service/stage-group.service.js +2 -2
  18. package/dist/module/workflow/service/stage-group.service.js.map +1 -1
  19. package/dist/module/workflow/service/stage.service.d.ts +2 -2
  20. package/dist/module/workflow/service/stage.service.js +5 -5
  21. package/dist/module/workflow/service/stage.service.js.map +1 -1
  22. package/dist/tsconfig.build.tsbuildinfo +1 -1
  23. package/package.json +1 -1
  24. package/src/module/workflow/controller/action-category.controller.ts +4 -5
  25. package/src/module/workflow/controller/stage-group.controller.ts +2 -3
  26. package/src/module/workflow/controller/stage.controller.ts +4 -6
  27. package/src/module/workflow/repository/stage-group.repository.ts +2 -7
  28. package/src/module/workflow/repository/stage.repository.ts +3 -10
  29. package/src/module/workflow/service/action-category.service.ts +3 -7
  30. package/src/module/workflow/service/stage-group.service.ts +2 -7
  31. package/src/module/workflow/service/stage.service.ts +5 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.2.23",
3
+ "version": "2.2.25",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -39,11 +39,10 @@ export class ActionCategoryController {
39
39
  @Req() req: Request & { user: any },
40
40
  @Body('action_cat_code') action_cat_code: string,
41
41
  ) {
42
- const loggedInUser = req.user.userData;
43
- const result = this.actionCategoryService.getReasonCodeByActionCategoryId(
44
- loggedInUser,
45
- action_cat_code,
46
- );
42
+ const result =
43
+ this.actionCategoryService.getReasonCodeByActionCategoryId(
44
+ action_cat_code,
45
+ );
47
46
  return result;
48
47
  }
49
48
 
@@ -23,11 +23,10 @@ export class StageGroupController {
23
23
  @Req() req: Request & { user: any },
24
24
  @Body() body: { workflow_id: number },
25
25
  ) {
26
- const { level_id, level_type } = req.user.userData;
26
+ const { organization_id } = req.user.userData;
27
27
  return this.stageGroupService.getAllStageGroup(
28
28
  body.workflow_id,
29
- level_id,
30
- level_type,
29
+ organization_id,
31
30
  );
32
31
  }
33
32
  }
@@ -26,11 +26,10 @@ export class StageController {
26
26
  @Req() req: Request & { user: any },
27
27
  @Body() body: { stage_group_id: number },
28
28
  ) {
29
- const { level_id, level_type } = req.user.userData;
29
+ const { organization_id } = req.user.userData;
30
30
  return this.stageGroupService.getAllStage(
31
31
  body.stage_group_id,
32
- level_id,
33
- level_type,
32
+ organization_id,
34
33
  );
35
34
  }
36
35
 
@@ -40,11 +39,10 @@ export class StageController {
40
39
  @Body('workflow_id') workflow_id: number,
41
40
  @Req() req: Request & { user: any },
42
41
  ) {
43
- const { level_id, level_type } = req.user.userData;
42
+ const { organization_id } = req.user.userData;
44
43
  return this.stageGroupService.getStagesWithGroupName(
45
44
  workflow_id,
46
- level_id,
47
- level_type,
45
+ organization_id,
48
46
  );
49
47
  }
50
48
  }
@@ -15,11 +15,7 @@ export class StageGroupRepository {
15
15
  private readonly stageGroupRepository: Repository<StageGroup>,
16
16
  ) {}
17
17
 
18
- async getAllStageGroup(
19
- workflow_id: number,
20
- level_id: string,
21
- level_type: string,
22
- ) {
18
+ async getAllStageGroup(workflow_id: number, organization_id: number) {
23
19
  if (!workflow_id) {
24
20
  throw new BadRequestException('workflow_id is required');
25
21
  }
@@ -27,8 +23,7 @@ export class StageGroupRepository {
27
23
  const result = await this.stageGroupRepository.find({
28
24
  where: {
29
25
  workflow_id,
30
- level_id,
31
- level_type,
26
+ organization_id,
32
27
  },
33
28
  order: {
34
29
  sequence: 'ASC',
@@ -16,11 +16,7 @@ export class StageRepository {
16
16
  private readonly stageRepository: Repository<Stage>,
17
17
  ) {}
18
18
 
19
- async getAllStage(
20
- stage_group_id: number,
21
- level_id: string,
22
- level_type: string,
23
- ) {
19
+ async getAllStage(stage_group_id: number, organization_id: number) {
24
20
  if (!stage_group_id) {
25
21
  throw new BadRequestException('stage_group_id is required');
26
22
  }
@@ -28,8 +24,7 @@ export class StageRepository {
28
24
  const result = await this.stageRepository.find({
29
25
  where: {
30
26
  stage_group_id,
31
- level_id,
32
- level_type,
27
+ organization_id,
33
28
  },
34
29
  order: {
35
30
  sequence: 'ASC',
@@ -37,9 +32,7 @@ export class StageRepository {
37
32
  });
38
33
 
39
34
  if (!result || result.length === 0) {
40
- throw new NotFoundException(
41
- 'No stage found for the given stage group ID',
42
- );
35
+ return [];
43
36
  }
44
37
 
45
38
  return result;
@@ -28,18 +28,14 @@ export class ActionCategoryService extends EntityServiceImpl {
28
28
  }));
29
29
  }
30
30
 
31
- async getReasonCodeByActionCategoryId(
32
- loggedInUser: UserData,
33
- action_cat_code: string,
34
- ) {
35
- const { organization_id } = loggedInUser;
31
+ async getReasonCodeByActionCategoryId(action_cat_code: string) {
36
32
  const result = await this.dataSource.query(
37
33
  `
38
34
  SELECT id, reason_code
39
35
  FROM cr_wf_action_category
40
- WHERE organization_id = ? AND code = ?
36
+ WHERE code = ?
41
37
  `,
42
- [organization_id, action_cat_code],
38
+ [action_cat_code],
43
39
  );
44
40
 
45
41
  return {
@@ -16,15 +16,10 @@ export class StageGroupService extends EntityServiceImpl {
16
16
  ) {
17
17
  super();
18
18
  }
19
- async getAllStageGroup(
20
- workflow_id: number,
21
- level_id: string,
22
- level_type: string,
23
- ) {
19
+ async getAllStageGroup(workflow_id: number, organization_id: number) {
24
20
  return await this.stageGroupRepository.getAllStageGroup(
25
21
  workflow_id,
26
- level_id,
27
- level_type,
22
+ organization_id,
28
23
  );
29
24
  }
30
25
 
@@ -23,15 +23,10 @@ export class StageService extends EntityServiceImpl {
23
23
  ) {
24
24
  super();
25
25
  }
26
- async getAllStage(
27
- stage_group_id: number,
28
- level_id: string,
29
- level_type: string,
30
- ) {
26
+ async getAllStage(stage_group_id: number, organization_id: number) {
31
27
  return await this.stageRepository.getAllStage(
32
28
  stage_group_id,
33
- level_id,
34
- level_type,
29
+ organization_id,
35
30
  );
36
31
  }
37
32
 
@@ -75,19 +70,14 @@ export class StageService extends EntityServiceImpl {
75
70
  return deleteStage;
76
71
  }
77
72
 
78
- async getStagesWithGroupName(
79
- workflow_id: number,
80
- level_id: string,
81
- level_type: string,
82
- ) {
73
+ async getStagesWithGroupName(workflow_id: number, organization_id: number) {
83
74
  if (!workflow_id) {
84
75
  throw new BadRequestException('workflow_id is required');
85
76
  }
86
77
 
87
78
  const stageGroups = await this.stageGroupRepository.getAllStageGroup(
88
79
  workflow_id,
89
- level_id,
90
- level_type,
80
+ organization_id,
91
81
  );
92
82
 
93
83
  const stageGroupIds = stageGroups.map((group) => group.id);
@@ -101,8 +91,7 @@ export class StageService extends EntityServiceImpl {
101
91
  try {
102
92
  const stages = await this.stageRepository.getAllStage(
103
93
  groupId,
104
- level_id,
105
- level_type,
94
+ organization_id,
106
95
  );
107
96
  allStages.push(...stages);
108
97
  } catch (err) {