rez_core 2.1.139 → 2.1.141
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/controller/comm-template.controller.d.ts +11 -0
- package/dist/module/workflow/controller/comm-template.controller.js +44 -0
- package/dist/module/workflow/controller/comm-template.controller.js.map +1 -0
- package/dist/module/workflow/controller/stage-group.controller.d.ts +8 -2
- package/dist/module/workflow/controller/stage-group.controller.js +17 -5
- package/dist/module/workflow/controller/stage-group.controller.js.map +1 -1
- package/dist/module/workflow/controller/stage.controller.d.ts +13 -0
- package/dist/module/workflow/controller/stage.controller.js +56 -0
- package/dist/module/workflow/controller/stage.controller.js.map +1 -0
- package/dist/module/workflow/controller/workflow.controller.d.ts +11 -1
- package/dist/module/workflow/controller/workflow.controller.js +13 -0
- package/dist/module/workflow/controller/workflow.controller.js.map +1 -1
- package/dist/module/workflow/entity/action.entity.d.ts +4 -1
- package/dist/module/workflow/entity/action.entity.js +20 -8
- package/dist/module/workflow/entity/action.entity.js.map +1 -1
- package/dist/module/workflow/entity/stage-group.entity.d.ts +1 -1
- package/dist/module/workflow/entity/stage-group.entity.js +1 -1
- package/dist/module/workflow/entity/stage-group.entity.js.map +1 -1
- package/dist/module/workflow/entity/stage.entity.d.ts +1 -2
- package/dist/module/workflow/entity/stage.entity.js +1 -5
- package/dist/module/workflow/entity/stage.entity.js.map +1 -1
- package/dist/module/workflow/repository/comm-template.repository.d.ts +7 -0
- package/dist/module/workflow/repository/comm-template.repository.js +39 -0
- package/dist/module/workflow/repository/comm-template.repository.js.map +1 -0
- package/dist/module/workflow/repository/stage-group.repository.d.ts +7 -0
- package/dist/module/workflow/repository/stage-group.repository.js +50 -0
- package/dist/module/workflow/repository/stage-group.repository.js.map +1 -0
- package/dist/module/workflow/repository/stage.repository.d.ts +7 -0
- package/dist/module/workflow/repository/stage.repository.js +50 -0
- package/dist/module/workflow/repository/stage.repository.js.map +1 -0
- package/dist/module/workflow/service/action.service.d.ts +3 -0
- package/dist/module/workflow/service/action.service.js +46 -7
- package/dist/module/workflow/service/action.service.js.map +1 -1
- package/dist/module/workflow/service/comm-template.service.d.ts +8 -2
- package/dist/module/workflow/service/comm-template.service.js +18 -3
- package/dist/module/workflow/service/comm-template.service.js.map +1 -1
- package/dist/module/workflow/service/stage-group.service.d.ts +11 -0
- package/dist/module/workflow/service/stage-group.service.js +36 -1
- package/dist/module/workflow/service/stage-group.service.js.map +1 -1
- package/dist/module/workflow/service/stage.service.d.ts +14 -4
- package/dist/module/workflow/service/stage.service.js +57 -13
- package/dist/module/workflow/service/stage.service.js.map +1 -1
- package/dist/module/workflow/service/workflow.service.d.ts +15 -1
- package/dist/module/workflow/service/workflow.service.js +43 -2
- package/dist/module/workflow/service/workflow.service.js.map +1 -1
- package/dist/module/workflow/workflow.module.js +17 -2
- package/dist/module/workflow/workflow.module.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/workflow/controller/comm-template.controller.ts +31 -0
- package/src/module/workflow/controller/stage-group.controller.ts +27 -4
- package/src/module/workflow/controller/stage.controller.ts +50 -0
- package/src/module/workflow/controller/workflow.controller.ts +7 -1
- package/src/module/workflow/entity/action.entity.ts +10 -1
- package/src/module/workflow/entity/stage-group.entity.ts +1 -1
- package/src/module/workflow/entity/stage.entity.ts +1 -4
- package/src/module/workflow/repository/comm-template.repository.ts +22 -0
- package/src/module/workflow/repository/stage-group.repository.ts +46 -0
- package/src/module/workflow/repository/stage.repository.ts +47 -0
- package/src/module/workflow/service/action.service.ts +106 -14
- package/src/module/workflow/service/comm-template.service.ts +21 -2
- package/src/module/workflow/service/stage-group.service.ts +66 -2
- package/src/module/workflow/service/stage.service.ts +104 -28
- package/src/module/workflow/service/workflow.service.ts +70 -0
- package/src/module/workflow/workflow.module.ts +17 -2
|
@@ -18,6 +18,15 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
18
18
|
super();
|
|
19
19
|
this.dataSource = dataSource;
|
|
20
20
|
}
|
|
21
|
+
async getEntityData(entityType, id, loggedInUser) {
|
|
22
|
+
const actionData = await super.getEntityData(entityType, id, loggedInUser);
|
|
23
|
+
if (!actionData) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const template = await this.dataSource.query(`SELECT template_code FROM cr_wf_action_template_mapping WHERE stg_act_mapping_id =
|
|
27
|
+
(SELECT id FROM cr_wf_stage_action_mapping WHERE action_id = ? AND entity_type = 'STGM')`, [actionData.id]);
|
|
28
|
+
return { ...actionData, template: template.map((t) => t.template_code) };
|
|
29
|
+
}
|
|
21
30
|
async createEntity(entityData, loggedInUser, manager, appcode) {
|
|
22
31
|
console.log('entityData', entityData);
|
|
23
32
|
let actionData = entityData;
|
|
@@ -31,13 +40,7 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
31
40
|
if (Array.isArray(actionData.template) && actionData.template.length > 0) {
|
|
32
41
|
const templates = actionData.template;
|
|
33
42
|
for (let i = 0; i < templates.length; i++) {
|
|
34
|
-
const
|
|
35
|
-
const templateResult = await this.dataSource.query(`SELECT code FROM cr_wf_comm_template WHERE id = ?`, [templateId]);
|
|
36
|
-
if (templateResult.length === 0) {
|
|
37
|
-
console.warn(`Template not found for id: ${templateId}`);
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
const templateCode = templateResult[0].code;
|
|
43
|
+
const templateCode = templates[i];
|
|
41
44
|
const actionTemplateMapping = {
|
|
42
45
|
stg_act_mapping_id: stageActionMappingData.id,
|
|
43
46
|
template_code: templateCode,
|
|
@@ -48,6 +51,42 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
48
51
|
}
|
|
49
52
|
return actionData;
|
|
50
53
|
}
|
|
54
|
+
async updateEntity(entityData, loggedInUser) {
|
|
55
|
+
console.log('entityData', entityData);
|
|
56
|
+
const { template, stage_id, ...actionData } = entityData;
|
|
57
|
+
let action = await super.updateEntity(actionData, loggedInUser);
|
|
58
|
+
if (!action) {
|
|
59
|
+
throw new Error('Action not found or could not be updated');
|
|
60
|
+
}
|
|
61
|
+
const stageMapID = await this.dataSource.query(`SELECT id FROM cr_wf_stage_action_mapping WHERE action_id = ? AND entity_type = 'STGM'`, [action.id]);
|
|
62
|
+
let stageActionMapping = {
|
|
63
|
+
action_id: action.id,
|
|
64
|
+
stage_id: stage_id,
|
|
65
|
+
entity_type: 'STGM',
|
|
66
|
+
id: stageMapID.length > 0 ? stageMapID[0].id : null,
|
|
67
|
+
};
|
|
68
|
+
let stageActionMappingData = await super.updateEntity(stageActionMapping, loggedInUser);
|
|
69
|
+
if (Array.isArray(template) && template.length > 0) {
|
|
70
|
+
for (let i = 0; i < template.length; i++) {
|
|
71
|
+
const templateCode = template[i];
|
|
72
|
+
await this.dataSource.query(`DELETE FROM cr_wf_action_template_mapping WHERE stg_act_mapping_id = ? AND template_code = ?`, [stageActionMappingData.id, templateCode]);
|
|
73
|
+
const actionTemplateMapping = {
|
|
74
|
+
stg_act_mapping_id: stageActionMappingData.id,
|
|
75
|
+
template_code: templateCode,
|
|
76
|
+
entity_type: 'ATMP',
|
|
77
|
+
};
|
|
78
|
+
await super.createEntity(actionTemplateMapping, loggedInUser);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return action;
|
|
82
|
+
}
|
|
83
|
+
async deleteEntity(entityType, id, loggedInUser) {
|
|
84
|
+
await this.dataSource.query(`DELETE FROM cr_wf_action_template_mapping WHERE stg_act_mapping_id IN (SELECT
|
|
85
|
+
id FROM cr_wf_stage_action_mapping WHERE action_id = ? AND entity_type = 'STGM')`, [id]);
|
|
86
|
+
await this.dataSource.query(`DELETE FROM cr_wf_stage_action_mapping WHERE action_id = ? AND entity_type ='STGM'`, [id]);
|
|
87
|
+
const deleteAction = await super.deleteEntity(entityType, id, loggedInUser);
|
|
88
|
+
return deleteAction;
|
|
89
|
+
}
|
|
51
90
|
};
|
|
52
91
|
exports.ActionService = ActionService;
|
|
53
92
|
exports.ActionService = ActionService = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,gGAAwF;AAExF,qCAAoD;
|
|
1
|
+
{"version":3,"file":"action.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,gGAAwF;AAExF,qCAAoD;AAI7C,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,+CAAiB;IAClD,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,UAAkB,EAClB,EAAU,EACV,YAAY;QAEZ,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;QAE3E,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAC1C;iGAC2F,EAC3F,CAAC,UAAU,CAAC,EAAE,CAAC,CAChB,CAAC;QAEF,OAAO,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,UAAsB,EACtB,YAA6B,EAC7B,OAA8B,EAC9B,OAAgB;QAEhB,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QAEtC,IAAI,UAAU,GAAG,UAAiB,CAAC;QAEnC,IAAI,MAAM,GAAG,MAAM,KAAK,CAAC,YAAY,CACnC,UAAU,EACV,YAAY,EAC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C,UAAU,CAAC,KAAK,CACzB;yFACmF,EACnF,CAAC,EAAE,CAAC,CACL,CAAC;QAEF,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CACzB,oFAAoF,EACpF,CAAC,EAAE,CAAC,CACL,CAAC;QAEF,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;QAE5E,OAAO,YAAY,CAAC;IACtB,CAAC;CACF,CAAA;AAnKY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAE8B,oBAAU;GADxC,aAAa,CAmKzB"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class CommTemplateService
|
|
1
|
+
import { CommTemplateRepository } from '../repository/comm-template.repository';
|
|
2
|
+
export declare class CommTemplateService {
|
|
3
|
+
private readonly commTemplateRepository;
|
|
4
|
+
constructor(commTemplateRepository: CommTemplateRepository);
|
|
5
|
+
getAllCommTemplate(entity_type: string, loggedInUser: any): Promise<{
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}[]>;
|
|
3
9
|
}
|
|
@@ -5,14 +5,29 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
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
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
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
|
+
};
|
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
12
|
exports.CommTemplateService = void 0;
|
|
10
13
|
const common_1 = require("@nestjs/common");
|
|
11
|
-
const
|
|
12
|
-
let CommTemplateService = class CommTemplateService
|
|
14
|
+
const comm_template_repository_1 = require("../repository/comm-template.repository");
|
|
15
|
+
let CommTemplateService = class CommTemplateService {
|
|
16
|
+
constructor(commTemplateRepository) {
|
|
17
|
+
this.commTemplateRepository = commTemplateRepository;
|
|
18
|
+
}
|
|
19
|
+
async getAllCommTemplate(entity_type, loggedInUser) {
|
|
20
|
+
const commTemplateData = await this.commTemplateRepository.getAllCommTemplate(entity_type, loggedInUser);
|
|
21
|
+
const response = commTemplateData.map((item) => ({
|
|
22
|
+
label: item.name,
|
|
23
|
+
value: item.code,
|
|
24
|
+
}));
|
|
25
|
+
return response;
|
|
26
|
+
}
|
|
13
27
|
};
|
|
14
28
|
exports.CommTemplateService = CommTemplateService;
|
|
15
29
|
exports.CommTemplateService = CommTemplateService = __decorate([
|
|
16
|
-
(0, common_1.Injectable)()
|
|
30
|
+
(0, common_1.Injectable)(),
|
|
31
|
+
__metadata("design:paramtypes", [comm_template_repository_1.CommTemplateRepository])
|
|
17
32
|
], CommTemplateService);
|
|
18
33
|
//# sourceMappingURL=comm-template.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comm-template.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/comm-template.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"comm-template.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/comm-template.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qFAAgF;AAGzE,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACmB,sBAA8C;QAA9C,2BAAsB,GAAtB,sBAAsB,CAAwB;IAC9D,CAAC;IAEJ,KAAK,CAAC,kBAAkB,CAAC,WAAmB,EAAE,YAAY;QACxD,MAAM,gBAAgB,GACpB,MAAM,IAAI,CAAC,sBAAsB,CAAC,kBAAkB,CAClD,WAAW,EACX,YAAY,CACb,CAAC;QAEJ,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC/C,KAAK,EAAE,IAAI,CAAC,IAAI;YAChB,KAAK,EAAE,IAAI,CAAC,IAAI;SACjB,CAAC,CAAC,CAAC;QAEJ,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAA;AAnBY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAGgC,iDAAsB;GAFtD,mBAAmB,CAmB/B"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
2
|
+
import { StageGroupRepository } from '../repository/stage-group.repository';
|
|
3
|
+
import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
4
|
+
import { UserData } from 'src/module/user/entity/user.entity';
|
|
5
|
+
import { StageService } from './stage.service';
|
|
2
6
|
export declare class StageGroupService extends EntityServiceImpl {
|
|
7
|
+
private readonly stageGroupRepository;
|
|
8
|
+
private readonly stageService;
|
|
9
|
+
constructor(stageGroupRepository: StageGroupRepository, stageService: StageService);
|
|
10
|
+
getAllStageGroup(workflow_id: number, level_id: string, level_type: string): Promise<import("../entity/stage-group.entity").StageGroup[]>;
|
|
11
|
+
updateEntity(entityData: BaseEntity, loggedInUser: UserData): Promise<any>;
|
|
12
|
+
getEntityData(entityType: string, id: number, loggedInUser?: UserData): Promise<BaseEntity | null>;
|
|
13
|
+
deleteEntity(entityType: string, id: number, loggedInUser: UserData): Promise<any>;
|
|
3
14
|
}
|
|
@@ -5,14 +5,49 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
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
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
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
|
+
};
|
|
8
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
15
|
exports.StageGroupService = void 0;
|
|
10
16
|
const common_1 = require("@nestjs/common");
|
|
11
17
|
const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
|
|
18
|
+
const stage_group_repository_1 = require("../repository/stage-group.repository");
|
|
19
|
+
const stage_service_1 = require("./stage.service");
|
|
12
20
|
let StageGroupService = class StageGroupService extends entity_service_impl_service_1.EntityServiceImpl {
|
|
21
|
+
constructor(stageGroupRepository, stageService) {
|
|
22
|
+
super();
|
|
23
|
+
this.stageGroupRepository = stageGroupRepository;
|
|
24
|
+
this.stageService = stageService;
|
|
25
|
+
}
|
|
26
|
+
async getAllStageGroup(workflow_id, level_id, level_type) {
|
|
27
|
+
return await this.stageGroupRepository.getAllStageGroup(workflow_id, level_id, level_type);
|
|
28
|
+
}
|
|
29
|
+
async updateEntity(entityData, loggedInUser) {
|
|
30
|
+
return await super.updateEntity(entityData, loggedInUser);
|
|
31
|
+
}
|
|
32
|
+
async getEntityData(entityType, id, loggedInUser) {
|
|
33
|
+
return await super.getEntityData(entityType, id, loggedInUser);
|
|
34
|
+
}
|
|
35
|
+
async deleteEntity(entityType, id, loggedInUser) {
|
|
36
|
+
const getAllStage = await this.stageService.getAllStage(id, loggedInUser.level_id, loggedInUser.level_type);
|
|
37
|
+
if (getAllStage.length > 0) {
|
|
38
|
+
for (const stage of getAllStage) {
|
|
39
|
+
await this.stageService.deleteEntity('STG', stage.id, loggedInUser);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const deleteStageGroup = await super.deleteEntity(entityType, id, loggedInUser);
|
|
43
|
+
return deleteStageGroup;
|
|
44
|
+
}
|
|
13
45
|
};
|
|
14
46
|
exports.StageGroupService = StageGroupService;
|
|
15
47
|
exports.StageGroupService = StageGroupService = __decorate([
|
|
16
|
-
(0, common_1.Injectable)()
|
|
48
|
+
(0, common_1.Injectable)(),
|
|
49
|
+
__param(1, (0, common_1.Inject)('StageService')),
|
|
50
|
+
__metadata("design:paramtypes", [stage_group_repository_1.StageGroupRepository,
|
|
51
|
+
stage_service_1.StageService])
|
|
17
52
|
], StageGroupService);
|
|
18
53
|
//# sourceMappingURL=stage-group.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage-group.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/stage-group.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stage-group.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/stage-group.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,gGAAwF;AACxF,iFAA4E;AAG5E,mDAA+C;AAGxC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,+CAAiB;IACtD,YACmB,oBAA0C,EAE1C,YAA0B;QAE3C,KAAK,EAAE,CAAC;QAJS,yBAAoB,GAApB,oBAAoB,CAAsB;QAE1C,iBAAY,GAAZ,YAAY,CAAc;IAG7C,CAAC;IACD,KAAK,CAAC,gBAAgB,CACpB,WAAmB,EACnB,QAAgB,EAChB,UAAkB;QAElB,OAAO,MAAM,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CACrD,WAAW,EACX,QAAQ,EACR,UAAU,CACX,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,UAAsB,EACtB,YAAsB;QAEtB,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,UAAkB,EAClB,EAAU,EACV,YAAuB;QAEvB,OAAO,MAAM,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,UAAkB,EAClB,EAAU,EACV,YAAsB;QAEtB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,CACrD,EAAE,EACF,YAAY,CAAC,QAAQ,EACrB,YAAY,CAAC,UAAU,CACxB,CAAC;QAEF,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;gBAChC,MAAM,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;QAED,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,YAAY,CAC/C,UAAU,EACV,EAAE,EACF,YAAY,CACb,CAAC;QAEF,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF,CAAA;AA5DY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;IAIR,WAAA,IAAA,eAAM,EAAC,cAAc,CAAC,CAAA;qCADgB,6CAAoB;QAE5B,4BAAY;GAJlC,iBAAiB,CA4D7B"}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActionService } from './action.service';
|
|
2
2
|
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
3
|
+
import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
3
4
|
import { UserData } from 'src/module/user/entity/user.entity';
|
|
4
|
-
import {
|
|
5
|
+
import { StageRepository } from '../repository/stage.repository';
|
|
6
|
+
import { DataSource } from 'typeorm';
|
|
7
|
+
import { StageGroupRepository } from '../repository/stage-group.repository';
|
|
5
8
|
export declare class StageService extends EntityServiceImpl {
|
|
9
|
+
private readonly stageRepository;
|
|
10
|
+
private readonly stageGroupRepository;
|
|
6
11
|
private readonly dataSource;
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
private readonly actionService;
|
|
13
|
+
constructor(stageRepository: StageRepository, stageGroupRepository: StageGroupRepository, dataSource: DataSource, actionService: ActionService);
|
|
14
|
+
getAllStage(stage_group_id: number, level_id: string, level_type: string): Promise<import("../entity/stage.entity").Stage[]>;
|
|
15
|
+
updateEntity(entityData: BaseEntity, loggedInUser: UserData): Promise<any>;
|
|
16
|
+
getEntityData(entityType: string, id: number, loggedInUser?: UserData): Promise<BaseEntity | null>;
|
|
17
|
+
deleteEntity(entityType: string, id: number, loggedInUser: UserData): Promise<any>;
|
|
18
|
+
getStagesWithGroupName(workflow_id: number, level_id: string, level_type: string): Promise<any>;
|
|
9
19
|
}
|
|
@@ -8,35 +8,79 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.StageService = void 0;
|
|
16
|
+
const action_service_1 = require("./action.service");
|
|
13
17
|
const common_1 = require("@nestjs/common");
|
|
14
18
|
const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
|
|
19
|
+
const stage_repository_1 = require("../repository/stage.repository");
|
|
15
20
|
const typeorm_1 = require("typeorm");
|
|
21
|
+
const stage_group_repository_1 = require("../repository/stage-group.repository");
|
|
16
22
|
let StageService = class StageService extends entity_service_impl_service_1.EntityServiceImpl {
|
|
17
|
-
constructor(dataSource) {
|
|
23
|
+
constructor(stageRepository, stageGroupRepository, dataSource, actionService) {
|
|
18
24
|
super();
|
|
25
|
+
this.stageRepository = stageRepository;
|
|
26
|
+
this.stageGroupRepository = stageGroupRepository;
|
|
19
27
|
this.dataSource = dataSource;
|
|
28
|
+
this.actionService = actionService;
|
|
29
|
+
}
|
|
30
|
+
async getAllStage(stage_group_id, level_id, level_type) {
|
|
31
|
+
return await this.stageRepository.getAllStage(stage_group_id, level_id, level_type);
|
|
32
|
+
}
|
|
33
|
+
async updateEntity(entityData, loggedInUser) {
|
|
34
|
+
return await super.updateEntity(entityData, loggedInUser);
|
|
35
|
+
}
|
|
36
|
+
async getEntityData(entityType, id, loggedInUser) {
|
|
37
|
+
return await super.getEntityData(entityType, id, loggedInUser);
|
|
20
38
|
}
|
|
21
|
-
async
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (result.length > 0) {
|
|
27
|
-
stageGroupName = result[0].name;
|
|
39
|
+
async deleteEntity(entityType, id, loggedInUser) {
|
|
40
|
+
const getAllStageAction = await this.dataSource.query(`SELECT action_id FROM cr_wf_stage_action_mapping WHERE stage_id = ? AND entity_type = 'STGM'`, [id]);
|
|
41
|
+
if (getAllStageAction.length > 0) {
|
|
42
|
+
for (const action of getAllStageAction) {
|
|
43
|
+
await this.actionService.deleteEntity('ACTN', action.action_id, loggedInUser);
|
|
28
44
|
}
|
|
29
45
|
}
|
|
30
|
-
|
|
31
|
-
|
|
46
|
+
const deleteStage = await super.deleteEntity(entityType, id, loggedInUser);
|
|
47
|
+
return deleteStage;
|
|
48
|
+
}
|
|
49
|
+
async getStagesWithGroupName(workflow_id, level_id, level_type) {
|
|
50
|
+
if (!workflow_id) {
|
|
51
|
+
throw new common_1.BadRequestException('workflow_id is required');
|
|
52
|
+
}
|
|
53
|
+
const stageGroups = await this.stageGroupRepository.getAllStageGroup(workflow_id, level_id, level_type);
|
|
54
|
+
const stageGroupIds = stageGroups.map((group) => group.id);
|
|
55
|
+
const groupNameMap = new Map(stageGroups.map((group) => [Number(group.id), group.name]));
|
|
56
|
+
const allStages = [];
|
|
57
|
+
for (const groupId of stageGroupIds) {
|
|
58
|
+
try {
|
|
59
|
+
const stages = await this.stageRepository.getAllStage(groupId, level_id, level_type);
|
|
60
|
+
allStages.push(...stages);
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
if (err instanceof common_1.NotFoundException) {
|
|
64
|
+
console.warn(`No stages for group ID ${groupId}`);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
throw err;
|
|
68
|
+
}
|
|
32
69
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
70
|
+
const result = allStages.map((stage) => ({
|
|
71
|
+
stage_id: stage.id,
|
|
72
|
+
full_name: `${groupNameMap.get(stage.stage_group_id)} - ${stage.name}`,
|
|
73
|
+
}));
|
|
74
|
+
return result;
|
|
35
75
|
}
|
|
36
76
|
};
|
|
37
77
|
exports.StageService = StageService;
|
|
38
78
|
exports.StageService = StageService = __decorate([
|
|
39
79
|
(0, common_1.Injectable)(),
|
|
40
|
-
|
|
80
|
+
__param(3, (0, common_1.Inject)('ActionService')),
|
|
81
|
+
__metadata("design:paramtypes", [stage_repository_1.StageRepository,
|
|
82
|
+
stage_group_repository_1.StageGroupRepository,
|
|
83
|
+
typeorm_1.DataSource,
|
|
84
|
+
action_service_1.ActionService])
|
|
41
85
|
], StageService);
|
|
42
86
|
//# sourceMappingURL=stage.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/stage.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stage.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/stage.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qDAAiD;AACjD,2CAKwB;AACxB,gGAAwF;AAGxF,qEAAiE;AACjE,qCAAqC;AACrC,iFAA4E;AAGrE,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,+CAAiB;IACjD,YACmB,eAAgC,EAChC,oBAA0C,EAC1C,UAAsB,EAEtB,aAA4B;QAE7C,KAAK,EAAE,CAAC;QANS,o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AM,CAAC;IAChB,CAAC;CACF,CAAA;AA3GY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAMR,WAAA,IAAA,eAAM,EAAC,eAAe,CAAC,CAAA;qCAHU,kCAAe;QACV,6CAAoB;QAC9B,oBAAU;QAEP,8BAAa;GANpC,YAAY,CA2GxB"}
|
|
@@ -5,15 +5,29 @@ import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
|
5
5
|
import { UserData } from 'src/module/user/entity/user.entity';
|
|
6
6
|
import { ListMasterService } from 'src/module/listmaster/service/list-master.service';
|
|
7
7
|
import { Workflow } from '../entity/workflow.entity';
|
|
8
|
+
import { StageGroupRepository } from '../repository/stage-group.repository';
|
|
9
|
+
import { StageGroupService } from './stage-group.service';
|
|
8
10
|
export declare class WorkflowService extends EntityServiceImpl {
|
|
9
11
|
private readonly dataSource;
|
|
10
12
|
private readonly workflowRepository;
|
|
11
13
|
private readonly listMasterService;
|
|
12
|
-
|
|
14
|
+
private readonly stateGroupService;
|
|
15
|
+
private readonly stageGroupRepository;
|
|
16
|
+
constructor(dataSource: DataSource, workflowRepository: WorkflowRepository, listMasterService: ListMasterService, stateGroupService: StageGroupService, stageGroupRepository: StageGroupRepository);
|
|
13
17
|
getAllWorkflows(entity_type: string, level_id: string, level_type: string): Promise<Workflow[]>;
|
|
14
18
|
getWorkflowById(id: number): Promise<any>;
|
|
15
19
|
updateEntity(entityData: BaseEntity, loggedInUser: UserData): Promise<any>;
|
|
16
20
|
deleteWorkflowById(id: number): Promise<{
|
|
17
21
|
message: string;
|
|
18
22
|
}>;
|
|
23
|
+
deleteEntity(entityType: string, id: number, loggedInUser: UserData): Promise<any>;
|
|
24
|
+
updateSequence(body: any[], loggedInUser: any): Promise<{
|
|
25
|
+
updated: number;
|
|
26
|
+
results: {
|
|
27
|
+
id: any;
|
|
28
|
+
success: boolean;
|
|
29
|
+
result?: any;
|
|
30
|
+
error?: string;
|
|
31
|
+
}[];
|
|
32
|
+
}>;
|
|
19
33
|
}
|
|
@@ -20,12 +20,16 @@ const workflow_repository_1 = require("../repository/workflow.repository");
|
|
|
20
20
|
const list_master_service_1 = require("../../listmaster/service/list-master.service");
|
|
21
21
|
const global_constant_1 = require("../../../constant/global.constant");
|
|
22
22
|
const workflow_entity_1 = require("../entity/workflow.entity");
|
|
23
|
+
const stage_group_repository_1 = require("../repository/stage-group.repository");
|
|
24
|
+
const stage_group_service_1 = require("./stage-group.service");
|
|
23
25
|
let WorkflowService = class WorkflowService extends entity_service_impl_service_1.EntityServiceImpl {
|
|
24
|
-
constructor(dataSource, workflowRepository, listMasterService) {
|
|
26
|
+
constructor(dataSource, workflowRepository, listMasterService, stateGroupService, stageGroupRepository) {
|
|
25
27
|
super();
|
|
26
28
|
this.dataSource = dataSource;
|
|
27
29
|
this.workflowRepository = workflowRepository;
|
|
28
30
|
this.listMasterService = listMasterService;
|
|
31
|
+
this.stateGroupService = stateGroupService;
|
|
32
|
+
this.stageGroupRepository = stageGroupRepository;
|
|
29
33
|
}
|
|
30
34
|
async getAllWorkflows(entity_type, level_id, level_type) {
|
|
31
35
|
return this.workflowRepository.getAllWorkflowsByFilters(entity_type, level_id, level_type);
|
|
@@ -68,13 +72,50 @@ let WorkflowService = class WorkflowService extends entity_service_impl_service_
|
|
|
68
72
|
async deleteWorkflowById(id) {
|
|
69
73
|
return this.workflowRepository.deleteWorkflowById(id);
|
|
70
74
|
}
|
|
75
|
+
async deleteEntity(entityType, id, loggedInUser) {
|
|
76
|
+
const getAllStage = await this.stageGroupRepository.getAllStageGroup(id, loggedInUser.level_id, loggedInUser.level_type);
|
|
77
|
+
if (getAllStage.length > 0) {
|
|
78
|
+
for (const stage of getAllStage) {
|
|
79
|
+
await this.stateGroupService.deleteEntity('STGP', stage.id, loggedInUser);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const deleteWorkflow = await super.deleteEntity(entityType, id, loggedInUser);
|
|
83
|
+
return deleteWorkflow;
|
|
84
|
+
}
|
|
85
|
+
async updateSequence(body, loggedInUser) {
|
|
86
|
+
if (!Array.isArray(body) || body.length === 0) {
|
|
87
|
+
throw new common_1.BadRequestException('Invalid input. Expected a non-empty array.');
|
|
88
|
+
}
|
|
89
|
+
const results = [];
|
|
90
|
+
for (const item of body) {
|
|
91
|
+
if (!item.id || item.sequence === undefined) {
|
|
92
|
+
results.push({
|
|
93
|
+
id: item.id || null,
|
|
94
|
+
success: false,
|
|
95
|
+
error: 'Missing id or sequence',
|
|
96
|
+
});
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
const result = await super.updateEntity(item, loggedInUser);
|
|
101
|
+
results.push({ id: item.id, success: true, result });
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
results.push({ id: item.id, success: false, error: err.message });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return { updated: results.filter((r) => r.success).length, results };
|
|
108
|
+
}
|
|
71
109
|
};
|
|
72
110
|
exports.WorkflowService = WorkflowService;
|
|
73
111
|
exports.WorkflowService = WorkflowService = __decorate([
|
|
74
112
|
(0, common_1.Injectable)(),
|
|
75
113
|
__param(2, (0, common_1.Inject)('ListMasterService')),
|
|
114
|
+
__param(3, (0, common_1.Inject)('StageGroupService')),
|
|
76
115
|
__metadata("design:paramtypes", [typeorm_1.DataSource,
|
|
77
116
|
workflow_repository_1.WorkflowRepository,
|
|
78
|
-
list_master_service_1.ListMasterService
|
|
117
|
+
list_master_service_1.ListMasterService,
|
|
118
|
+
stage_group_service_1.StageGroupService,
|
|
119
|
+
stage_group_repository_1.StageGroupRepository])
|
|
79
120
|
], WorkflowService);
|
|
80
121
|
//# sourceMappingURL=workflow.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/workflow.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyE;AACzE,gGAAwF;AACxF,qCAAyC;AACzC,2EAAuE;AAGvE,sFAAsF;AACtF,uEAAyE;AACzE,+DAAqD;
|
|
1
|
+
{"version":3,"file":"workflow.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/workflow.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyE;AACzE,gGAAwF;AACxF,qCAAyC;AACzC,2EAAuE;AAGvE,sFAAsF;AACtF,uEAAyE;AACzE,+DAAqD;AAErD,iFAA4E;AAC5E,+DAA0D;AAGnD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,+CAAiB;IACpD,YACmB,UAAsB,EACtB,kBAAsC,EAEtC,iBAAoC,EAEpC,iBAAoC,EACpC,oBAA0C;QAE3D,KAAK,EAAE,CAAC;QARS,eAAU,GAAV,UAAU,CAAY;QACtB,uBAAkB,GAAlB,kBAAkB,CAAoB;QAEtC,sBAAiB,GAAjB,iBAAiB,CAAmB;QAEpC,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,yBAAoB,GAApB,oBAAoB,CAAsB;IAG7D,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,WAAmB,EACnB,QAAgB,EAChB,UAAkB;QAElB,OAAO,IAAI,CAAC,kBAAkB,CAAC,wBAAwB,CACrD,WAAW,EACX,QAAQ,EACR,UAAU,CACX,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAU;QAC9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CACxC,wCAAwC,EACxC,CAAC,EAAE,CAAC,CACL,CAAC;QACF,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC3B,CAAC;IAGD,KAAK,CAAC,YAAY,CAChB,UAAsB,EACtB,YAAsB;QAEtB,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CACpE,iCAAe,EACf,YAAY,EAAE,eAAe,IAAI,CAAC,CACnC,CAAC;QAEF,MAAM,UAAU,G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C,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YACpE,CAAC;QACH,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;IACvE,CAAC;CACF,CAAA;AAxJY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,eAAM,EAAC,mBAAmB,CAAC,CAAA;IAE3B,WAAA,IAAA,eAAM,EAAC,mBAAmB,CAAC,CAAA;qCAJC,oBAAU;QACF,wCAAkB;QAEnB,uCAAiB;QAEjB,uCAAiB;QACd,6CAAoB;GARlD,eAAe,CAwJ3B"}
|
|
@@ -25,13 +25,19 @@ const stage_service_1 = require("./service/stage.service");
|
|
|
25
25
|
const stage_group_service_1 = require("./service/stage-group.service");
|
|
26
26
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
27
27
|
const entity_module_1 = require("../meta/entity.module");
|
|
28
|
-
const action_entity_1 = require("./entity/action.entity");
|
|
29
28
|
const workflow_list_master_service_1 = require("./service/workflow-list-master.service");
|
|
30
29
|
const workflow_list_master_controller_1 = require("./controller/workflow-list-master.controller");
|
|
31
30
|
const action_template_mapping_controller_1 = require("./controller/action-template-mapping.controller");
|
|
32
31
|
const workflow_controller_1 = require("./controller/workflow.controller");
|
|
33
32
|
const workflow_repository_1 = require("./repository/workflow.repository");
|
|
34
33
|
const listmaster_module_1 = require("../listmaster/listmaster.module");
|
|
34
|
+
const comm_template_controller_1 = require("./controller/comm-template.controller");
|
|
35
|
+
const comm_template_repository_1 = require("./repository/comm-template.repository");
|
|
36
|
+
const action_entity_1 = require("./entity/action.entity");
|
|
37
|
+
const stage_group_repository_1 = require("./repository/stage-group.repository");
|
|
38
|
+
const stage_group_controller_1 = require("./controller/stage-group.controller");
|
|
39
|
+
const stage_controller_1 = require("./controller/stage.controller");
|
|
40
|
+
const stage_repository_1 = require("./repository/stage.repository");
|
|
35
41
|
let WorkflowModule = class WorkflowModule {
|
|
36
42
|
};
|
|
37
43
|
exports.WorkflowModule = WorkflowModule;
|
|
@@ -40,7 +46,7 @@ exports.WorkflowModule = WorkflowModule = __decorate([
|
|
|
40
46
|
imports: [
|
|
41
47
|
typeorm_1.TypeOrmModule.forFeature([
|
|
42
48
|
workflow_entity_1.Workflow,
|
|
43
|
-
action_entity_1.
|
|
49
|
+
action_entity_1.ActionEntity,
|
|
44
50
|
action_category_entity_1.ActionCategory,
|
|
45
51
|
stage_entity_1.Stage,
|
|
46
52
|
stage_group_entity_1.StageGroup,
|
|
@@ -65,6 +71,10 @@ exports.WorkflowModule = WorkflowModule = __decorate([
|
|
|
65
71
|
workflow_list_master_service_1.WorkflowListMasterService,
|
|
66
72
|
action_template_mapping_service_1.ActionTemplateMappingService,
|
|
67
73
|
workflow_repository_1.WorkflowRepository,
|
|
74
|
+
comm_template_service_1.CommTemplateService,
|
|
75
|
+
comm_template_repository_1.CommTemplateRepository,
|
|
76
|
+
stage_group_repository_1.StageGroupRepository,
|
|
77
|
+
stage_repository_1.StageRepository,
|
|
68
78
|
],
|
|
69
79
|
exports: [
|
|
70
80
|
'ActionCategoryService',
|
|
@@ -74,11 +84,16 @@ exports.WorkflowModule = WorkflowModule = __decorate([
|
|
|
74
84
|
'StageService',
|
|
75
85
|
'StageGroupService',
|
|
76
86
|
workflow_repository_1.WorkflowRepository,
|
|
87
|
+
stage_group_repository_1.StageGroupRepository,
|
|
88
|
+
stage_repository_1.StageRepository,
|
|
77
89
|
],
|
|
78
90
|
controllers: [
|
|
79
91
|
workflow_list_master_controller_1.WorkflowListMasterController,
|
|
80
92
|
action_template_mapping_controller_1.ActionTemplateMappingController,
|
|
81
93
|
workflow_controller_1.WorkflowController,
|
|
94
|
+
comm_template_controller_1.CommTemplateController,
|
|
95
|
+
stage_group_controller_1.StageGroupController,
|
|
96
|
+
stage_controller_1.StageController,
|
|
82
97
|
],
|
|
83
98
|
})
|
|
84
99
|
], WorkflowModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.module.js","sourceRoot":"","sources":["../../../src/module/workflow/workflow.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,8DAAoD;AACpD,iEAA6D;AAC7D,oEAAyD;AACzD,wDAA8C;AAC9C,4EAAiE;AACjE,wEAA6D;AAC7D,4FAAgF;AAChF,sFAA0E;AAC1E,+EAA0E;AAC1E,2EAAsE;AACtE,yFAAmF;AACnF,+FAAyF;AACzF,6DAAyD;AACzD,2DAAuD;AACvD,uEAAkE;AAClE,6CAAgD;AAChD,yDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"workflow.module.js","sourceRoot":"","sources":["../../../src/module/workflow/workflow.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,8DAAoD;AACpD,iEAA6D;AAC7D,oEAAyD;AACzD,wDAA8C;AAC9C,4EAAiE;AACjE,wEAA6D;AAC7D,4FAAgF;AAChF,sFAA0E;AAC1E,+EAA0E;AAC1E,2EAAsE;AACtE,yFAAmF;AACnF,+FAAyF;AACzF,6DAAyD;AACzD,2DAAuD;AACvD,uEAAkE;AAClE,6CAAgD;AAChD,yDAAqD;AACrD,yFAAmF;AACnF,kGAA4F;AAC5F,wGAAkG;AAClG,0EAAsE;AACtE,0EAAsE;AAEtE,uEAAmE;AACnE,oFAA+E;AAC/E,oFAA+E;AAC/E,0DAAsD;AACtD,gFAA2E;AAC3E,gFAA2E;AAC3E,oEAAgE;AAChE,oEAAgE;AAwDzD,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAtD1B,IAAA,eAAM,EAAC;QACN,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