rez_core 2.1.145 → 2.1.148
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/layout_preference/controller/layout_preference.controller.js +2 -2
- package/dist/module/layout_preference/controller/layout_preference.controller.js.map +1 -1
- package/dist/module/layout_preference/entity/layout_preference.entity.d.ts +2 -0
- package/dist/module/layout_preference/entity/layout_preference.entity.js +13 -0
- package/dist/module/layout_preference/entity/layout_preference.entity.js.map +1 -1
- package/dist/module/layout_preference/repository/layout_preference.repository.d.ts +1 -1
- package/dist/module/layout_preference/repository/layout_preference.repository.js +4 -2
- package/dist/module/layout_preference/repository/layout_preference.repository.js.map +1 -1
- package/dist/module/layout_preference/service/layout_preference.service.d.ts +1 -1
- package/dist/module/layout_preference/service/layout_preference.service.js +10 -4
- package/dist/module/layout_preference/service/layout_preference.service.js.map +1 -1
- package/dist/module/meta/controller/media.controller.d.ts +1 -1
- package/dist/module/meta/controller/media.controller.js +1 -1
- package/dist/module/meta/controller/media.controller.js.map +1 -1
- package/dist/module/workflow/controller/action-category.controller.d.ts +8 -0
- package/dist/module/workflow/controller/action-category.controller.js +45 -0
- package/dist/module/workflow/controller/action-category.controller.js.map +1 -0
- package/dist/module/workflow/controller/action.controller.d.ts +1 -1
- package/dist/module/workflow/controller/action.controller.js +3 -3
- package/dist/module/workflow/controller/action.controller.js.map +1 -1
- package/dist/module/workflow/controller/comm-template.controller.d.ts +2 -2
- package/dist/module/workflow/controller/comm-template.controller.js +4 -4
- package/dist/module/workflow/controller/comm-template.controller.js.map +1 -1
- package/dist/module/workflow/controller/workflow-meta.controller.d.ts +9 -0
- package/dist/module/workflow/controller/workflow-meta.controller.js +63 -0
- package/dist/module/workflow/controller/workflow-meta.controller.js.map +1 -0
- package/dist/module/workflow/controller/workflow.controller.d.ts +9 -1
- package/dist/module/workflow/controller/workflow.controller.js +17 -2
- package/dist/module/workflow/controller/workflow.controller.js.map +1 -1
- package/dist/module/workflow/entity/action-category.entity.d.ts +1 -0
- package/dist/module/workflow/entity/action-category.entity.js +4 -0
- package/dist/module/workflow/entity/action-category.entity.js.map +1 -1
- package/dist/module/workflow/entity/action.entity.d.ts +2 -2
- package/dist/module/workflow/entity/action.entity.js +3 -3
- package/dist/module/workflow/entity/action.entity.js.map +1 -1
- package/dist/module/workflow/entity/comm-template.entity.d.ts +5 -0
- package/dist/module/workflow/entity/comm-template.entity.js +21 -1
- package/dist/module/workflow/entity/comm-template.entity.js.map +1 -1
- package/dist/module/workflow/entity/stage-movement-data.entity.d.ts +2 -0
- package/dist/module/workflow/entity/stage-movement-data.entity.js +8 -0
- package/dist/module/workflow/entity/stage-movement-data.entity.js.map +1 -1
- package/dist/module/workflow/entity/template-attach-mapper.entity.d.ts +11 -0
- package/dist/module/workflow/entity/template-attach-mapper.entity.js +54 -0
- package/dist/module/workflow/entity/template-attach-mapper.entity.js.map +1 -0
- package/dist/module/workflow/repository/comm-template.repository.d.ts +8 -2
- package/dist/module/workflow/repository/comm-template.repository.js +37 -6
- package/dist/module/workflow/repository/comm-template.repository.js.map +1 -1
- package/dist/module/workflow/service/action-category.service.d.ts +5 -0
- package/dist/module/workflow/service/action-category.service.js +23 -1
- package/dist/module/workflow/service/action-category.service.js.map +1 -1
- package/dist/module/workflow/service/action.service.d.ts +1 -1
- package/dist/module/workflow/service/action.service.js +78 -26
- package/dist/module/workflow/service/action.service.js.map +1 -1
- package/dist/module/workflow/service/comm-template.service.d.ts +4 -1
- package/dist/module/workflow/service/comm-template.service.js +38 -1
- package/dist/module/workflow/service/comm-template.service.js.map +1 -1
- package/dist/module/workflow/service/populate-workflow.service.d.ts +21 -0
- package/dist/module/workflow/service/populate-workflow.service.js +124 -0
- package/dist/module/workflow/service/populate-workflow.service.js.map +1 -0
- package/dist/module/workflow/service/workflow-list-master.service.js +3 -3
- package/dist/module/workflow/service/workflow-meta.service.d.ts +9 -0
- package/dist/module/workflow/service/workflow-meta.service.js +81 -0
- package/dist/module/workflow/service/workflow-meta.service.js.map +1 -0
- package/dist/module/workflow/workflow.module.js +41 -26
- 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/layout_preference/controller/layout_preference.controller.ts +4 -2
- package/src/module/layout_preference/entity/layout_preference.entity.ts +11 -0
- package/src/module/layout_preference/repository/layout_preference.repository.ts +6 -2
- package/src/module/layout_preference/service/layout_preference.service.ts +24 -6
- package/src/module/meta/controller/media.controller.ts +5 -7
- package/src/module/workflow/controller/action-category.controller.ts +35 -0
- package/src/module/workflow/controller/action.controller.ts +2 -2
- package/src/module/workflow/controller/comm-template.controller.ts +5 -4
- package/src/module/workflow/controller/workflow-meta.controller.ts +52 -0
- package/src/module/workflow/controller/workflow.controller.ts +14 -0
- package/src/module/workflow/entity/action-category.entity.ts +3 -0
- package/src/module/workflow/entity/action.entity.ts +3 -3
- package/src/module/workflow/entity/comm-template.entity.ts +18 -1
- package/src/module/workflow/entity/stage-movement-data.entity.ts +6 -0
- package/src/module/workflow/entity/template-attach-mapper.entity.ts +30 -0
- package/src/module/workflow/repository/comm-template.repository.ts +58 -5
- package/src/module/workflow/service/action-category.service.ts +26 -1
- package/src/module/workflow/service/action-template-mapping.service.ts +1 -1
- package/src/module/workflow/service/action.service.ts +103 -24
- package/src/module/workflow/service/comm-template.service.ts +54 -1
- package/src/module/workflow/service/populate-workflow.service.ts +189 -0
- package/src/module/workflow/service/workflow-list-master.service.ts +3 -3
- package/src/module/workflow/service/workflow-meta.service.ts +98 -0
- package/src/module/workflow/workflow.module.ts +41 -27
|
@@ -40,6 +40,14 @@ __decorate([
|
|
|
40
40
|
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
41
41
|
__metadata("design:type", String)
|
|
42
42
|
], StageMovementData.prototype, "is_current", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], StageMovementData.prototype, "mapped_entity_type", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], StageMovementData.prototype, "mapped_entity_id", void 0);
|
|
43
51
|
exports.StageMovementData = StageMovementData = __decorate([
|
|
44
52
|
(0, typeorm_1.Entity)({ name: 'cr_wf_stage_movement_data' }),
|
|
45
53
|
__metadata("design:paramtypes", [])
|
|
@@ -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;
|
|
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"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.TemplateAttach = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let TemplateAttach = class TemplateAttach {
|
|
15
|
+
constructor() { }
|
|
16
|
+
};
|
|
17
|
+
exports.TemplateAttach = TemplateAttach;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], TemplateAttach.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({}),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], TemplateAttach.prototype, "entity_type", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], TemplateAttach.prototype, "template_id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], TemplateAttach.prototype, "media_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], TemplateAttach.prototype, "organization_id", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], TemplateAttach.prototype, "appcode", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], TemplateAttach.prototype, "level_id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], TemplateAttach.prototype, "level_type", void 0);
|
|
50
|
+
exports.TemplateAttach = TemplateAttach = __decorate([
|
|
51
|
+
(0, typeorm_1.Entity)({ name: 'cr_wf_tem_attach_mapper' }),
|
|
52
|
+
__metadata("design:paramtypes", [])
|
|
53
|
+
], TemplateAttach);
|
|
54
|
+
//# sourceMappingURL=template-attach-mapper.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-attach-mapper.entity.js","sourceRoot":"","sources":["../../../../src/module/workflow/entity/template-attach-mapper.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiE;AAG1D,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,gBAAe,CAAC;CAyBjB,CAAA;AA1BY,wCAAc;AAIzB;IADC,IAAA,gCAAsB,GAAE;;0CACd;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,CAAC;;mDACS;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACP;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACV;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACH;AAGxB;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;;kDACR;yBAzBR,cAAc;IAD1B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC;;GAC/B,cAAc,CA0B1B"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { Repository } from 'typeorm';
|
|
2
2
|
import { CommTemplate } from '../entity/comm-template.entity';
|
|
3
|
+
import { TemplateAttach } from '../entity/template-attach-mapper.entity';
|
|
4
|
+
import { MediaDataService } from 'src/module/meta/service/media-data.service';
|
|
3
5
|
export declare class CommTemplateRepository {
|
|
4
6
|
private readonly commTemplateRepository;
|
|
5
|
-
|
|
7
|
+
private readonly templateAttachEntity;
|
|
8
|
+
private readonly mediaDataService;
|
|
9
|
+
constructor(commTemplateRepository: Repository<CommTemplate>, templateAttachEntity: Repository<TemplateAttach>, mediaDataService: MediaDataService);
|
|
6
10
|
getAllCommTemplate(entity_type: string, loggedInUser: any): Promise<CommTemplate[]>;
|
|
7
|
-
|
|
11
|
+
save(commTemplate: any): Promise<any>;
|
|
12
|
+
delete(id: any): Promise<any>;
|
|
13
|
+
getTemplateByCode(entity_type: string, code: string, loggedInUser: any): Promise<any | null>;
|
|
8
14
|
}
|
|
@@ -17,35 +17,66 @@ const common_1 = require("@nestjs/common");
|
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
19
|
const comm_template_entity_1 = require("../entity/comm-template.entity");
|
|
20
|
+
const template_attach_mapper_entity_1 = require("../entity/template-attach-mapper.entity");
|
|
21
|
+
const media_data_service_1 = require("../../meta/service/media-data.service");
|
|
20
22
|
let CommTemplateRepository = class CommTemplateRepository {
|
|
21
|
-
constructor(commTemplateRepository) {
|
|
23
|
+
constructor(commTemplateRepository, templateAttachEntity, mediaDataService) {
|
|
22
24
|
this.commTemplateRepository = commTemplateRepository;
|
|
25
|
+
this.templateAttachEntity = templateAttachEntity;
|
|
26
|
+
this.mediaDataService = mediaDataService;
|
|
23
27
|
}
|
|
24
28
|
async getAllCommTemplate(entity_type, loggedInUser) {
|
|
29
|
+
const { organization_id } = loggedInUser;
|
|
25
30
|
return this.commTemplateRepository.find({
|
|
26
31
|
select: ['name', 'code'],
|
|
27
32
|
where: {
|
|
28
|
-
|
|
33
|
+
mapped_entity_type: entity_type,
|
|
34
|
+
organization_id: organization_id,
|
|
29
35
|
},
|
|
30
36
|
});
|
|
31
37
|
}
|
|
38
|
+
async save(commTemplate) {
|
|
39
|
+
return this.templateAttachEntity.save(commTemplate);
|
|
40
|
+
}
|
|
41
|
+
async delete(id) {
|
|
42
|
+
return await this.templateAttachEntity.delete(id);
|
|
43
|
+
}
|
|
32
44
|
async getTemplateByCode(entity_type, code, loggedInUser) {
|
|
33
45
|
const template = await this.commTemplateRepository.findOne({
|
|
34
46
|
where: {
|
|
35
|
-
entity_type
|
|
36
|
-
code
|
|
47
|
+
entity_type,
|
|
48
|
+
code,
|
|
37
49
|
},
|
|
38
50
|
});
|
|
39
51
|
if (!template) {
|
|
40
52
|
throw new common_1.NotFoundException(`Template with code ${code} not found`);
|
|
41
53
|
}
|
|
42
|
-
|
|
54
|
+
if (template.format_type === 'markup') {
|
|
55
|
+
const media = await this.mediaDataService.getMediaDownloadUrl(template.markup_id, loggedInUser);
|
|
56
|
+
console.log(media);
|
|
57
|
+
}
|
|
58
|
+
if (template.format_type === 'richtext') {
|
|
59
|
+
return template;
|
|
60
|
+
}
|
|
61
|
+
const attachments = await this.templateAttachEntity.find({
|
|
62
|
+
select: ['media_id'],
|
|
63
|
+
where: {
|
|
64
|
+
entity_type: entity_type,
|
|
65
|
+
template_id: template.id,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
const media = await this.mediaDataService.getMediaDownloadUrl(1, loggedInUser);
|
|
69
|
+
console.log(media);
|
|
70
|
+
return { ...template, attachments: attachments.map((att) => att.media_id) };
|
|
43
71
|
}
|
|
44
72
|
};
|
|
45
73
|
exports.CommTemplateRepository = CommTemplateRepository;
|
|
46
74
|
exports.CommTemplateRepository = CommTemplateRepository = __decorate([
|
|
47
75
|
(0, common_1.Injectable)(),
|
|
48
76
|
__param(0, (0, typeorm_1.InjectRepository)(comm_template_entity_1.CommTemplate)),
|
|
49
|
-
|
|
77
|
+
__param(1, (0, typeorm_1.InjectRepository)(template_attach_mapper_entity_1.TemplateAttach)),
|
|
78
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
79
|
+
typeorm_2.Repository,
|
|
80
|
+
media_data_service_1.MediaDataService])
|
|
50
81
|
], CommTemplateRepository);
|
|
51
82
|
//# sourceMappingURL=comm-template.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comm-template.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/comm-template.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAC/D,6CAAmD;AAEnD,qCAAqC;AACrC,yEAA8D;
|
|
1
|
+
{"version":3,"file":"comm-template.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/comm-template.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAC/D,6CAAmD;AAEnD,qCAAqC;AACrC,yEAA8D;AAC9D,2FAAyE;AACzE,8EAA8E;AAGvE,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YAEmB,sBAAgD,EAEhD,oBAAgD,EAChD,gBAAkC;QAHlC,2BAAsB,GAAtB,sBAAsB,CAA0B;QAEhD,yBAAoB,GAApB,oBAAoB,CAA4B;QAChD,qBAAgB,GAAhB,gBAAgB,CAAkB;IAClD,CAAC;IAEJ,KAAK,CAAC,kBAAkB,CAAC,WAAmB,EAAE,YAAY;QACxD,MAAM,EAAE,eAAe,EAAE,GAAG,YAAY,CAAC;QACzC,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC;YACtC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;YACxB,KAAK,EAAE;gBACL,kBAAkB,EAAE,WAAW;gBAC/B,eAAe,EAAE,eAAe;aACjC;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,YAAiB;QAS1B,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAO;QAElB,OAAO,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,WAAmB,EACnB,IAAY,EACZ,YAAY;QAEZ,MAAM,QAAQ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;qCADQ,oBAAU;QAEZ,oBAAU;QACd,qCAAgB;GAN1C,sBAAsB,CAoFlC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
2
|
+
import { UserData } from 'src/module/user/entity/user.entity';
|
|
3
|
+
import { DataSource } from 'typeorm';
|
|
2
4
|
export declare class ActionCategoryService extends EntityServiceImpl {
|
|
5
|
+
private readonly dataSource;
|
|
6
|
+
constructor(dataSource: DataSource);
|
|
7
|
+
getActionsCat(loggedInUser: UserData, entity_type: string): Promise<any>;
|
|
3
8
|
}
|
|
@@ -5,14 +5,36 @@ 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.ActionCategoryService = void 0;
|
|
10
13
|
const common_1 = require("@nestjs/common");
|
|
11
14
|
const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
12
16
|
let ActionCategoryService = class ActionCategoryService extends entity_service_impl_service_1.EntityServiceImpl {
|
|
17
|
+
constructor(dataSource) {
|
|
18
|
+
super();
|
|
19
|
+
this.dataSource = dataSource;
|
|
20
|
+
}
|
|
21
|
+
async getActionsCat(loggedInUser, entity_type) {
|
|
22
|
+
const { organization_id } = loggedInUser;
|
|
23
|
+
const result = await this.dataSource.query(`
|
|
24
|
+
SELECT id, name
|
|
25
|
+
FROM cr_wf_action_category
|
|
26
|
+
WHERE mapped_entity_type = ?
|
|
27
|
+
AND organization_id = ?
|
|
28
|
+
`, [entity_type, organization_id]);
|
|
29
|
+
return result.map((row) => ({
|
|
30
|
+
label: row.name,
|
|
31
|
+
value: row.id,
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
13
34
|
};
|
|
14
35
|
exports.ActionCategoryService = ActionCategoryService;
|
|
15
36
|
exports.ActionCategoryService = ActionCategoryService = __decorate([
|
|
16
|
-
(0, common_1.Injectable)()
|
|
37
|
+
(0, common_1.Injectable)(),
|
|
38
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
17
39
|
], ActionCategoryService);
|
|
18
40
|
//# sourceMappingURL=action-category.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-category.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action-category.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"action-category.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action-category.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,gGAAwF;AAExF,qCAAqC;AAG9B,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,+CAAiB;IAC1D,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,YAAsB,EAAE,WAAmB;QAC7D,MAAM,EAAE,eAAe,EAAE,GAAG,YAAY,CAAC;QAEzC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CACxC;;;;;KAKD,EACC,CAAC,WAAW,EAAE,eAAe,CAAC,CAC/B,CAAC;QAEF,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CAAC;YAC/B,KAAK,EAAE,GAAG,CAAC,IAAI;YACf,KAAK,EAAE,GAAG,CAAC,EAAE;SACd,CAAC,CAAC,CAAC;IACN,CAAC;CACF,CAAA;AAvBY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAE8B,oBAAU;GADxC,qBAAqB,CAuBjC"}
|
|
@@ -11,5 +11,5 @@ export declare class ActionService extends EntityServiceImpl {
|
|
|
11
11
|
deleteEntity(entityType: string, id: number, loggedInUser: UserData): Promise<any>;
|
|
12
12
|
getReasonCode(loggedInUser: UserData): Promise<any>;
|
|
13
13
|
defaultReasonCode(list_type: string, loggedInUser: UserData): Promise<any>;
|
|
14
|
-
getActions(loggedInUser: UserData,
|
|
14
|
+
getActions(loggedInUser: UserData, stage_id: number): Promise<any[]>;
|
|
15
15
|
}
|
|
@@ -28,7 +28,6 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
28
28
|
return { ...actionData, template: template.map((t) => t.template_code) };
|
|
29
29
|
}
|
|
30
30
|
async createEntity(entityData, loggedInUser, manager, appcode) {
|
|
31
|
-
console.log('entityData', entityData);
|
|
32
31
|
let actionData = entityData;
|
|
33
32
|
let action = await super.createEntity(entityData, loggedInUser, manager, appcode);
|
|
34
33
|
let stageActionMapping = {
|
|
@@ -106,38 +105,91 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
106
105
|
throw new common_1.BadRequestException('list_type is required');
|
|
107
106
|
}
|
|
108
107
|
const result = await this.dataSource.query(`
|
|
109
|
-
SELECT name,
|
|
108
|
+
SELECT name, id
|
|
110
109
|
FROM cr_list_master_items
|
|
111
110
|
WHERE listtype = ? AND organization_id = ?
|
|
112
111
|
`, [list_type, organization_id]);
|
|
113
112
|
return result.map((row) => ({
|
|
114
|
-
label: row.
|
|
115
|
-
value: row.
|
|
113
|
+
label: row.name,
|
|
114
|
+
value: row.id,
|
|
116
115
|
}));
|
|
117
116
|
}
|
|
118
|
-
async getActions(loggedInUser,
|
|
117
|
+
async getActions(loggedInUser, stage_id) {
|
|
119
118
|
const { organization_id } = loggedInUser;
|
|
120
|
-
const
|
|
121
|
-
SELECT
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
119
|
+
const stageActions = await this.dataSource.query(`
|
|
120
|
+
SELECT id, action_id
|
|
121
|
+
FROM cr_wf_stage_action_mapping
|
|
122
|
+
WHERE stage_id = ?
|
|
123
|
+
`, [stage_id]);
|
|
124
|
+
if (!stageActions?.length)
|
|
125
|
+
return [];
|
|
126
|
+
const actionIds = stageActions.map((sa) => sa.action_id);
|
|
127
|
+
const mappingIds = stageActions.map((sa) => sa.id);
|
|
128
|
+
const templateMappings = await this.dataSource.query(`
|
|
129
|
+
SELECT stg_act_mapping_id, template_code
|
|
130
|
+
FROM cr_wf_action_template_mapping
|
|
131
|
+
WHERE stg_act_mapping_id IN (${mappingIds.map(() => '?').join(',')})
|
|
132
|
+
`, mappingIds);
|
|
133
|
+
const templateCodes = templateMappings.map((tm) => tm.template_code);
|
|
134
|
+
const templateCodeToName = {};
|
|
135
|
+
if (templateCodes.length > 0) {
|
|
136
|
+
const templates = await this.dataSource
|
|
137
|
+
.createQueryBuilder()
|
|
138
|
+
.select(['t.code AS code', 't.name AS name'])
|
|
139
|
+
.from('cr_wf_comm_template', 't')
|
|
140
|
+
.where('t.code IN (:...codes)', { codes: templateCodes })
|
|
141
|
+
.andWhere('t.organization_id = :orgId', { orgId: organization_id })
|
|
142
|
+
.getRawMany();
|
|
143
|
+
templates.forEach((tpl) => {
|
|
144
|
+
templateCodeToName[tpl.code] = tpl.name;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const mappingIdToTemplates = {};
|
|
148
|
+
for (const tm of templateMappings) {
|
|
149
|
+
const mappingId = tm.stg_act_mapping_id;
|
|
150
|
+
const name = templateCodeToName[tm.template_code];
|
|
151
|
+
if (name) {
|
|
152
|
+
if (!mappingIdToTemplates[mappingId]) {
|
|
153
|
+
mappingIdToTemplates[mappingId] = [];
|
|
154
|
+
}
|
|
155
|
+
mappingIdToTemplates[mappingId].push(name);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const actionIdToTemplates = {};
|
|
159
|
+
for (const sa of stageActions) {
|
|
160
|
+
const mappingId = sa.id;
|
|
161
|
+
const templates = mappingIdToTemplates[mappingId];
|
|
162
|
+
if (templates?.length) {
|
|
163
|
+
if (!actionIdToTemplates[sa.action_id]) {
|
|
164
|
+
actionIdToTemplates[sa.action_id] = [];
|
|
165
|
+
}
|
|
166
|
+
actionIdToTemplates[sa.action_id].push(...templates);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const actionResults = await this.dataSource
|
|
170
|
+
.createQueryBuilder()
|
|
171
|
+
.select([
|
|
172
|
+
'a.id AS id',
|
|
173
|
+
'a.name AS action_name',
|
|
174
|
+
'ac.name AS action_category',
|
|
175
|
+
'ar.name AS action_requirement',
|
|
176
|
+
])
|
|
177
|
+
.from('cr_wf_action', 'a')
|
|
178
|
+
.leftJoin('cr_wf_action_category', 'ac', 'ac.id = a.action_cat_id')
|
|
179
|
+
.leftJoin('cr_list_master_items', 'ar', `ar.id = a.action_requirement AND ar.listtype = 'ACRQ' AND ar.organization_id = :orgId`, { orgId: organization_id })
|
|
180
|
+
.where('a.organization_id = :orgId', { orgId: organization_id })
|
|
181
|
+
.andWhere('a.id IN (:...actionIds)', { actionIds })
|
|
182
|
+
.getRawMany();
|
|
183
|
+
const enrichedResult = actionResults.map((row) => {
|
|
184
|
+
const actionId = Number(row.id);
|
|
185
|
+
const templates = actionIdToTemplates[actionId] || [];
|
|
186
|
+
const uniqueTemplates = [...new Set(templates)];
|
|
187
|
+
return {
|
|
188
|
+
...row,
|
|
189
|
+
template: uniqueTemplates.join(', '),
|
|
190
|
+
};
|
|
191
|
+
});
|
|
192
|
+
return enrichedResult;
|
|
141
193
|
}
|
|
142
194
|
};
|
|
143
195
|
exports.ActionService = ActionService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiE;AAEjE,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,
|
|
1
|
+
{"version":3,"file":"action.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiE;AAEjE,gGAAwF;AAExF,qCAAoD;AAI7C,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,+CAAiB;IAClD,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,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YAChC,MAAM,SAAS,GAAG,mBAAmB,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACtD,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;YAEhD,OAAO;gBACL,GAAG,GAAG;gBACN,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;aACrC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,cAAc,CAAC;IACxB,CAAC;CACF,CAAA;AAxTY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAE8B,oBAAU;GADxC,aAAa,CAwTzB"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { CommTemplateRepository } from '../repository/comm-template.repository';
|
|
2
2
|
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
3
|
+
import { UserData } from 'src/module/user/entity/user.entity';
|
|
3
4
|
export declare class CommTemplateService extends EntityServiceImpl {
|
|
4
5
|
private readonly commTemplateRepository;
|
|
5
6
|
constructor(commTemplateRepository: CommTemplateRepository);
|
|
7
|
+
createEntity(entityData: any, loggedInUser: any): Promise<any>;
|
|
8
|
+
updateEntity(entityData: any, loggedInUser: UserData): Promise<any>;
|
|
6
9
|
getEntityData(entityType: string, id: number, loggedInUser: any): Promise<any>;
|
|
7
10
|
getAllCommTemplate(entity_type: string, loggedInUser: any): Promise<{
|
|
8
|
-
label: string;
|
|
9
11
|
value: string;
|
|
12
|
+
name: string;
|
|
10
13
|
}[]>;
|
|
11
14
|
}
|
|
@@ -18,6 +18,43 @@ let CommTemplateService = class CommTemplateService extends entity_service_impl_
|
|
|
18
18
|
super();
|
|
19
19
|
this.commTemplateRepository = commTemplateRepository;
|
|
20
20
|
}
|
|
21
|
+
async createEntity(entityData, loggedInUser) {
|
|
22
|
+
const { attachments, ...templateData } = entityData;
|
|
23
|
+
const tempData = await super.createEntity(templateData, loggedInUser);
|
|
24
|
+
if (attachments && attachments.length > 0) {
|
|
25
|
+
const attachmentEntities = attachments.map((attachment) => ({
|
|
26
|
+
entity_type: templateData.entity_type,
|
|
27
|
+
template_id: tempData.id,
|
|
28
|
+
media_id: attachment,
|
|
29
|
+
organization_id: loggedInUser.organization_id,
|
|
30
|
+
appcode: loggedInUser.appcode,
|
|
31
|
+
level_id: loggedInUser.level_id,
|
|
32
|
+
level_type: loggedInUser.level_type,
|
|
33
|
+
}));
|
|
34
|
+
await this.commTemplateRepository.save(attachmentEntities);
|
|
35
|
+
}
|
|
36
|
+
return tempData;
|
|
37
|
+
}
|
|
38
|
+
async updateEntity(entityData, loggedInUser) {
|
|
39
|
+
const { attachments, ...templateData } = entityData;
|
|
40
|
+
const tempData = await super.updateEntity(templateData, loggedInUser);
|
|
41
|
+
await this.commTemplateRepository.delete({
|
|
42
|
+
template_id: tempData.id,
|
|
43
|
+
});
|
|
44
|
+
if (attachments && attachments.length > 0) {
|
|
45
|
+
const attachmentEntities = attachments.map((attachment) => ({
|
|
46
|
+
entity_type: templateData.entity_type,
|
|
47
|
+
template_id: tempData.id,
|
|
48
|
+
media_id: attachment,
|
|
49
|
+
organization_id: loggedInUser.organization_id,
|
|
50
|
+
appcode: loggedInUser.appcode,
|
|
51
|
+
level_id: loggedInUser.level_id,
|
|
52
|
+
level_type: loggedInUser.level_type,
|
|
53
|
+
}));
|
|
54
|
+
await this.commTemplateRepository.save(attachmentEntities);
|
|
55
|
+
}
|
|
56
|
+
return tempData;
|
|
57
|
+
}
|
|
21
58
|
async getEntityData(entityType, id, loggedInUser) {
|
|
22
59
|
const getTemplate = await this.commTemplateRepository.getTemplateByCode(entityType, id.toString(), loggedInUser);
|
|
23
60
|
return getTemplate;
|
|
@@ -25,8 +62,8 @@ let CommTemplateService = class CommTemplateService extends entity_service_impl_
|
|
|
25
62
|
async getAllCommTemplate(entity_type, loggedInUser) {
|
|
26
63
|
const commTemplateData = await this.commTemplateRepository.getAllCommTemplate(entity_type, loggedInUser);
|
|
27
64
|
const response = commTemplateData.map((item) => ({
|
|
28
|
-
label: item.name,
|
|
29
65
|
value: item.code,
|
|
66
|
+
name: item.name,
|
|
30
67
|
}));
|
|
31
68
|
return response;
|
|
32
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comm-template.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/comm-template.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qFAAgF;AAChF,gGAAwF;
|
|
1
|
+
{"version":3,"file":"comm-template.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/comm-template.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qFAAgF;AAChF,gGAAwF;AAKjF,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,+CAAiB;IACxD,YAA6B,sBAA8C;QACzE,KAAK,EAAE,CAAC;QADmB,2BAAsB,GAAtB,sBAAsB,CAAwB;IAE3E,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,UAAe,EAAE,YAAiB;QACnD,MAAM,EAAE,WAAW,EAAE,GAAG,YAAY,EAAE,GAAG,UAAU,CAAC;QAEpD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAGtE,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1C,MAAM,kBAAkB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;gBAC1D,WAAW,EAAE,YAAY,CAAC,WAAW;gBACrC,WAAW,EAAE,QAAQ,CAAC,EAAE;gBACxB,QAAQ,EAAE,UAAU;gBACpB,eAAe,EAAE,YAAY,CAAC,eAAe;gBAC7C,OAAO,EAAE,YAAY,CAAC,OAAO;gBAC7B,QAAQ,EAAE,YAAY,CAAC,QAAQ;gBAC/B,UAAU,EAAE,YAAY,CAAC,UAAU;aACpC,CA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,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,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC,CAAC;QAEJ,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAA;AAtFY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAE0C,iDAAsB;GADhE,mBAAmB,CAsF/B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DataSource } from 'typeorm';
|
|
2
|
+
import { PopulateMetaService } from './../../meta/service/populate-meta.service';
|
|
3
|
+
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
4
|
+
import { WorkflowService } from './workflow.service';
|
|
5
|
+
import { UserData } from 'src/module/user/entity/user.entity';
|
|
6
|
+
import { StageGroupService } from './stage-group.service';
|
|
7
|
+
import { StageService } from './stage.service';
|
|
8
|
+
import { ActionService } from './action.service';
|
|
9
|
+
export declare class PopulateWorkflowService extends EntityServiceImpl {
|
|
10
|
+
private readonly populateMetaService;
|
|
11
|
+
private readonly dataSource;
|
|
12
|
+
private readonly workflowService;
|
|
13
|
+
private readonly stageGroupService;
|
|
14
|
+
private readonly stageService;
|
|
15
|
+
private readonly actionService;
|
|
16
|
+
constructor(populateMetaService: PopulateMetaService, dataSource: DataSource, workflowService: WorkflowService, stageGroupService: StageGroupService, stageService: StageService, actionService: ActionService);
|
|
17
|
+
populateWorkflowData(organization_id: number, loggedInUser: UserData): Promise<{
|
|
18
|
+
message: string;
|
|
19
|
+
status: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|