rez_core 2.1.140 → 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/stage.controller.d.ts +3 -0
- package/dist/module/workflow/controller/stage.controller.js +13 -0
- package/dist/module/workflow/controller/stage.controller.js.map +1 -1
- package/dist/module/workflow/entity/workflow.entity.d.ts +0 -1
- package/dist/module/workflow/entity/workflow.entity.js +0 -4
- package/dist/module/workflow/entity/workflow.entity.js.map +1 -1
- package/dist/module/workflow/service/action.service.d.ts +1 -0
- package/dist/module/workflow/service/action.service.js +7 -0
- package/dist/module/workflow/service/action.service.js.map +1 -1
- package/dist/module/workflow/service/stage-group.service.d.ts +4 -1
- package/dist/module/workflow/service/stage-group.service.js +19 -2
- package/dist/module/workflow/service/stage-group.service.js.map +1 -1
- package/dist/module/workflow/service/stage.service.d.ts +9 -1
- package/dist/module/workflow/service/stage.service.js +52 -2
- package/dist/module/workflow/service/stage.service.js.map +1 -1
- package/dist/module/workflow/service/workflow.service.d.ts +6 -1
- package/dist/module/workflow/service/workflow.service.js +19 -2
- package/dist/module/workflow/service/workflow.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/workflow/controller/stage.controller.ts +17 -0
- package/src/module/workflow/entity/workflow.entity.ts +0 -3
- package/src/module/workflow/repository/stage-group.repository.ts +1 -1
- package/src/module/workflow/repository/stage.repository.ts +1 -1
- package/src/module/workflow/service/action.service.ts +21 -0
- package/src/module/workflow/service/stage-group.service.ts +32 -1
- package/src/module/workflow/service/stage.service.ts +87 -2
- package/src/module/workflow/service/workflow.service.ts +36 -0
|
@@ -24,6 +24,10 @@ let StageController = class StageController {
|
|
|
24
24
|
const { level_id, level_type } = req.user.userData;
|
|
25
25
|
return this.stageGroupService.getAllStage(body.stage_group_id, level_id, level_type);
|
|
26
26
|
}
|
|
27
|
+
async getStagesWithGroupName(workflow_id, req) {
|
|
28
|
+
const { level_id, level_type } = req.user.userData;
|
|
29
|
+
return this.stageGroupService.getStagesWithGroupName(workflow_id, level_id, level_type);
|
|
30
|
+
}
|
|
27
31
|
};
|
|
28
32
|
exports.StageController = StageController;
|
|
29
33
|
__decorate([
|
|
@@ -34,6 +38,15 @@ __decorate([
|
|
|
34
38
|
__metadata("design:paramtypes", [Object, Object]),
|
|
35
39
|
__metadata("design:returntype", Promise)
|
|
36
40
|
], StageController.prototype, "getAllStage", null);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, common_1.Post)('/getStagesWithGroupName'),
|
|
43
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
44
|
+
__param(0, (0, common_1.Body)('workflow_id')),
|
|
45
|
+
__param(1, (0, common_1.Req)()),
|
|
46
|
+
__metadata("design:type", Function),
|
|
47
|
+
__metadata("design:paramtypes", [Number, Object]),
|
|
48
|
+
__metadata("design:returntype", Promise)
|
|
49
|
+
], StageController.prototype, "getStagesWithGroupName", null);
|
|
37
50
|
exports.StageController = StageController = __decorate([
|
|
38
51
|
(0, common_1.Controller)('/stage'),
|
|
39
52
|
(0, common_1.UseGuards)(jwt_guard_1.JwtAuthGuard),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.controller.js","sourceRoot":"","sources":["../../../../src/module/workflow/controller/stage.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"stage.controller.js","sourceRoot":"","sources":["../../../../src/module/workflow/controller/stage.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,2DAAgE;AAChE,4DAAwD;AAKjD,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAEmB,iBAA+B;QAA/B,sBAAiB,GAAjB,iBAAiB,CAAc;IAC/C,CAAC;IAGE,AAAN,KAAK,CAAC,WAAW,CACR,GAA4B,EAC3B,IAAgC;QAExC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QACnD,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CACvC,IAAI,CAAC,cAAc,EACnB,QAAQ,EACR,UAAU,CACX,CAAC;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,sBAAsB,CACL,WAAmB,EACjC,GAA4B;QAEnC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QACnD,OAAO,IAAI,CAAC,iBAAiB,CAAC,sBAAsB,CAClD,WAAW,EACX,QAAQ,EACR,UAAU,CACX,CAAC;IACJ,CAAC;CACF,CAAA;AAhCY,0CAAe;AAOpB;IADL,IAAA,aAAI,EAAC,cAAc,CAAC;IAElB,WAAA,IAAA,YAAG,GAAE,CAAA;IACL,WAAA,IAAA,aAAI,GAAE,CAAA;;;;kDAQR;AAIK;IAFL,IAAA,aAAI,EAAC,yBAAyB,CAAC;IAC/B,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;IAErB,WAAA,IAAA,aAAI,EAAC,aAAa,CAAC,CAAA;IACnB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;6DAQP;0BA/BU,eAAe;IAF3B,IAAA,mBAAU,EAAC,QAAQ,CAAC;IACpB,IAAA,kBAAS,EAAC,wBAAY,CAAC;IAGnB,WAAA,IAAA,eAAM,EAAC,cAAc,CAAC,CAAA;qCACa,4BAAY;GAHvC,eAAe,CAgC3B"}
|
|
@@ -32,10 +32,6 @@ __decorate([
|
|
|
32
32
|
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
33
33
|
__metadata("design:type", Boolean)
|
|
34
34
|
], Workflow.prototype, "is_factory", void 0);
|
|
35
|
-
__decorate([
|
|
36
|
-
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
37
|
-
__metadata("design:type", Number)
|
|
38
|
-
], Workflow.prototype, "sequence", void 0);
|
|
39
35
|
exports.Workflow = Workflow = __decorate([
|
|
40
36
|
(0, typeorm_1.Entity)({ name: 'cr_workflow' }),
|
|
41
37
|
__metadata("design:paramtypes", [])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.entity.js","sourceRoot":"","sources":["../../../../src/module/workflow/entity/workflow.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAAwD;AACxD,6EAAuE;AACvE,qCAAyC;AAGlC,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,+BAAU;IACtC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,0BAAQ,CAAC;IAC9B,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow.entity.js","sourceRoot":"","sources":["../../../../src/module/workflow/entity/workflow.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAAwD;AACxD,6EAAuE;AACvE,qCAAyC;AAGlC,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,+BAAU;IACtC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,0BAAQ,CAAC;IAC9B,CAAC;CAUF,CAAA;AAdY,4BAAQ;AAOnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACjB;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACxB;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACxB;mBAbT,QAAQ;IADpB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;GACnB,QAAQ,CAcpB"}
|
|
@@ -8,4 +8,5 @@ export declare class ActionService extends EntityServiceImpl {
|
|
|
8
8
|
getEntityData(entityType: string, id: number, loggedInUser: any): Promise<any>;
|
|
9
9
|
createEntity(entityData: BaseEntity, loggedInUser: UserData | null, manager?: EntityManager | null, appcode?: string): Promise<any>;
|
|
10
10
|
updateEntity(entityData: BaseEntity, loggedInUser: UserData): Promise<any>;
|
|
11
|
+
deleteEntity(entityType: string, id: number, loggedInUser: UserData): Promise<any>;
|
|
11
12
|
}
|
|
@@ -80,6 +80,13 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
80
80
|
}
|
|
81
81
|
return action;
|
|
82
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
|
+
}
|
|
83
90
|
};
|
|
84
91
|
exports.ActionService = ActionService;
|
|
85
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;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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AAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACzC,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAGjC,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CACzB,8FAA8F,EAC9F,CAAC,sBAAsB,CAAC,EAAE,EAAE,YAAY,CAAC,CAC1C,CAAC;gBAGF,MAAM,qBAAqB,GAAG;oBAC5B,kBAAkB,EAAE,sBAAsB,CAAC,EAAE;oBAC7C,aAAa,EAAE,YAAY;oBAC3B,WAAW,EAAE,MAAM;iBACb,CAAC;gBAET,MAAM,KAAK,CAAC,YAAY,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;
|
|
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,CA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GAAG;oBAC5B,kBAAkB,EAAE,sBAAsB,CAAC,EAAE;oBAC7C,aAAa,EAAE,YAAY;oBAC3B,WAAW,EAAE,MAAM;iBACb,CAAC;gBAET,MAAM,KAAK,CAAC,YAAY,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,UAAkB,EAClB,EAAU,EACV,YAAsB;QAEtB,MAAM,IAAI,CAAC,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"}
|
|
@@ -2,10 +2,13 @@ import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.s
|
|
|
2
2
|
import { StageGroupRepository } from '../repository/stage-group.repository';
|
|
3
3
|
import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
4
4
|
import { UserData } from 'src/module/user/entity/user.entity';
|
|
5
|
+
import { StageService } from './stage.service';
|
|
5
6
|
export declare class StageGroupService extends EntityServiceImpl {
|
|
6
7
|
private readonly stageGroupRepository;
|
|
7
|
-
|
|
8
|
+
private readonly stageService;
|
|
9
|
+
constructor(stageGroupRepository: StageGroupRepository, stageService: StageService);
|
|
8
10
|
getAllStageGroup(workflow_id: number, level_id: string, level_type: string): Promise<import("../entity/stage-group.entity").StageGroup[]>;
|
|
9
11
|
updateEntity(entityData: BaseEntity, loggedInUser: UserData): Promise<any>;
|
|
10
12
|
getEntityData(entityType: string, id: number, loggedInUser?: UserData): Promise<BaseEntity | null>;
|
|
13
|
+
deleteEntity(entityType: string, id: number, loggedInUser: UserData): Promise<any>;
|
|
11
14
|
}
|
|
@@ -8,15 +8,20 @@ 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.StageGroupService = void 0;
|
|
13
16
|
const common_1 = require("@nestjs/common");
|
|
14
17
|
const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
|
|
15
18
|
const stage_group_repository_1 = require("../repository/stage-group.repository");
|
|
19
|
+
const stage_service_1 = require("./stage.service");
|
|
16
20
|
let StageGroupService = class StageGroupService extends entity_service_impl_service_1.EntityServiceImpl {
|
|
17
|
-
constructor(stageGroupRepository) {
|
|
21
|
+
constructor(stageGroupRepository, stageService) {
|
|
18
22
|
super();
|
|
19
23
|
this.stageGroupRepository = stageGroupRepository;
|
|
24
|
+
this.stageService = stageService;
|
|
20
25
|
}
|
|
21
26
|
async getAllStageGroup(workflow_id, level_id, level_type) {
|
|
22
27
|
return await this.stageGroupRepository.getAllStageGroup(workflow_id, level_id, level_type);
|
|
@@ -27,10 +32,22 @@ let StageGroupService = class StageGroupService extends entity_service_impl_serv
|
|
|
27
32
|
async getEntityData(entityType, id, loggedInUser) {
|
|
28
33
|
return await super.getEntityData(entityType, id, loggedInUser);
|
|
29
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
|
+
}
|
|
30
45
|
};
|
|
31
46
|
exports.StageGroupService = StageGroupService;
|
|
32
47
|
exports.StageGroupService = StageGroupService = __decorate([
|
|
33
48
|
(0, common_1.Injectable)(),
|
|
34
|
-
|
|
49
|
+
__param(1, (0, common_1.Inject)('StageService')),
|
|
50
|
+
__metadata("design:paramtypes", [stage_group_repository_1.StageGroupRepository,
|
|
51
|
+
stage_service_1.StageService])
|
|
35
52
|
], StageGroupService);
|
|
36
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,11 +1,19 @@
|
|
|
1
|
+
import { ActionService } from './action.service';
|
|
1
2
|
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
2
3
|
import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
3
4
|
import { UserData } from 'src/module/user/entity/user.entity';
|
|
4
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 {
|
|
6
9
|
private readonly stageRepository;
|
|
7
|
-
|
|
10
|
+
private readonly stageGroupRepository;
|
|
11
|
+
private readonly dataSource;
|
|
12
|
+
private readonly actionService;
|
|
13
|
+
constructor(stageRepository: StageRepository, stageGroupRepository: StageGroupRepository, dataSource: DataSource, actionService: ActionService);
|
|
8
14
|
getAllStage(stage_group_id: number, level_id: string, level_type: string): Promise<import("../entity/stage.entity").Stage[]>;
|
|
9
15
|
updateEntity(entityData: BaseEntity, loggedInUser: UserData): Promise<any>;
|
|
10
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>;
|
|
11
19
|
}
|
|
@@ -8,15 +8,24 @@ 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");
|
|
15
19
|
const stage_repository_1 = require("../repository/stage.repository");
|
|
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(stageRepository) {
|
|
23
|
+
constructor(stageRepository, stageGroupRepository, dataSource, actionService) {
|
|
18
24
|
super();
|
|
19
25
|
this.stageRepository = stageRepository;
|
|
26
|
+
this.stageGroupRepository = stageGroupRepository;
|
|
27
|
+
this.dataSource = dataSource;
|
|
28
|
+
this.actionService = actionService;
|
|
20
29
|
}
|
|
21
30
|
async getAllStage(stage_group_id, level_id, level_type) {
|
|
22
31
|
return await this.stageRepository.getAllStage(stage_group_id, level_id, level_type);
|
|
@@ -27,10 +36,51 @@ let StageService = class StageService extends entity_service_impl_service_1.Enti
|
|
|
27
36
|
async getEntityData(entityType, id, loggedInUser) {
|
|
28
37
|
return await super.getEntityData(entityType, id, loggedInUser);
|
|
29
38
|
}
|
|
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);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
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
|
+
}
|
|
69
|
+
}
|
|
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;
|
|
75
|
+
}
|
|
30
76
|
};
|
|
31
77
|
exports.StageService = StageService;
|
|
32
78
|
exports.StageService = StageService = __decorate([
|
|
33
79
|
(0, common_1.Injectable)(),
|
|
34
|
-
|
|
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])
|
|
35
85
|
], StageService);
|
|
36
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,oBAAe,GAAf,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ChB,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,17 +5,22 @@ 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>;
|
|
19
24
|
updateSequence(body: any[], loggedInUser: any): Promise<{
|
|
20
25
|
updated: number;
|
|
21
26
|
results: {
|
|
@@ -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,6 +72,16 @@ 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
|
+
}
|
|
71
85
|
async updateSequence(body, loggedInUser) {
|
|
72
86
|
if (!Array.isArray(body) || body.length === 0) {
|
|
73
87
|
throw new common_1.BadRequestException('Invalid input. Expected a non-empty array.');
|
|
@@ -97,8 +111,11 @@ exports.WorkflowService = WorkflowService;
|
|
|
97
111
|
exports.WorkflowService = WorkflowService = __decorate([
|
|
98
112
|
(0, common_1.Injectable)(),
|
|
99
113
|
__param(2, (0, common_1.Inject)('ListMasterService')),
|
|
114
|
+
__param(3, (0, common_1.Inject)('StageGroupService')),
|
|
100
115
|
__metadata("design:paramtypes", [typeorm_1.DataSource,
|
|
101
116
|
workflow_repository_1.WorkflowRepository,
|
|
102
|
-
list_master_service_1.ListMasterService
|
|
117
|
+
list_master_service_1.ListMasterService,
|
|
118
|
+
stage_group_service_1.StageGroupService,
|
|
119
|
+
stage_group_repository_1.StageGroupRepository])
|
|
103
120
|
], WorkflowService);
|
|
104
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,CAAm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