rez_core 2.1.148 → 2.1.150

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 (59) hide show
  1. package/dist/module/meta/entity/base-entity.entity.js.map +1 -1
  2. package/dist/module/workflow/controller/comm-template.controller.d.ts +1 -1
  3. package/dist/module/workflow/controller/task.controller.d.ts +12 -0
  4. package/dist/module/workflow/controller/task.controller.js +45 -0
  5. package/dist/module/workflow/controller/task.controller.js.map +1 -0
  6. package/dist/module/workflow/controller/workflow-meta.controller.d.ts +9 -3
  7. package/dist/module/workflow/controller/workflow-meta.controller.js +17 -10
  8. package/dist/module/workflow/controller/workflow-meta.controller.js.map +1 -1
  9. package/dist/module/workflow/entity/action-data.entity.d.ts +12 -0
  10. package/dist/module/workflow/entity/action-data.entity.js +58 -0
  11. package/dist/module/workflow/entity/action-data.entity.js.map +1 -0
  12. package/dist/module/workflow/entity/action.entity.d.ts +1 -0
  13. package/dist/module/workflow/entity/action.entity.js +4 -0
  14. package/dist/module/workflow/entity/action.entity.js.map +1 -1
  15. package/dist/module/workflow/entity/stage-movement-data.entity.d.ts +2 -0
  16. package/dist/module/workflow/entity/stage-movement-data.entity.js +8 -0
  17. package/dist/module/workflow/entity/stage-movement-data.entity.js.map +1 -1
  18. package/dist/module/workflow/entity/task-data.entity.d.ts +15 -0
  19. package/dist/module/workflow/entity/task-data.entity.js +70 -0
  20. package/dist/module/workflow/entity/task-data.entity.js.map +1 -0
  21. package/dist/module/workflow/entity/workflow-level-mapping.entity.d.ts +7 -0
  22. package/dist/module/workflow/entity/workflow-level-mapping.entity.js +38 -0
  23. package/dist/module/workflow/entity/workflow-level-mapping.entity.js.map +1 -0
  24. package/dist/module/workflow/repository/stage-movement.repository.d.ts +23 -0
  25. package/dist/module/workflow/repository/stage-movement.repository.js +138 -0
  26. package/dist/module/workflow/repository/stage-movement.repository.js.map +1 -0
  27. package/dist/module/workflow/repository/task.repository.d.ts +7 -0
  28. package/dist/module/workflow/repository/task.repository.js +42 -0
  29. package/dist/module/workflow/repository/task.repository.js.map +1 -0
  30. package/dist/module/workflow/service/action.service.js +1 -1
  31. package/dist/module/workflow/service/action.service.js.map +1 -1
  32. package/dist/module/workflow/service/comm-template.service.d.ts +1 -1
  33. package/dist/module/workflow/service/comm-template.service.js +1 -1
  34. package/dist/module/workflow/service/comm-template.service.js.map +1 -1
  35. package/dist/module/workflow/service/task.service.d.ts +8 -0
  36. package/dist/module/workflow/service/task.service.js +31 -0
  37. package/dist/module/workflow/service/task.service.js.map +1 -0
  38. package/dist/module/workflow/service/workflow-meta.service.d.ts +11 -5
  39. package/dist/module/workflow/service/workflow-meta.service.js +57 -22
  40. package/dist/module/workflow/service/workflow-meta.service.js.map +1 -1
  41. package/dist/module/workflow/workflow.module.js +14 -0
  42. package/dist/module/workflow/workflow.module.js.map +1 -1
  43. package/dist/tsconfig.build.tsbuildinfo +1 -1
  44. package/package.json +1 -1
  45. package/src/module/meta/entity/base-entity.entity.ts +1 -1
  46. package/src/module/workflow/controller/task.controller.ts +40 -0
  47. package/src/module/workflow/controller/workflow-meta.controller.ts +29 -5
  48. package/src/module/workflow/entity/action-data.entity.ts +34 -0
  49. package/src/module/workflow/entity/action.entity.ts +3 -0
  50. package/src/module/workflow/entity/stage-movement-data.entity.ts +6 -0
  51. package/src/module/workflow/entity/task-data.entity.ts +43 -0
  52. package/src/module/workflow/entity/workflow-level-mapping.entity.ts +18 -0
  53. package/src/module/workflow/repository/stage-movement.repository.ts +215 -0
  54. package/src/module/workflow/repository/task.repository.ts +30 -0
  55. package/src/module/workflow/service/action.service.ts +1 -1
  56. package/src/module/workflow/service/comm-template.service.ts +1 -1
  57. package/src/module/workflow/service/task.service.ts +25 -0
  58. package/src/module/workflow/service/workflow-meta.service.ts +128 -23
  59. package/src/module/workflow/workflow.module.ts +14 -0
@@ -1 +1 @@
1
- {"version":3,"file":"base-entity.entity.js","sourceRoot":"","sources":["../../../../src/module/meta/entity/base-entity.entity.ts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ChE,IAAA,0BAAM,GAAE;;mDACe;AAIxB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzE,IAAA,0BAAM,GAAE;;2CACO;AAIhB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1E,IAAA,0BAAM,GAAE;;4CACQ;AAIjB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5E,IAAA,0BAAM,GAAE;;8CACU"}
@@ -6,6 +6,6 @@ export declare class CommTemplateController {
6
6
  user: any;
7
7
  }, entity_type: string): Promise<{
8
8
  value: string;
9
- name: string;
9
+ label: string;
10
10
  }[]>;
11
11
  }
@@ -0,0 +1,12 @@
1
+ import { TaskService } from '../service/task.service';
2
+ export declare class TaskController {
3
+ private readonly taskService;
4
+ constructor(taskService: TaskService);
5
+ getTasksbyUserAndStage(req: Request & {
6
+ user: any;
7
+ }, body: {
8
+ mapped_entity_type: string;
9
+ mapped_entity_id: number;
10
+ stage_id: number;
11
+ }): Promise<any>;
12
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.TaskController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const jwt_guard_1 = require("../../auth/guards/jwt.guard");
18
+ const task_service_1 = require("../service/task.service");
19
+ let TaskController = class TaskController {
20
+ constructor(taskService) {
21
+ this.taskService = taskService;
22
+ }
23
+ async getTasksbyUserAndStage(req, body) {
24
+ const loggedInUser = req.user.userData;
25
+ const result = this.taskService.getAllTaskByUserIdandStageId(loggedInUser, body);
26
+ return result;
27
+ }
28
+ };
29
+ exports.TaskController = TaskController;
30
+ __decorate([
31
+ (0, common_1.Post)('/getTasksbyUserAndStage'),
32
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
33
+ __param(0, (0, common_1.Req)()),
34
+ __param(1, (0, common_1.Body)()),
35
+ __metadata("design:type", Function),
36
+ __metadata("design:paramtypes", [Object, Object]),
37
+ __metadata("design:returntype", Promise)
38
+ ], TaskController.prototype, "getTasksbyUserAndStage", null);
39
+ exports.TaskController = TaskController = __decorate([
40
+ (0, common_1.Controller)('/task'),
41
+ (0, common_1.UseGuards)(jwt_guard_1.JwtAuthGuard),
42
+ __param(0, (0, common_1.Inject)('TaskService')),
43
+ __metadata("design:paramtypes", [task_service_1.TaskService])
44
+ ], TaskController);
45
+ //# sourceMappingURL=task.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.controller.js","sourceRoot":"","sources":["../../../../src/module/workflow/controller/task.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,2DAAgE;AAChE,0DAAsD;AAI/C,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IACxC,CAAC;IAIE,AAAN,KAAK,CAAC,sBAAsB,CACnB,GAA4B,EAEnC,IAIC;QAED,MAAM,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QACvC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,4BAA4B,CAC1D,YAAY,EACZ,IAAI,CACL,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AAxBY,wCAAc;AAQnB;IAFL,IAAA,aAAI,EAAC,yBAAyB,CAAC;IAC/B,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;IAErB,WAAA,IAAA,YAAG,GAAE,CAAA;IACL,WAAA,IAAA,aAAI,GAAE,CAAA;;;;4DAaR;yBAvBU,cAAc;IAF1B,IAAA,mBAAU,EAAC,OAAO,CAAC;IACnB,IAAA,kBAAS,EAAC,wBAAY,CAAC;IAGnB,WAAA,IAAA,eAAM,EAAC,aAAa,CAAC,CAAA;qCACQ,0BAAW;GAHhC,cAAc,CAwB1B"}
@@ -3,7 +3,13 @@ import { StageMovementData } from '../entity/stage-movement-data.entity';
3
3
  export declare class WorkflowMetaController {
4
4
  private readonly workflowMetaService;
5
5
  constructor(workflowMetaService: WorkflowMetaService);
6
- getCurrentStage(mapped_entity_type: string, mapped_entity_id: number): Promise<StageMovementData | null>;
7
- getNextStage(mapped_entity_type: string, mapped_entity_id: number): Promise<number | null>;
8
- moveToNextStage(mapped_entity_type: string, mapped_entity_id: number, current_user_id: number): Promise<string>;
6
+ getCurrentStage(mapped_entity_type: string, mapped_entity_id: number, req: Request & {
7
+ user: any;
8
+ }): Promise<StageMovementData | null>;
9
+ getNextStage(mapped_entity_type: string, mapped_entity_id: number, req: Request & {
10
+ user: any;
11
+ }): Promise<number | null>;
12
+ moveToNextStage(mapped_entity_type: string, mapped_entity_id: number, req: Request & {
13
+ user: any;
14
+ }): Promise<string>;
9
15
  }
@@ -15,19 +15,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.WorkflowMetaController = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
17
  const workflow_meta_service_1 = require("../service/workflow-meta.service");
18
+ const jwt_guard_1 = require("../../auth/guards/jwt.guard");
18
19
  let WorkflowMetaController = class WorkflowMetaController {
19
20
  constructor(workflowMetaService) {
20
21
  this.workflowMetaService = workflowMetaService;
21
22
  }
22
- async getCurrentStage(mapped_entity_type, mapped_entity_id) {
23
- return this.workflowMetaService.getCurrentStage(mapped_entity_type, Number(mapped_entity_id));
23
+ async getCurrentStage(mapped_entity_type, mapped_entity_id, req) {
24
+ let loggedInUser = req.user.userData;
25
+ return this.workflowMetaService.getCurrentStage(mapped_entity_type, Number(mapped_entity_id), loggedInUser);
24
26
  }
25
- async getNextStage(mapped_entity_type, mapped_entity_id) {
26
- const current = await this.workflowMetaService.getCurrentStage(mapped_entity_type, Number(mapped_entity_id));
27
+ async getNextStage(mapped_entity_type, mapped_entity_id, req) {
28
+ const loggedInUser = req.user.userData;
29
+ const current = await this.workflowMetaService.getCurrentStage(mapped_entity_type, Number(mapped_entity_id), loggedInUser);
27
30
  return current ? this.workflowMetaService.getNextStage(current) : null;
28
31
  }
29
- async moveToNextStage(mapped_entity_type, mapped_entity_id, current_user_id) {
30
- return this.workflowMetaService.moveToNextStage(mapped_entity_type, Number(mapped_entity_id), current_user_id);
32
+ async moveToNextStage(mapped_entity_type, mapped_entity_id, req) {
33
+ const loggedInUser = req.user.userData;
34
+ return this.workflowMetaService.moveToNextStage(mapped_entity_type, Number(mapped_entity_id), loggedInUser);
31
35
  }
32
36
  };
33
37
  exports.WorkflowMetaController = WorkflowMetaController;
@@ -35,29 +39,32 @@ __decorate([
35
39
  (0, common_1.Get)('current-stage'),
36
40
  __param(0, (0, common_1.Query)('entityType')),
37
41
  __param(1, (0, common_1.Query)('entityId')),
42
+ __param(2, (0, common_1.Req)()),
38
43
  __metadata("design:type", Function),
39
- __metadata("design:paramtypes", [String, Number]),
44
+ __metadata("design:paramtypes", [String, Number, Object]),
40
45
  __metadata("design:returntype", Promise)
41
46
  ], WorkflowMetaController.prototype, "getCurrentStage", null);
42
47
  __decorate([
43
48
  (0, common_1.Get)('next-stage'),
44
49
  __param(0, (0, common_1.Query)('entityType')),
45
50
  __param(1, (0, common_1.Query)('entityId')),
51
+ __param(2, (0, common_1.Req)()),
46
52
  __metadata("design:type", Function),
47
- __metadata("design:paramtypes", [String, Number]),
53
+ __metadata("design:paramtypes", [String, Number, Object]),
48
54
  __metadata("design:returntype", Promise)
49
55
  ], WorkflowMetaController.prototype, "getNextStage", null);
50
56
  __decorate([
51
57
  (0, common_1.Post)('move-next-stage'),
52
58
  __param(0, (0, common_1.Body)('entityType')),
53
59
  __param(1, (0, common_1.Body)('entityId')),
54
- __param(2, (0, common_1.Body)('currentUserId')),
60
+ __param(2, (0, common_1.Req)()),
55
61
  __metadata("design:type", Function),
56
- __metadata("design:paramtypes", [String, Number, Number]),
62
+ __metadata("design:paramtypes", [String, Number, Object]),
57
63
  __metadata("design:returntype", Promise)
58
64
  ], WorkflowMetaController.prototype, "moveToNextStage", null);
59
65
  exports.WorkflowMetaController = WorkflowMetaController = __decorate([
60
66
  (0, common_1.Controller)('workflow-meta'),
67
+ (0, common_1.UseGuards)(jwt_guard_1.JwtAuthGuard),
61
68
  __metadata("design:paramtypes", [workflow_meta_service_1.WorkflowMetaService])
62
69
  ], WorkflowMetaController);
63
70
  //# sourceMappingURL=workflow-meta.controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-meta.controller.js","sourceRoot":"","sources":["../../../../src/module/workflow/controller/workflow-meta.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoE;AACpE,4EAAuE;AAIhE,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAMnE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IAAA,mBAAU,EAAC,eAAe,CAAC;qCAEwB,2CAAmB;GAD1D,sBAAsB,CA8ClC"}
1
+ {"version":3,"file":"workflow-meta.controller.js","sourceRoot":"","sources":["../../../../src/module/workflow/controller/workflow-meta.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AACxB,4EAAuE;AAEvE,2DAAgE;AAIzD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAMnE,AAAN,KAAK,CAAC,eAAe,CACE,kBAA0B,EAC5B,gBAAwB,EACpC,GAA4B;QAEnC,IAAI,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAErC,OAAO,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAC7C,kBAAkB,EAClB,MAAM,CAAC,gBAAgB,CAAC,EACxB,YAAY,CACb,CAAC;IACJ,CAAC;IAMK,AAAN,KAAK,CAAC,YAAY,CACK,kBAA0B,EAC5B,gBAAwB,EACpC,GAA4B;QAEnC,MAAM,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QACvC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAC5D,kBAAkB,EAClB,MAAM,CAAC,gBAAgB,CAAC,EACxB,YAAY,CACb,CAAC;QACF,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACzE,CAAC;IAWK,AAAN,KAAK,CAAC,eAAe,CACC,kBAA0B,EAC5B,gBAAwB,EACnC,GAA4B;QAEnC,MAAM,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QACvC,OAAO,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAC7C,kBAAkB,EAClB,MAAM,CAAC,gBAAgB,CAAC,EACxB,YAAY,CACb,CAAC;IACJ,CAAC;CACF,CAAA;AA5DY,wDAAsB;AAO3B;IADL,IAAA,YAAG,EAAC,eAAe,CAAC;IAElB,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;IACnB,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;IACjB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;6DASP;AAMK;IADL,IAAA,YAAG,EAAC,YAAY,CAAC;IAEf,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;IACnB,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;IACjB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;0DASP;AAWK;IADL,IAAA,aAAI,EAAC,iBAAiB,CAAC;IAErB,WAAA,IAAA,aAAI,EAAC,YAAY,CAAC,CAAA;IAClB,WAAA,IAAA,aAAI,EAAC,UAAU,CAAC,CAAA;IAChB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;6DAQP;iCA3DU,sBAAsB;IAFlC,IAAA,mBAAU,EAAC,eAAe,CAAC;IAC3B,IAAA,kBAAS,EAAC,wBAAY,CAAC;qCAE4B,2CAAmB;GAD1D,sBAAsB,CA4DlC"}
@@ -0,0 +1,12 @@
1
+ import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
2
+ export declare class ActionDataEntity extends BaseEntity {
3
+ constructor();
4
+ action_id: number;
5
+ user_id: number;
6
+ stage_id: number;
7
+ start_time: Date;
8
+ end_time: Date;
9
+ is_mandatory: boolean;
10
+ mapped_entity_id: number;
11
+ mapped_entity_type: string;
12
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ActionDataEntity = void 0;
13
+ const base_entity_entity_1 = require("../../meta/entity/base-entity.entity");
14
+ const typeorm_1 = require("typeorm");
15
+ let ActionDataEntity = class ActionDataEntity extends base_entity_entity_1.BaseEntity {
16
+ constructor() {
17
+ super();
18
+ this.entity_type = 'ACTION_DATA';
19
+ }
20
+ };
21
+ exports.ActionDataEntity = ActionDataEntity;
22
+ __decorate([
23
+ (0, typeorm_1.Column)({ nullable: true }),
24
+ __metadata("design:type", Number)
25
+ ], ActionDataEntity.prototype, "action_id", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)({ nullable: true }),
28
+ __metadata("design:type", Number)
29
+ ], ActionDataEntity.prototype, "user_id", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ nullable: true }),
32
+ __metadata("design:type", Number)
33
+ ], ActionDataEntity.prototype, "stage_id", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ nullable: true }),
36
+ __metadata("design:type", Date)
37
+ ], ActionDataEntity.prototype, "start_time", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ nullable: true }),
40
+ __metadata("design:type", Date)
41
+ ], ActionDataEntity.prototype, "end_time", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ nullable: true }),
44
+ __metadata("design:type", Boolean)
45
+ ], ActionDataEntity.prototype, "is_mandatory", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ nullable: true }),
48
+ __metadata("design:type", Number)
49
+ ], ActionDataEntity.prototype, "mapped_entity_id", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({ nullable: true }),
52
+ __metadata("design:type", String)
53
+ ], ActionDataEntity.prototype, "mapped_entity_type", void 0);
54
+ exports.ActionDataEntity = ActionDataEntity = __decorate([
55
+ (0, typeorm_1.Entity)({ name: 'cr_wf_action_data' }),
56
+ __metadata("design:paramtypes", [])
57
+ ], ActionDataEntity);
58
+ //# sourceMappingURL=action-data.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-data.entity.js","sourceRoot":"","sources":["../../../../src/module/workflow/entity/action-data.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAAuE;AACvE,qCAAyC;AAGlC,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,+BAAU;IAC9C;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,aAAa,CAAC;IACnC,CAAC;CAyBF,CAAA;AA7BY,4CAAgB;AAO3B;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACT;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACX;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACV;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACf,IAAI;oDAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACjB,IAAI;kDAAC;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACL;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACF;AAGzB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACA;2BA5BhB,gBAAgB;IAD5B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;;GACzB,gBAAgB,CA6B5B"}
@@ -8,4 +8,5 @@ export declare class ActionEntity extends BaseEntity {
8
8
  reason_code: string;
9
9
  default_reason_code: number;
10
10
  default_value: boolean;
11
+ user_id: number;
11
12
  }
@@ -48,6 +48,10 @@ __decorate([
48
48
  (0, typeorm_1.Column)({ default: 0, type: 'boolean' }),
49
49
  __metadata("design:type", Boolean)
50
50
  ], ActionEntity.prototype, "default_value", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ nullable: true }),
53
+ __metadata("design:type", Number)
54
+ ], ActionEntity.prototype, "user_id", void 0);
51
55
  exports.ActionEntity = ActionEntity = __decorate([
52
56
  (0, typeorm_1.Entity)({ name: 'cr_wf_action' }),
53
57
  __metadata("design:paramtypes", [])
@@ -1 +1 @@
1
- {"version":3,"file":"action.entity.js","sourceRoot":"","sources":["../../../../src/module/workflow/entity/action.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAAsD;AACtD,6EAAuE;AACvE,qCAAyC;AAGlC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,+BAAU;IAC1C;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,wBAAM,CAAC;IAC5B,CAAC;CAsBF,CAAA;AA1BY,oCAAY;AAOvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACpB;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDAClB;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACjB;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC3B;AAGjB;IAD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AAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACZ;AAG5B;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;mDACjB;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;uBA5BL,YAAY;IADxB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;;GACpB,YAAY,CA6BxB"}
@@ -3,6 +3,8 @@ export declare class StageMovementData extends BaseEntity {
3
3
  constructor();
4
4
  current_user_id: number;
5
5
  stage_action_mapping_id: number;
6
+ stage_group_id: number;
7
+ stage_id: number;
6
8
  start_date: Date;
7
9
  end_date: Date;
8
10
  is_current: string;
@@ -28,6 +28,14 @@ __decorate([
28
28
  (0, typeorm_1.Column)({ type: 'int', nullable: true }),
29
29
  __metadata("design:type", Number)
30
30
  ], StageMovementData.prototype, "stage_action_mapping_id", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
33
+ __metadata("design:type", Number)
34
+ ], StageMovementData.prototype, "stage_group_id", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
37
+ __metadata("design:type", Number)
38
+ ], StageMovementData.prototype, "stage_id", void 0);
31
39
  __decorate([
32
40
  (0, typeorm_1.Column)({ type: 'date', nullable: true }),
33
41
  __metadata("design:type", Date)
@@ -1 +1 @@
1
- {"version":3,"file":"stage-movement-data.entity.js","sourceRoot":"","sources":["../../../../src/module/workflow/entity/stage-movement-data.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAAmE;AACnE,6EAAuE;AACvE,qCAAyC;AAGlC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,+BAAU;IAC/C;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,qCAAmB,CAAC;IACzC,CAAC;CAsBF,CAAA;AA1BY,8CAAiB;AAO5B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DAChB;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kEACR;AAGhC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC7B,IAAI;qDAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC/B,IAAI;mDAAC;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACzB;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6DACjB;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACf;4BAzBd,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC;;GACjC,iBAAiB,CA0B7B"}
1
+ {"version":3,"file":"stage-movement-data.entity.js","sourceRoot":"","sources":["../../../../src/module/workflow/entity/stage-movement-data.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAAmE;AACnE,6EAAuE;AACvE,qCAAyC;AAGlC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,+BAAU;IAC/C;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,qCAAmB,CAAC;IACzC,CAAC;CA4BF,CAAA;AAhCY,8CAAiB;AAO5B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DAChB;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kEACR;AAGhC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACjB;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACvB;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC7B,IAAI;qDAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC/B,IAAI;mDAAC;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACzB;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6DACjB;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACf;4BA/Bd,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC;;GACjC,iBAAiB,CAgC7B"}
@@ -0,0 +1,15 @@
1
+ import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
2
+ export declare class TaskDataEntity extends BaseEntity {
3
+ constructor();
4
+ task_id: number;
5
+ user_id: number;
6
+ stage_id: number;
7
+ action_id: number;
8
+ start_time: Date;
9
+ end_time: Date;
10
+ is_completed: boolean;
11
+ is_system: boolean;
12
+ is_mandatory: boolean;
13
+ mapped_entity_id: number;
14
+ mapped_entity_type: string;
15
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TaskDataEntity = void 0;
13
+ const base_entity_entity_1 = require("../../meta/entity/base-entity.entity");
14
+ const typeorm_1 = require("typeorm");
15
+ let TaskDataEntity = class TaskDataEntity extends base_entity_entity_1.BaseEntity {
16
+ constructor() {
17
+ super();
18
+ this.entity_type = 'TASK_DATA';
19
+ }
20
+ };
21
+ exports.TaskDataEntity = TaskDataEntity;
22
+ __decorate([
23
+ (0, typeorm_1.Column)({ nullable: true }),
24
+ __metadata("design:type", Number)
25
+ ], TaskDataEntity.prototype, "task_id", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)({ nullable: true }),
28
+ __metadata("design:type", Number)
29
+ ], TaskDataEntity.prototype, "user_id", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ nullable: true }),
32
+ __metadata("design:type", Number)
33
+ ], TaskDataEntity.prototype, "stage_id", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ nullable: true }),
36
+ __metadata("design:type", Number)
37
+ ], TaskDataEntity.prototype, "action_id", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ nullable: true }),
40
+ __metadata("design:type", Date)
41
+ ], TaskDataEntity.prototype, "start_time", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ nullable: true }),
44
+ __metadata("design:type", Date)
45
+ ], TaskDataEntity.prototype, "end_time", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ nullable: true }),
48
+ __metadata("design:type", Boolean)
49
+ ], TaskDataEntity.prototype, "is_completed", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({ default: 0 }),
52
+ __metadata("design:type", Boolean)
53
+ ], TaskDataEntity.prototype, "is_system", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.Column)({ nullable: true }),
56
+ __metadata("design:type", Boolean)
57
+ ], TaskDataEntity.prototype, "is_mandatory", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ nullable: true }),
60
+ __metadata("design:type", Number)
61
+ ], TaskDataEntity.prototype, "mapped_entity_id", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.Column)({ nullable: true }),
64
+ __metadata("design:type", String)
65
+ ], TaskDataEntity.prototype, "mapped_entity_type", void 0);
66
+ exports.TaskDataEntity = TaskDataEntity = __decorate([
67
+ (0, typeorm_1.Entity)({ name: 'cr_wf_task_data' }),
68
+ __metadata("design:paramtypes", [])
69
+ ], TaskDataEntity);
70
+ //# sourceMappingURL=task-data.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-data.entity.js","sourceRoot":"","sources":["../../../../src/module/workflow/entity/task-data.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAAuE;AACvE,qCAAyC;AAGlC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,+BAAU;IAC5C;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;CAkCF,CAAA;AAtCY,wCAAc;AAOzB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACV;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACT;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACf,IAAI;kDAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACjB,IAAI;gDAAC;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACL;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;iDACJ;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACL;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACF;AAGzB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACA;yBArChB,cAAc;IAD1B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;;GACvB,cAAc,CAsC1B"}
@@ -0,0 +1,7 @@
1
+ export declare class WorkflowLevelMappingEntity {
2
+ constructor();
3
+ id: number;
4
+ workflow_id: number;
5
+ mapped_level_id: string;
6
+ mapped_level_type: string;
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WorkflowLevelMappingEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ let WorkflowLevelMappingEntity = class WorkflowLevelMappingEntity {
15
+ constructor() { }
16
+ };
17
+ exports.WorkflowLevelMappingEntity = WorkflowLevelMappingEntity;
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
20
+ __metadata("design:type", Number)
21
+ ], WorkflowLevelMappingEntity.prototype, "id", void 0);
22
+ __decorate([
23
+ (0, typeorm_1.Column)({ nullable: true }),
24
+ __metadata("design:type", Number)
25
+ ], WorkflowLevelMappingEntity.prototype, "workflow_id", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)({ nullable: true }),
28
+ __metadata("design:type", String)
29
+ ], WorkflowLevelMappingEntity.prototype, "mapped_level_id", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ nullable: true }),
32
+ __metadata("design:type", String)
33
+ ], WorkflowLevelMappingEntity.prototype, "mapped_level_type", void 0);
34
+ exports.WorkflowLevelMappingEntity = WorkflowLevelMappingEntity = __decorate([
35
+ (0, typeorm_1.Entity)({ name: 'cr_workflow_level_mapping' }),
36
+ __metadata("design:paramtypes", [])
37
+ ], WorkflowLevelMappingEntity);
38
+ //# sourceMappingURL=workflow-level-mapping.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-level-mapping.entity.js","sourceRoot":"","sources":["../../../../src/module/workflow/entity/workflow-level-mapping.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiE;AAG1D,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,gBAAe,CAAC;CAajB,CAAA;AAdY,gEAA0B;AAIrC;IADC,IAAA,gCAAsB,GAAE;;sDACd;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+DACP;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mEACH;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qEACD;qCAbf,0BAA0B;IADtC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC;;GACjC,0BAA0B,CActC"}
@@ -0,0 +1,23 @@
1
+ import { Repository, DataSource } from 'typeorm';
2
+ import { WorkflowLevelMappingEntity } from '../entity/workflow-level-mapping.entity';
3
+ import { StageGroup } from '../entity/stage-group.entity';
4
+ import { Stage } from '../entity/stage.entity';
5
+ import { UserData } from 'src/module/user/entity/user.entity';
6
+ export declare class StageMovementRepository {
7
+ private readonly workflowLevelMappingRepo;
8
+ private readonly stageGroupRepo;
9
+ private readonly stageRepo;
10
+ private readonly dataSource;
11
+ constructor(workflowLevelMappingRepo: Repository<WorkflowLevelMappingEntity>, stageGroupRepo: Repository<StageGroup>, stageRepo: Repository<Stage>, dataSource: DataSource);
12
+ getFirstStage({ loggedInUser, mapped_entity_type, mapped_entity_id, }: {
13
+ loggedInUser: any;
14
+ mapped_entity_type: string;
15
+ mapped_entity_id: string | number;
16
+ }): Promise<any | null>;
17
+ getNextStage(stageGroupId: number, currentStageId: number): Promise<any | null>;
18
+ getNextStageGroup(currentStageGroupId: number): Promise<any | null>;
19
+ getNextStageOrFirstOfNextGroup(stageGroupId: number, currentStageId: number): Promise<any | null>;
20
+ getAllActionByStageId(stageId: number): Promise<any[]>;
21
+ saveActionData(action: any, loggedInUser: UserData): Promise<any>;
22
+ saveTaskData(actionData: any, loggedInUser: UserData): Promise<any>;
23
+ }
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.StageMovementRepository = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const typeorm_1 = require("@nestjs/typeorm");
18
+ const typeorm_2 = require("typeorm");
19
+ const workflow_level_mapping_entity_1 = require("../entity/workflow-level-mapping.entity");
20
+ const stage_group_entity_1 = require("../entity/stage-group.entity");
21
+ const stage_entity_1 = require("../entity/stage.entity");
22
+ let StageMovementRepository = class StageMovementRepository {
23
+ constructor(workflowLevelMappingRepo, stageGroupRepo, stageRepo, dataSource) {
24
+ this.workflowLevelMappingRepo = workflowLevelMappingRepo;
25
+ this.stageGroupRepo = stageGroupRepo;
26
+ this.stageRepo = stageRepo;
27
+ this.dataSource = dataSource;
28
+ }
29
+ async getFirstStage({ loggedInUser, mapped_entity_type, mapped_entity_id, }) {
30
+ let workflowLevelMapping = await this.workflowLevelMappingRepo.findOne({
31
+ where: {
32
+ mapped_level_type: loggedInUser.level_type,
33
+ mapped_level_id: loggedInUser.level_id,
34
+ },
35
+ });
36
+ if (!workflowLevelMapping) {
37
+ workflowLevelMapping = await this.workflowLevelMappingRepo.findOne({
38
+ where: {
39
+ mapped_level_type: 'ORG',
40
+ mapped_level_id: loggedInUser.organization_id,
41
+ },
42
+ });
43
+ }
44
+ if (!workflowLevelMapping)
45
+ return null;
46
+ const stageGroup = await this.stageGroupRepo.findOne({
47
+ where: {
48
+ workflow_id: workflowLevelMapping.workflow_id,
49
+ },
50
+ order: { id: 'ASC' },
51
+ });
52
+ if (!stageGroup)
53
+ return null;
54
+ const firstStage = await this.stageRepo.findOne({
55
+ where: {
56
+ stage_group_id: stageGroup.id,
57
+ },
58
+ order: { id: 'ASC' },
59
+ });
60
+ if (!firstStage)
61
+ return null;
62
+ return {
63
+ mappingUsed: workflowLevelMapping,
64
+ stageGroup,
65
+ firstStage,
66
+ };
67
+ }
68
+ async getNextStage(stageGroupId, currentStageId) {
69
+ const allStages = await this.stageRepo.find({
70
+ where: { stage_group_id: stageGroupId },
71
+ order: { sequence: 'ASC' },
72
+ });
73
+ if (currentStageId === 0)
74
+ return allStages.length > 0 ? allStages[0] : null;
75
+ const currentStage = allStages.find((s) => s.id == currentStageId);
76
+ if (!currentStage)
77
+ return null;
78
+ const higherStages = allStages
79
+ .filter((s) => s.sequence > currentStage.sequence)
80
+ .sort((a, b) => a.sequence - b.sequence);
81
+ return higherStages.length > 0 ? higherStages[0] : null;
82
+ }
83
+ async getNextStageGroup(currentStageGroupId) {
84
+ const currentStageGroup = await this.stageGroupRepo.findOne({
85
+ where: { id: currentStageGroupId },
86
+ });
87
+ if (!currentStageGroup)
88
+ return null;
89
+ const workflowId = currentStageGroup.workflow_id;
90
+ const nextStageGroup = await this.stageGroupRepo.findOne({
91
+ where: {
92
+ workflow_id: workflowId,
93
+ sequence: (0, typeorm_2.MoreThan)(currentStageGroup.sequence),
94
+ },
95
+ order: { sequence: 'ASC' },
96
+ });
97
+ return nextStageGroup || null;
98
+ }
99
+ async getNextStageOrFirstOfNextGroup(stageGroupId, currentStageId) {
100
+ const nextStage = await this.getNextStage(stageGroupId, currentStageId);
101
+ if (nextStage)
102
+ return nextStage;
103
+ const nextStageGroup = await this.getNextStageGroup(stageGroupId);
104
+ if (!nextStageGroup)
105
+ return null;
106
+ const nextStageGroupFirstStage = await this.getNextStage(nextStageGroup.id, 0);
107
+ return nextStageGroupFirstStage || null;
108
+ }
109
+ async getAllActionByStageId(stageId) {
110
+ return this.dataSource.query(`SELECT * FROM cr_wf_stage_action_mapping WHERE stage_id = ?`, [stageId]);
111
+ }
112
+ async saveActionData(action, loggedInUser) {
113
+ if (action.length > 0) {
114
+ for (const act of action) {
115
+ await this.dataSource.query(`INSERT INTO cr_wf_action_data (stage_id, user_id, action_id) VALUES (?, ?, ?)`, [act.stage_id, loggedInUser.id, act.id]);
116
+ }
117
+ }
118
+ }
119
+ async saveTaskData(actionData, loggedInUser) {
120
+ if (actionData.length > 0) {
121
+ for (const action of actionData) {
122
+ await this.dataSource.query(`INSERT INTO cr_wf_task_data (action_id, user_id) VALUES (?, ?)`, [action.id, loggedInUser.id]);
123
+ }
124
+ }
125
+ }
126
+ };
127
+ exports.StageMovementRepository = StageMovementRepository;
128
+ exports.StageMovementRepository = StageMovementRepository = __decorate([
129
+ (0, common_1.Injectable)(),
130
+ __param(0, (0, typeorm_1.InjectRepository)(workflow_level_mapping_entity_1.WorkflowLevelMappingEntity)),
131
+ __param(1, (0, typeorm_1.InjectRepository)(stage_group_entity_1.StageGroup)),
132
+ __param(2, (0, typeorm_1.InjectRepository)(stage_entity_1.Stage)),
133
+ __metadata("design:paramtypes", [typeorm_2.Repository,
134
+ typeorm_2.Repository,
135
+ typeorm_2.Repository,
136
+ typeorm_2.DataSource])
137
+ ], StageMovementRepository);
138
+ //# sourceMappingURL=stage-movement.repository.js.map