rez_core 2.2.7 → 2.2.9
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/constant/global.constant.d.ts +2 -1
- package/dist/constant/global.constant.js +3 -2
- package/dist/constant/global.constant.js.map +1 -1
- package/dist/module/enterprise/repository/school.repository.js +18 -2
- package/dist/module/enterprise/repository/school.repository.js.map +1 -1
- package/dist/module/filter/controller/filter.controller.d.ts +1 -1
- package/dist/module/filter/controller/filter.controller.js +7 -4
- package/dist/module/filter/controller/filter.controller.js.map +1 -1
- package/dist/module/filter/dto/filter-request.dto.d.ts +1 -0
- package/dist/module/filter/service/filter.service.js +26 -4
- package/dist/module/filter/service/filter.service.js.map +1 -1
- package/dist/module/layout_preference/controller/layout_preference.controller.js +4 -4
- 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 +17 -4
- package/dist/module/layout_preference/service/layout_preference.service.js.map +1 -1
- package/dist/module/listmaster/entity/list-master-items.entity.js +5 -5
- package/dist/module/listmaster/entity/list-master-items.entity.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/meta/entity/base-entity.entity.js.map +1 -1
- package/dist/module/module/controller/module-access.controller.d.ts +1 -1
- package/dist/module/module/controller/module-access.controller.js +6 -6
- package/dist/module/module/controller/module-access.controller.js.map +1 -1
- package/dist/module/module/service/module-access.service.d.ts +2 -1
- package/dist/module/module/service/module-access.service.js +5 -3
- package/dist/module/module/service/module-access.service.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 +28 -0
- package/dist/module/workflow/controller/action.controller.js +88 -0
- package/dist/module/workflow/controller/action.controller.js.map +1 -0
- 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/entity-modification.controller.d.ts +8 -0
- package/dist/module/workflow/controller/entity-modification.controller.js +44 -0
- package/dist/module/workflow/controller/entity-modification.controller.js.map +1 -0
- package/dist/module/workflow/controller/stage-group.controller.d.ts +10 -0
- package/dist/module/workflow/controller/stage-group.controller.js +43 -0
- package/dist/module/workflow/controller/stage-group.controller.js.map +1 -0
- 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/task.controller.d.ts +21 -0
- package/dist/module/workflow/controller/task.controller.js +58 -0
- package/dist/module/workflow/controller/task.controller.js.map +1 -0
- package/dist/module/workflow/controller/workflow-meta.controller.d.ts +15 -0
- package/dist/module/workflow/controller/workflow-meta.controller.js +70 -0
- package/dist/module/workflow/controller/workflow-meta.controller.js.map +1 -0
- package/dist/module/workflow/controller/workflow.controller.d.ts +25 -10
- package/dist/module/workflow/controller/workflow.controller.js +32 -15
- 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-data.entity.d.ts +15 -0
- package/dist/module/workflow/entity/action-data.entity.js +70 -0
- package/dist/module/workflow/entity/action-data.entity.js.map +1 -0
- package/dist/module/workflow/entity/action.entity.d.ts +7 -2
- package/dist/module/workflow/entity/action.entity.js +30 -10
- 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/entity-modification.entity.d.ts +13 -0
- package/dist/module/workflow/entity/entity-modification.entity.js +63 -0
- package/dist/module/workflow/entity/entity-modification.entity.js.map +1 -0
- 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-movement-data.entity.d.ts +4 -0
- package/dist/module/workflow/entity/stage-movement-data.entity.js +16 -0
- package/dist/module/workflow/entity/stage-movement-data.entity.js.map +1 -1
- package/dist/module/workflow/entity/stage.entity.d.ts +2 -2
- package/dist/module/workflow/entity/stage.entity.js +5 -5
- package/dist/module/workflow/entity/stage.entity.js.map +1 -1
- package/dist/module/workflow/entity/task-data.entity.d.ts +25 -0
- package/dist/module/workflow/entity/task-data.entity.js +110 -0
- package/dist/module/workflow/entity/task-data.entity.js.map +1 -0
- 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/entity/workflow-level-mapping.entity.d.ts +7 -0
- package/dist/module/workflow/entity/workflow-level-mapping.entity.js +38 -0
- package/dist/module/workflow/entity/workflow-level-mapping.entity.js.map +1 -0
- package/dist/module/workflow/entity/workflow.entity.d.ts +2 -0
- package/dist/module/workflow/entity/workflow.entity.js +8 -0
- package/dist/module/workflow/entity/workflow.entity.js.map +1 -1
- package/dist/module/workflow/repository/action-data.repository.d.ts +10 -0
- package/dist/module/workflow/repository/action-data.repository.js +85 -0
- package/dist/module/workflow/repository/action-data.repository.js.map +1 -0
- package/dist/module/workflow/repository/action.repository.d.ts +17 -0
- package/dist/module/workflow/repository/action.repository.js +97 -0
- package/dist/module/workflow/repository/action.repository.js.map +1 -0
- package/dist/module/workflow/repository/comm-template.repository.d.ts +14 -0
- package/dist/module/workflow/repository/comm-template.repository.js +87 -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-movement.repository.d.ts +23 -0
- package/dist/module/workflow/repository/stage-movement.repository.js +142 -0
- package/dist/module/workflow/repository/stage-movement.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/repository/task.repository.d.ts +10 -0
- package/dist/module/workflow/repository/task.repository.js +77 -0
- package/dist/module/workflow/repository/task.repository.js.map +1 -0
- package/dist/module/workflow/repository/workflow.repository.d.ts +9 -1
- package/dist/module/workflow/repository/workflow.repository.js +38 -6
- package/dist/module/workflow/repository/workflow.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-data.service.d.ts +11 -0
- package/dist/module/workflow/service/action-data.service.js +36 -0
- package/dist/module/workflow/service/action-data.service.js.map +1 -0
- package/dist/module/workflow/service/action.service.d.ts +19 -1
- package/dist/module/workflow/service/action.service.js +159 -10
- package/dist/module/workflow/service/action.service.js.map +1 -1
- package/dist/module/workflow/service/comm-template.service.d.ts +11 -0
- package/dist/module/workflow/service/comm-template.service.js +59 -1
- package/dist/module/workflow/service/comm-template.service.js.map +1 -1
- package/dist/module/workflow/service/entity-modification.service.d.ts +8 -0
- package/dist/module/workflow/service/entity-modification.service.js +52 -0
- package/dist/module/workflow/service/entity-modification.service.js.map +1 -0
- 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/stage-group.service.d.ts +13 -0
- package/dist/module/workflow/service/stage-group.service.js +39 -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/task.service.d.ts +18 -0
- package/dist/module/workflow/service/task.service.js +63 -0
- package/dist/module/workflow/service/task.service.js.map +1 -0
- package/dist/module/workflow/service/workflow-list-master.service.js +4 -4
- package/dist/module/workflow/service/workflow-meta.service.d.ts +20 -0
- package/dist/module/workflow/service/workflow-meta.service.js +137 -0
- package/dist/module/workflow/service/workflow-meta.service.js.map +1 -0
- package/dist/module/workflow/service/workflow.service.d.ts +28 -5
- package/dist/module/workflow/service/workflow.service.js +108 -41
- package/dist/module/workflow/service/workflow.service.js.map +1 -1
- package/dist/module/workflow/workflow.module.js +82 -15
- package/dist/module/workflow/workflow.module.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/constant/global.constant.ts +3 -1
- package/src/module/enterprise/repository/school.repository.ts +23 -2
- package/src/module/filter/controller/filter.controller.ts +10 -4
- package/src/module/filter/dto/filter-request.dto.ts +1 -0
- package/src/module/filter/service/filter.service.ts +39 -5
- package/src/module/layout_preference/controller/layout_preference.controller.ts +6 -4
- 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 +31 -6
- package/src/module/listmaster/entity/list-master-items.entity.ts +5 -5
- package/src/module/meta/controller/media.controller.ts +5 -7
- package/src/module/meta/entity/base-entity.entity.ts +1 -1
- package/src/module/module/controller/module-access.controller.ts +9 -4
- package/src/module/module/service/module-access.service.ts +15 -8
- package/src/module/workflow/controller/action-category.controller.ts +35 -0
- package/src/module/workflow/controller/action.controller.ts +73 -0
- package/src/module/workflow/controller/comm-template.controller.ts +32 -0
- package/src/module/workflow/controller/entity-modification.controller.ts +35 -0
- package/src/module/workflow/controller/stage-group.controller.ts +33 -0
- package/src/module/workflow/controller/stage.controller.ts +50 -0
- package/src/module/workflow/controller/task.controller.ts +57 -0
- package/src/module/workflow/controller/workflow-meta.controller.ts +76 -0
- package/src/module/workflow/controller/workflow.controller.ts +32 -12
- package/src/module/workflow/entity/action-category.entity.ts +3 -0
- package/src/module/workflow/entity/action-data.entity.ts +43 -0
- package/src/module/workflow/entity/action.entity.ts +18 -3
- package/src/module/workflow/entity/comm-template.entity.ts +18 -1
- package/src/module/workflow/entity/entity-modification.entity.ts +38 -0
- package/src/module/workflow/entity/stage-group.entity.ts +1 -1
- package/src/module/workflow/entity/stage-movement-data.entity.ts +12 -0
- package/src/module/workflow/entity/stage.entity.ts +4 -4
- package/src/module/workflow/entity/task-data.entity.ts +73 -0
- package/src/module/workflow/entity/template-attach-mapper.entity.ts +30 -0
- package/src/module/workflow/entity/workflow-level-mapping.entity.ts +18 -0
- package/src/module/workflow/entity/workflow.entity.ts +6 -0
- package/src/module/workflow/repository/action-data.repository.ts +93 -0
- package/src/module/workflow/repository/action.repository.ts +104 -0
- package/src/module/workflow/repository/comm-template.repository.ts +102 -0
- package/src/module/workflow/repository/stage-group.repository.ts +46 -0
- package/src/module/workflow/repository/stage-movement.repository.ts +219 -0
- package/src/module/workflow/repository/stage.repository.ts +47 -0
- package/src/module/workflow/repository/task.repository.ts +85 -0
- package/src/module/workflow/repository/workflow.repository.ts +40 -2
- package/src/module/workflow/service/action-category.service.ts +26 -1
- package/src/module/workflow/service/action-data.service.ts +45 -0
- package/src/module/workflow/service/action-template-mapping.service.ts +1 -1
- package/src/module/workflow/service/action.service.ts +279 -19
- package/src/module/workflow/service/comm-template.service.ts +90 -1
- package/src/module/workflow/service/entity-modification.service.ts +67 -0
- package/src/module/workflow/service/populate-workflow.service.ts +189 -0
- package/src/module/workflow/service/stage-group.service.ts +67 -2
- package/src/module/workflow/service/stage.service.ts +104 -28
- package/src/module/workflow/service/task.service.ts +95 -0
- package/src/module/workflow/service/workflow-list-master.service.ts +4 -4
- package/src/module/workflow/service/workflow-meta.service.ts +231 -0
- package/src/module/workflow/service/workflow.service.ts +181 -50
- package/src/module/workflow/workflow.module.ts +82 -15
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Body,
|
|
3
|
+
Controller,
|
|
4
|
+
Get,
|
|
5
|
+
Inject,
|
|
6
|
+
Post,
|
|
7
|
+
Req,
|
|
8
|
+
UseGuards,
|
|
9
|
+
} from '@nestjs/common';
|
|
10
|
+
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
11
|
+
import { StageGroupService } from '../service/stage-group.service';
|
|
12
|
+
|
|
13
|
+
@Controller('/stage-group')
|
|
14
|
+
@UseGuards(JwtAuthGuard)
|
|
15
|
+
export class StageGroupController {
|
|
16
|
+
constructor(
|
|
17
|
+
@Inject('StageGroupService')
|
|
18
|
+
private readonly stageGroupService: StageGroupService,
|
|
19
|
+
) {}
|
|
20
|
+
|
|
21
|
+
@Post('/getAllStageGroup')
|
|
22
|
+
async getAllStageGroup(
|
|
23
|
+
@Req() req: Request & { user: any },
|
|
24
|
+
@Body() body: { workflow_id: number },
|
|
25
|
+
) {
|
|
26
|
+
const { level_id, level_type } = req.user.userData;
|
|
27
|
+
return this.stageGroupService.getAllStageGroup(
|
|
28
|
+
body.workflow_id,
|
|
29
|
+
level_id,
|
|
30
|
+
level_type,
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Body,
|
|
3
|
+
Controller,
|
|
4
|
+
Get,
|
|
5
|
+
HttpCode,
|
|
6
|
+
HttpStatus,
|
|
7
|
+
Inject,
|
|
8
|
+
Post,
|
|
9
|
+
Req,
|
|
10
|
+
UseGuards,
|
|
11
|
+
} from '@nestjs/common';
|
|
12
|
+
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
13
|
+
import { StageService } from '../service/stage.service';
|
|
14
|
+
import { level } from 'winston';
|
|
15
|
+
|
|
16
|
+
@Controller('/stage')
|
|
17
|
+
@UseGuards(JwtAuthGuard)
|
|
18
|
+
export class StageController {
|
|
19
|
+
constructor(
|
|
20
|
+
@Inject('StageService')
|
|
21
|
+
private readonly stageGroupService: StageService,
|
|
22
|
+
) {}
|
|
23
|
+
|
|
24
|
+
@Post('/getAllStage')
|
|
25
|
+
async getAllStage(
|
|
26
|
+
@Req() req: Request & { user: any },
|
|
27
|
+
@Body() body: { stage_group_id: number },
|
|
28
|
+
) {
|
|
29
|
+
const { level_id, level_type } = req.user.userData;
|
|
30
|
+
return this.stageGroupService.getAllStage(
|
|
31
|
+
body.stage_group_id,
|
|
32
|
+
level_id,
|
|
33
|
+
level_type,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@Post('/getStagesWithGroupName')
|
|
38
|
+
@HttpCode(HttpStatus.OK)
|
|
39
|
+
async getStagesWithGroupName(
|
|
40
|
+
@Body('workflow_id') workflow_id: number,
|
|
41
|
+
@Req() req: Request & { user: any },
|
|
42
|
+
) {
|
|
43
|
+
const { level_id, level_type } = req.user.userData;
|
|
44
|
+
return this.stageGroupService.getStagesWithGroupName(
|
|
45
|
+
workflow_id,
|
|
46
|
+
level_id,
|
|
47
|
+
level_type,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Body,
|
|
3
|
+
Controller,
|
|
4
|
+
HttpCode,
|
|
5
|
+
HttpStatus,
|
|
6
|
+
Inject,
|
|
7
|
+
Post,
|
|
8
|
+
Req,
|
|
9
|
+
UseGuards,
|
|
10
|
+
} from '@nestjs/common';
|
|
11
|
+
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
12
|
+
import { TaskService } from '../service/task.service';
|
|
13
|
+
|
|
14
|
+
@Controller('/task')
|
|
15
|
+
@UseGuards(JwtAuthGuard)
|
|
16
|
+
export class TaskController {
|
|
17
|
+
constructor(
|
|
18
|
+
@Inject('TaskService')
|
|
19
|
+
private readonly taskService: TaskService,
|
|
20
|
+
) {}
|
|
21
|
+
|
|
22
|
+
@Post('/by-user-and-stage')
|
|
23
|
+
@HttpCode(HttpStatus.OK)
|
|
24
|
+
async getTasksbyUserAndStage(
|
|
25
|
+
@Req() req: Request & { user: any },
|
|
26
|
+
@Body()
|
|
27
|
+
body: {
|
|
28
|
+
stage_id: number;
|
|
29
|
+
mapped_entity_type?: string;
|
|
30
|
+
mapped_entity_id?: number;
|
|
31
|
+
user_id?: number;
|
|
32
|
+
},
|
|
33
|
+
) {
|
|
34
|
+
const loggedInUser = req.user.userData;
|
|
35
|
+
const result = this.taskService.getAllTaskByUserIdandStageId(
|
|
36
|
+
loggedInUser,
|
|
37
|
+
body,
|
|
38
|
+
);
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@Post('/move-task')
|
|
43
|
+
async moveTask(
|
|
44
|
+
@Req() req: Request & { user: any },
|
|
45
|
+
@Body()
|
|
46
|
+
body: {
|
|
47
|
+
mapped_entity_type: string;
|
|
48
|
+
mapped_entity_id: number;
|
|
49
|
+
stage_id: number;
|
|
50
|
+
action_id: number;
|
|
51
|
+
},
|
|
52
|
+
) {
|
|
53
|
+
const loggedInUser = req.user.userData;
|
|
54
|
+
const result = this.taskService.moveTask(loggedInUser, body);
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Controller,
|
|
3
|
+
Get,
|
|
4
|
+
Query,
|
|
5
|
+
Post,
|
|
6
|
+
Body,
|
|
7
|
+
Req,
|
|
8
|
+
UseGuards,
|
|
9
|
+
} from '@nestjs/common';
|
|
10
|
+
import { WorkflowMetaService } from '../service/workflow-meta.service';
|
|
11
|
+
import { StageMovementData } from '../entity/stage-movement-data.entity';
|
|
12
|
+
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
13
|
+
|
|
14
|
+
@Controller('workflow-meta')
|
|
15
|
+
@UseGuards(JwtAuthGuard)
|
|
16
|
+
export class WorkflowMetaController {
|
|
17
|
+
constructor(private readonly workflowMetaService: WorkflowMetaService) {}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* GET /meta/current-stage?entityType=...&entityId=...
|
|
21
|
+
*/
|
|
22
|
+
@Get('current-stage')
|
|
23
|
+
async getCurrentStage(
|
|
24
|
+
@Query('entityType') mapped_entity_type: string,
|
|
25
|
+
@Query('entityId') mapped_entity_id: number,
|
|
26
|
+
@Req() req: Request & { user: any },
|
|
27
|
+
): Promise<StageMovementData | null> {
|
|
28
|
+
let loggedInUser = req.user.userData;
|
|
29
|
+
|
|
30
|
+
return this.workflowMetaService.getCurrentStage(
|
|
31
|
+
mapped_entity_type,
|
|
32
|
+
Number(mapped_entity_id),
|
|
33
|
+
loggedInUser,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* GET /meta/next-stage?entityType=...&entityId=...
|
|
39
|
+
*/
|
|
40
|
+
@Get('next-stage')
|
|
41
|
+
async getNextStage(
|
|
42
|
+
@Query('entityType') mapped_entity_type: string,
|
|
43
|
+
@Query('entityId') mapped_entity_id: number,
|
|
44
|
+
@Req() req: Request & { user: any },
|
|
45
|
+
): Promise<number | null> {
|
|
46
|
+
const loggedInUser = req.user.userData;
|
|
47
|
+
const current = await this.workflowMetaService.getCurrentStage(
|
|
48
|
+
mapped_entity_type,
|
|
49
|
+
Number(mapped_entity_id),
|
|
50
|
+
loggedInUser,
|
|
51
|
+
);
|
|
52
|
+
return current ? this.workflowMetaService.getNextStage(current) : null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* POST /meta/move-next-stage
|
|
57
|
+
* {
|
|
58
|
+
* "entityType": "lead",
|
|
59
|
+
* "entityId": 101,
|
|
60
|
+
* "currentUserId": 5
|
|
61
|
+
* }
|
|
62
|
+
*/
|
|
63
|
+
@Post('move-next-stage')
|
|
64
|
+
async moveToNextStage(
|
|
65
|
+
@Body('entityType') mapped_entity_type: string,
|
|
66
|
+
@Body('entityId') mapped_entity_id: number,
|
|
67
|
+
@Req() req: Request & { user: any },
|
|
68
|
+
): Promise<string> {
|
|
69
|
+
const loggedInUser = req.user.userData;
|
|
70
|
+
return this.workflowMetaService.moveToNextStage(
|
|
71
|
+
mapped_entity_type,
|
|
72
|
+
Number(mapped_entity_id),
|
|
73
|
+
loggedInUser,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -9,28 +9,34 @@ import {
|
|
|
9
9
|
Get,
|
|
10
10
|
Param,
|
|
11
11
|
Put,
|
|
12
|
+
Inject,
|
|
13
|
+
Delete,
|
|
12
14
|
} from '@nestjs/common';
|
|
13
15
|
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
14
16
|
import { WorkflowService } from '../service/workflow.service';
|
|
15
|
-
import {
|
|
17
|
+
import { PopulateWorkflowService } from '../service/populate-workflow.service';
|
|
16
18
|
|
|
17
19
|
@Controller('/workflow')
|
|
18
20
|
@UseGuards(JwtAuthGuard)
|
|
19
21
|
export class WorkflowController {
|
|
20
|
-
constructor(
|
|
22
|
+
constructor(
|
|
23
|
+
@Inject('WorkflowService')
|
|
24
|
+
private readonly workflowService: WorkflowService,
|
|
25
|
+
private readonly populateWorkflowService: PopulateWorkflowService,
|
|
26
|
+
) {}
|
|
21
27
|
|
|
22
|
-
@Post('/
|
|
28
|
+
@Post('/getAllWorkflows')
|
|
23
29
|
@HttpCode(HttpStatus.OK)
|
|
24
|
-
async
|
|
25
|
-
@Body() body: { entity_type: string },
|
|
30
|
+
async getAllWorkflows(
|
|
26
31
|
@Req() req: Request & { user: any },
|
|
32
|
+
@Body() body: { entity_type: string },
|
|
27
33
|
) {
|
|
28
|
-
const
|
|
29
|
-
|
|
34
|
+
const { level_id, level_type } = req.user.userData;
|
|
35
|
+
return this.workflowService.getAllWorkflows(
|
|
30
36
|
body.entity_type,
|
|
31
|
-
|
|
37
|
+
level_id,
|
|
38
|
+
level_type,
|
|
32
39
|
);
|
|
33
|
-
return result;
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
@Get('/getWorkflowById/:id')
|
|
@@ -38,10 +44,24 @@ export class WorkflowController {
|
|
|
38
44
|
async getWorkflowById(@Param('id') id: number) {
|
|
39
45
|
return this.workflowService.getWorkflowById(id);
|
|
40
46
|
}
|
|
47
|
+
SS;
|
|
41
48
|
|
|
42
|
-
@Post('/
|
|
49
|
+
@Post('/updateSequence')
|
|
43
50
|
@HttpCode(HttpStatus.OK)
|
|
44
|
-
async
|
|
45
|
-
|
|
51
|
+
async updateSequence(@Body() body: any, @Req() req: Request & { user: any }) {
|
|
52
|
+
const loggedInUser = req.user?.userData;
|
|
53
|
+
return this.workflowService.updateSequence(body, loggedInUser);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@Post('/populateWorkflow')
|
|
57
|
+
async populateWorkflow(
|
|
58
|
+
@Body() body: any,
|
|
59
|
+
@Req() req: Request & { user: any },
|
|
60
|
+
) {
|
|
61
|
+
const loggedInUser = req.user?.userData;
|
|
62
|
+
return this.populateWorkflowService.populateWorkflowData(
|
|
63
|
+
body.organization_id,
|
|
64
|
+
loggedInUser,
|
|
65
|
+
);
|
|
46
66
|
}
|
|
47
67
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
2
|
+
import { Column, Entity } from 'typeorm';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'cr_wf_action_data' })
|
|
5
|
+
export class ActionDataEntity extends BaseEntity {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.entity_type = 'ACTION_DATA';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Column({ nullable: true })
|
|
12
|
+
action_id: number;
|
|
13
|
+
|
|
14
|
+
@Column({ nullable: true })
|
|
15
|
+
user_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ nullable: true })
|
|
18
|
+
stage_id: number;
|
|
19
|
+
|
|
20
|
+
@Column({ nullable: true })
|
|
21
|
+
start_time: Date;
|
|
22
|
+
|
|
23
|
+
@Column({ nullable: true })
|
|
24
|
+
end_time: Date;
|
|
25
|
+
|
|
26
|
+
@Column({ nullable: true })
|
|
27
|
+
is_mandatory: boolean;
|
|
28
|
+
|
|
29
|
+
@Column({ nullable: true })
|
|
30
|
+
mapped_entity_id: number;
|
|
31
|
+
|
|
32
|
+
@Column({ nullable: true })
|
|
33
|
+
mapped_entity_type: string;
|
|
34
|
+
|
|
35
|
+
@Column({ nullable: true })
|
|
36
|
+
sequence: number;
|
|
37
|
+
|
|
38
|
+
@Column({ default: 0 })
|
|
39
|
+
is_done: boolean;
|
|
40
|
+
|
|
41
|
+
@Column({ type: 'varchar', nullable: true })
|
|
42
|
+
is_current: string;
|
|
43
|
+
}
|
|
@@ -3,7 +3,7 @@ import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
|
3
3
|
import { Column, Entity } from 'typeorm';
|
|
4
4
|
|
|
5
5
|
@Entity({ name: 'cr_wf_action' })
|
|
6
|
-
export class
|
|
6
|
+
export class ActionEntity extends BaseEntity {
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
9
9
|
this.entity_type = ACTION;
|
|
@@ -12,9 +12,24 @@ export class Action extends BaseEntity {
|
|
|
12
12
|
@Column({ type: 'int', nullable: true })
|
|
13
13
|
workflow_id: number;
|
|
14
14
|
|
|
15
|
-
@Column({ type: '
|
|
16
|
-
|
|
15
|
+
@Column({ type: 'varchar', nullable: true })
|
|
16
|
+
action_category: string;
|
|
17
17
|
|
|
18
18
|
@Column({ type: 'varchar', nullable: true })
|
|
19
19
|
action_requirement: string;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'varchar', nullable: true })
|
|
22
|
+
sequence: string;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'varchar', nullable: true })
|
|
25
|
+
reason_code: string;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'varchar', nullable: true })
|
|
28
|
+
default_reason_code: string;
|
|
29
|
+
|
|
30
|
+
@Column({ default: 0, type: 'boolean' })
|
|
31
|
+
default_value: boolean;
|
|
32
|
+
|
|
33
|
+
@Column({ nullable: true })
|
|
34
|
+
user_id: number;
|
|
20
35
|
}
|
|
@@ -9,6 +9,23 @@ export class CommTemplate extends BaseEntity {
|
|
|
9
9
|
this.entity_type = COMM_TEMPLATE;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
@Column({
|
|
12
|
+
@Column({ nullable: true })
|
|
13
13
|
mode: string;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'varchar', nullable: true })
|
|
16
|
+
mapped_entity_type: string;
|
|
17
|
+
|
|
18
|
+
@Column({ nullable: true })
|
|
19
|
+
subject: string;
|
|
20
|
+
|
|
21
|
+
@Column({ nullable: true })
|
|
22
|
+
format_type: string;
|
|
23
|
+
|
|
24
|
+
// if format_type is 'richtext', this field will be used
|
|
25
|
+
@Column({ type: 'longtext', nullable: true })
|
|
26
|
+
rich_text: string;
|
|
27
|
+
|
|
28
|
+
// if format_type is 'markup', this field will be used
|
|
29
|
+
@Column({ nullable: true })
|
|
30
|
+
markup_id: number;
|
|
14
31
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ENTITY_MODIFICATION } from 'src/constant/global.constant';
|
|
2
|
+
import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
3
|
+
import { Column, Entity } from 'typeorm';
|
|
4
|
+
|
|
5
|
+
@Entity({ name: 'cr_wf_entity_modification' })
|
|
6
|
+
export class EntityModification extends BaseEntity {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.entity_type = ENTITY_MODIFICATION;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'int', nullable: true })
|
|
13
|
+
mapped_entity_id: number;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'varchar', nullable: true })
|
|
16
|
+
mapped_entity_type: string;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'varchar', nullable: true })
|
|
19
|
+
mode: string;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'int', nullable: true })
|
|
22
|
+
stage_id: number;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'int', nullable: true })
|
|
25
|
+
action_id: number;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'varchar', nullable: true })
|
|
28
|
+
attribute_key: string;
|
|
29
|
+
|
|
30
|
+
@Column({ type: 'varchar', nullable: true })
|
|
31
|
+
current_value: string;
|
|
32
|
+
|
|
33
|
+
@Column({ type: 'varchar', nullable: true })
|
|
34
|
+
new_value: string;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'varchar', nullable: true })
|
|
37
|
+
reason_code: string;
|
|
38
|
+
}
|
|
@@ -15,6 +15,12 @@ export class StageMovementData extends BaseEntity {
|
|
|
15
15
|
@Column({ type: 'int', nullable: true })
|
|
16
16
|
stage_action_mapping_id: number;
|
|
17
17
|
|
|
18
|
+
@Column({ type: 'int', nullable: true })
|
|
19
|
+
stage_group_id: number;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'int', nullable: true })
|
|
22
|
+
stage_id: number;
|
|
23
|
+
|
|
18
24
|
@Column({ type: 'date', nullable: true })
|
|
19
25
|
start_date: Date;
|
|
20
26
|
|
|
@@ -23,4 +29,10 @@ export class StageMovementData extends BaseEntity {
|
|
|
23
29
|
|
|
24
30
|
@Column({ type: 'varchar', nullable: true })
|
|
25
31
|
is_current: string;
|
|
32
|
+
|
|
33
|
+
@Column({ type: 'varchar', nullable: true })
|
|
34
|
+
mapped_entity_type: string;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'int', nullable: true })
|
|
37
|
+
mapped_entity_id: number;
|
|
26
38
|
}
|
|
@@ -12,9 +12,9 @@ export class Stage extends BaseEntity {
|
|
|
12
12
|
@Column({ type: 'int', nullable: true })
|
|
13
13
|
stage_group_id: number;
|
|
14
14
|
|
|
15
|
-
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
16
|
-
full_name: string;
|
|
17
|
-
|
|
18
15
|
@Column({ type: 'int', nullable: true })
|
|
19
|
-
|
|
16
|
+
sequence: number;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'varchar', nullable: true })
|
|
19
|
+
description: string;
|
|
20
20
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
2
|
+
import { Column, Entity } from 'typeorm';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'cr_wf_task_data' })
|
|
5
|
+
export class TaskDataEntity extends BaseEntity {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.entity_type = 'TASK';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Column({ nullable: true })
|
|
12
|
+
task_id: string;
|
|
13
|
+
|
|
14
|
+
@Column({ nullable: true })
|
|
15
|
+
user_id: string;
|
|
16
|
+
|
|
17
|
+
@Column({ nullable: true })
|
|
18
|
+
stage_id: string;
|
|
19
|
+
|
|
20
|
+
@Column({ nullable: true })
|
|
21
|
+
action_id: string;
|
|
22
|
+
|
|
23
|
+
@Column({ nullable: true })
|
|
24
|
+
start_time: Date;
|
|
25
|
+
|
|
26
|
+
@Column({ nullable: true })
|
|
27
|
+
end_time: Date;
|
|
28
|
+
|
|
29
|
+
@Column({ nullable: true })
|
|
30
|
+
is_completed: boolean;
|
|
31
|
+
|
|
32
|
+
@Column({ default: 0 })
|
|
33
|
+
is_system: boolean;
|
|
34
|
+
|
|
35
|
+
@Column({ nullable: true })
|
|
36
|
+
is_mandatory: boolean;
|
|
37
|
+
|
|
38
|
+
@Column({ nullable: true })
|
|
39
|
+
mapped_entity_id: number;
|
|
40
|
+
|
|
41
|
+
@Column({ nullable: true })
|
|
42
|
+
mapped_entity_type: string;
|
|
43
|
+
|
|
44
|
+
@Column({ nullable: true })
|
|
45
|
+
sequence: number;
|
|
46
|
+
|
|
47
|
+
@Column({ default: 0 })
|
|
48
|
+
is_done: boolean;
|
|
49
|
+
|
|
50
|
+
@Column({ nullable: true })
|
|
51
|
+
task_status: string;
|
|
52
|
+
|
|
53
|
+
@Column({ nullable: true })
|
|
54
|
+
task_name: string;
|
|
55
|
+
|
|
56
|
+
@Column({ nullable: true, type: 'varchar', length: 1000 })
|
|
57
|
+
description: string;
|
|
58
|
+
|
|
59
|
+
@Column({ nullable: true })
|
|
60
|
+
task_owner: string;
|
|
61
|
+
|
|
62
|
+
@Column({ nullable: true, type: 'varchar' })
|
|
63
|
+
due_date: Date;
|
|
64
|
+
|
|
65
|
+
@Column({ nullable: true, type: 'varchar' })
|
|
66
|
+
due_time: string;
|
|
67
|
+
|
|
68
|
+
@Column({ nullable: true, type: 'varchar' })
|
|
69
|
+
type: string;
|
|
70
|
+
|
|
71
|
+
@Column({ nullable: true, type: 'varchar' })
|
|
72
|
+
mode: string;
|
|
73
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
@Entity({ name: 'cr_wf_tem_attach_mapper' })
|
|
4
|
+
export class TemplateAttach {
|
|
5
|
+
constructor() {}
|
|
6
|
+
|
|
7
|
+
@PrimaryGeneratedColumn()
|
|
8
|
+
id: number;
|
|
9
|
+
|
|
10
|
+
@Column({})
|
|
11
|
+
entity_type: string;
|
|
12
|
+
|
|
13
|
+
@Column({ nullable: true })
|
|
14
|
+
template_id: number;
|
|
15
|
+
|
|
16
|
+
@Column({ nullable: true })
|
|
17
|
+
media_id: number;
|
|
18
|
+
|
|
19
|
+
@Column({ nullable: true })
|
|
20
|
+
organization_id: number;
|
|
21
|
+
|
|
22
|
+
@Column({ nullable: true })
|
|
23
|
+
appcode: string;
|
|
24
|
+
|
|
25
|
+
@Column({ nullable: true })
|
|
26
|
+
level_id: string;
|
|
27
|
+
|
|
28
|
+
@Column({ nullable: true })
|
|
29
|
+
level_type: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
@Entity({ name: 'cr_workflow_level_mapping' })
|
|
4
|
+
export class WorkflowLevelMappingEntity {
|
|
5
|
+
constructor() {}
|
|
6
|
+
|
|
7
|
+
@PrimaryGeneratedColumn()
|
|
8
|
+
id: number;
|
|
9
|
+
|
|
10
|
+
@Column({ nullable: true })
|
|
11
|
+
workflow_id: number;
|
|
12
|
+
|
|
13
|
+
@Column({ nullable: true })
|
|
14
|
+
mapped_level_id: string;
|
|
15
|
+
|
|
16
|
+
@Column({ nullable: true })
|
|
17
|
+
mapped_level_type: string;
|
|
18
|
+
}
|
|
@@ -11,4 +11,10 @@ export class Workflow extends BaseEntity {
|
|
|
11
11
|
|
|
12
12
|
@Column({ type: 'varchar', nullable: true })
|
|
13
13
|
mapped_entity_type: string;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'boolean', nullable: true })
|
|
16
|
+
is_default: boolean;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'boolean', nullable: true })
|
|
19
|
+
is_factory: boolean;
|
|
14
20
|
}
|