law-common 12.6.3-beta.2 → 12.6.3-beta.3
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/README.md +1 -1
- package/dist/src/api/index.d.ts +0 -2
- package/dist/src/api/index.js +0 -2
- package/dist/src/entities/enums/task.action.enum.d.ts +8 -0
- package/dist/src/entities/enums/task.action.enum.js +12 -0
- package/dist/src/entities/enums/task.entity.enum.d.ts +0 -5
- package/dist/src/entities/enums/task.entity.enum.js +1 -7
- package/dist/src/entities/enums/task_status.enum.d.ts +5 -0
- package/dist/src/entities/enums/task_status.enum.js +9 -0
- package/dist/src/entities/flow-configs/task_flow.config.d.ts +6 -0
- package/dist/src/entities/flow-configs/task_flow.config.js +77 -0
- package/dist/src/entities/index.d.ts +3 -4
- package/dist/src/entities/index.js +3 -4
- package/dist/src/entities/interface/industry.entity.interface.d.ts +2 -4
- package/dist/src/entities/interface/task.entity.interface.d.ts +2 -1
- package/dist/src/entities/model/industry.entity.model.d.ts +3 -21
- package/dist/src/entities/model/industry.entity.model.js +1 -65
- package/dist/src/entities/model/task.entity.model.d.ts +20 -1
- package/dist/src/entities/model/task.entity.model.js +65 -1
- package/package.json +56 -56
- package/dist/src/api/interface/industry.create.dto.interface.d.ts +0 -5
- package/dist/src/api/interface/industry.create.dto.interface.js +0 -2
- package/dist/src/api/interface/industry.update.dto.interface.d.ts +0 -17
- package/dist/src/api/interface/industry.update.dto.interface.js +0 -17
- package/dist/src/entities/enums/industry_status_enum.d.ts +0 -5
- package/dist/src/entities/enums/industry_status_enum.js +0 -9
- package/dist/src/entities/flow-configs/industry_flow.config.d.ts +0 -6
- package/dist/src/entities/flow-configs/industry_flow.config.js +0 -70
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# law-common
|
|
1
|
+
# law-common
|
package/dist/src/api/index.d.ts
CHANGED
|
@@ -117,5 +117,3 @@ export * from "./interface/client_debit_note.create.dto.interface";
|
|
|
117
117
|
export * from "./interface/client_debit_note.update.dto.interface";
|
|
118
118
|
export * from "./interface/client_debit_note_particulars.create.dto.interface";
|
|
119
119
|
export * from "./interface/client_debit_note_particulars.update.dto.interface";
|
|
120
|
-
export * from "./interface/industry.create.dto.interface";
|
|
121
|
-
export * from "./interface/industry.update.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -137,5 +137,3 @@ __exportStar(require("./interface/client_debit_note.create.dto.interface"), expo
|
|
|
137
137
|
__exportStar(require("./interface/client_debit_note.update.dto.interface"), exports);
|
|
138
138
|
__exportStar(require("./interface/client_debit_note_particulars.create.dto.interface"), exports);
|
|
139
139
|
__exportStar(require("./interface/client_debit_note_particulars.update.dto.interface"), exports);
|
|
140
|
-
__exportStar(require("./interface/industry.create.dto.interface"), exports);
|
|
141
|
-
__exportStar(require("./interface/industry.update.dto.interface"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskActionEnum = void 0;
|
|
4
|
+
var TaskActionEnum;
|
|
5
|
+
(function (TaskActionEnum) {
|
|
6
|
+
TaskActionEnum["CREATE"] = "create";
|
|
7
|
+
TaskActionEnum["UPDATE"] = "update";
|
|
8
|
+
TaskActionEnum["DELETE"] = "delete";
|
|
9
|
+
TaskActionEnum["DEACTIVATE"] = "deactivate";
|
|
10
|
+
TaskActionEnum["ACTIVATE"] = "activate";
|
|
11
|
+
TaskActionEnum["RESTORE"] = "restore";
|
|
12
|
+
})(TaskActionEnum || (exports.TaskActionEnum = TaskActionEnum = {}));
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaskTypeEnum =
|
|
4
|
-
var TaskStatusEnum;
|
|
5
|
-
(function (TaskStatusEnum) {
|
|
6
|
-
TaskStatusEnum["active"] = "active";
|
|
7
|
-
TaskStatusEnum["deactive"] = "deactive";
|
|
8
|
-
TaskStatusEnum["deleted"] = "deleted";
|
|
9
|
-
})(TaskStatusEnum || (exports.TaskStatusEnum = TaskStatusEnum = {}));
|
|
3
|
+
exports.TaskTypeEnum = void 0;
|
|
10
4
|
var TaskTypeEnum;
|
|
11
5
|
(function (TaskTypeEnum) {
|
|
12
6
|
TaskTypeEnum["billable"] = "billable";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskStatusEnum = void 0;
|
|
4
|
+
var TaskStatusEnum;
|
|
5
|
+
(function (TaskStatusEnum) {
|
|
6
|
+
TaskStatusEnum["active"] = "active";
|
|
7
|
+
TaskStatusEnum["deactive"] = "deactive";
|
|
8
|
+
TaskStatusEnum["deleted"] = "deleted";
|
|
9
|
+
})(TaskStatusEnum || (exports.TaskStatusEnum = TaskStatusEnum = {}));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TaskActionEnum } from "../enums/task.action.enum";
|
|
2
|
+
import { TaskStatusEnum } from "../enums/task_status.enum";
|
|
3
|
+
import { FlowConfig } from "./flow-config.type";
|
|
4
|
+
export interface ITaskFlowConfigContextData {
|
|
5
|
+
}
|
|
6
|
+
export declare const taskFlowConfig: FlowConfig<TaskStatusEnum, TaskActionEnum, ITaskFlowConfigContextData>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.taskFlowConfig = void 0;
|
|
4
|
+
const task_action_enum_1 = require("../enums/task.action.enum");
|
|
5
|
+
const task_status_enum_1 = require("../enums/task_status.enum");
|
|
6
|
+
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
7
|
+
const WORK_TEMPLATES_CREATE_PERMISSION = ["WORK_TEMPLATES_CREATE"];
|
|
8
|
+
const WORK_TEMPLATES_UPDATE_PERMISSION = ["WORK_TEMPLATES_UPDATE"];
|
|
9
|
+
const WORK_TEMPLATES_DELETE_PERMISSION = ["WORK_TEMPLATES_DELETE"];
|
|
10
|
+
const WORK_TEMPLATES_DEACTIVATE_PERMISSION = ["WORK_TEMPLATES_DEACTIVATE"];
|
|
11
|
+
const WORK_TEMPLATES_ACTIVATE_PERMISSION = ["WORK_TEMPLATES_ACTIVATE"];
|
|
12
|
+
const WORK_TEMPLATES_RESTORE_PERMISSION = ["WORK_TEMPLATES_RESTORE"];
|
|
13
|
+
const ACTION_MAP = {
|
|
14
|
+
[task_action_enum_1.TaskActionEnum.CREATE]: {
|
|
15
|
+
reachableStatues: [task_status_enum_1.TaskStatusEnum.active],
|
|
16
|
+
permissions: WORK_TEMPLATES_CREATE_PERMISSION,
|
|
17
|
+
},
|
|
18
|
+
[task_action_enum_1.TaskActionEnum.UPDATE]: {
|
|
19
|
+
reachableStatues: [task_status_enum_1.TaskStatusEnum.active],
|
|
20
|
+
permissions: WORK_TEMPLATES_UPDATE_PERMISSION,
|
|
21
|
+
},
|
|
22
|
+
[task_action_enum_1.TaskActionEnum.DELETE]: {
|
|
23
|
+
reachableStatues: [task_status_enum_1.TaskStatusEnum.deleted],
|
|
24
|
+
permissions: WORK_TEMPLATES_DELETE_PERMISSION,
|
|
25
|
+
},
|
|
26
|
+
[task_action_enum_1.TaskActionEnum.DEACTIVATE]: {
|
|
27
|
+
reachableStatues: [task_status_enum_1.TaskStatusEnum.deactive],
|
|
28
|
+
permissions: WORK_TEMPLATES_DEACTIVATE_PERMISSION,
|
|
29
|
+
},
|
|
30
|
+
[task_action_enum_1.TaskActionEnum.ACTIVATE]: {
|
|
31
|
+
reachableStatues: [task_status_enum_1.TaskStatusEnum.active],
|
|
32
|
+
permissions: WORK_TEMPLATES_ACTIVATE_PERMISSION,
|
|
33
|
+
},
|
|
34
|
+
[task_action_enum_1.TaskActionEnum.RESTORE]: {
|
|
35
|
+
reachableStatues: [task_status_enum_1.TaskStatusEnum.active],
|
|
36
|
+
permissions: WORK_TEMPLATES_RESTORE_PERMISSION,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
40
|
+
// active status transition
|
|
41
|
+
const transitionActiveStatusUpdateAction = createActionConfig(task_action_enum_1.TaskActionEnum.UPDATE, task_status_enum_1.TaskStatusEnum.active);
|
|
42
|
+
const transitionActiveStatusDeleteAction = createActionConfig(task_action_enum_1.TaskActionEnum.DELETE, task_status_enum_1.TaskStatusEnum.deleted);
|
|
43
|
+
const transitionActiveStatusDeactiveAction = createActionConfig(task_action_enum_1.TaskActionEnum.DEACTIVATE, task_status_enum_1.TaskStatusEnum.deactive);
|
|
44
|
+
// deactive status transition
|
|
45
|
+
const transitionDeactivetedStatusDeleteAction = createActionConfig(task_action_enum_1.TaskActionEnum.DELETE, task_status_enum_1.TaskStatusEnum.deleted);
|
|
46
|
+
const transitionDeactivatedStatusActivateAction = createActionConfig(task_action_enum_1.TaskActionEnum.ACTIVATE, task_status_enum_1.TaskStatusEnum.active);
|
|
47
|
+
// deleted status transitions
|
|
48
|
+
const transitionDeletedStatusUpdateAction = createActionConfig(task_action_enum_1.TaskActionEnum.UPDATE, task_status_enum_1.TaskStatusEnum.active);
|
|
49
|
+
const transitionDeletedStatusRestoreAction = createActionConfig(task_action_enum_1.TaskActionEnum.RESTORE, task_status_enum_1.TaskStatusEnum.active);
|
|
50
|
+
exports.taskFlowConfig = {
|
|
51
|
+
[task_status_enum_1.TaskStatusEnum.active]: {
|
|
52
|
+
actions: {
|
|
53
|
+
// update
|
|
54
|
+
[task_action_enum_1.TaskActionEnum.UPDATE]: transitionActiveStatusUpdateAction,
|
|
55
|
+
// delete
|
|
56
|
+
[task_action_enum_1.TaskActionEnum.DELETE]: transitionActiveStatusDeleteAction,
|
|
57
|
+
// deactivate
|
|
58
|
+
[task_action_enum_1.TaskActionEnum.DEACTIVATE]: transitionActiveStatusDeactiveAction,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
[task_status_enum_1.TaskStatusEnum.deactive]: {
|
|
62
|
+
actions: {
|
|
63
|
+
// delete
|
|
64
|
+
[task_action_enum_1.TaskActionEnum.DELETE]: transitionDeactivetedStatusDeleteAction,
|
|
65
|
+
// activate
|
|
66
|
+
[task_action_enum_1.TaskActionEnum.ACTIVATE]: transitionDeactivatedStatusActivateAction,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
[task_status_enum_1.TaskStatusEnum.deleted]: {
|
|
70
|
+
actions: {
|
|
71
|
+
// update
|
|
72
|
+
[task_action_enum_1.TaskActionEnum.UPDATE]: transitionDeletedStatusUpdateAction,
|
|
73
|
+
// restore
|
|
74
|
+
[task_action_enum_1.TaskActionEnum.RESTORE]: transitionDeletedStatusRestoreAction,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -265,7 +265,6 @@ export * from "./interface/debit_note_sequence_generator.entity.interface";
|
|
|
265
265
|
export * from "./model/debit_note_sequence_generator.entity.model";
|
|
266
266
|
export * from "./enums/client_debit_note_gst_visible_enum";
|
|
267
267
|
export * from "./enums/client_debit_note_pan_visible_enum";
|
|
268
|
-
export * from "./enums/
|
|
269
|
-
export * from "./
|
|
270
|
-
export * from "./
|
|
271
|
-
export * from "./model/industry.entity.model";
|
|
268
|
+
export * from "./enums/task.action.enum";
|
|
269
|
+
export * from "./enums/task_status.enum";
|
|
270
|
+
export * from "./flow-configs/task_flow.config";
|
|
@@ -282,7 +282,6 @@ __exportStar(require("./interface/debit_note_sequence_generator.entity.interface
|
|
|
282
282
|
__exportStar(require("./model/debit_note_sequence_generator.entity.model"), exports);
|
|
283
283
|
__exportStar(require("./enums/client_debit_note_gst_visible_enum"), exports);
|
|
284
284
|
__exportStar(require("./enums/client_debit_note_pan_visible_enum"), exports);
|
|
285
|
-
__exportStar(require("./enums/
|
|
286
|
-
__exportStar(require("./
|
|
287
|
-
__exportStar(require("./
|
|
288
|
-
__exportStar(require("./model/industry.entity.model"), exports);
|
|
285
|
+
__exportStar(require("./enums/task.action.enum"), exports);
|
|
286
|
+
__exportStar(require("./enums/task_status.enum"), exports);
|
|
287
|
+
__exportStar(require("./flow-configs/task_flow.config"), exports);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
-
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto
|
|
3
|
-
import { IndustryStatusEnum } from "../enums/industry_status_enum";
|
|
2
|
+
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
4
3
|
export interface IIndustryEntity extends IEntityAuditColumn {
|
|
5
4
|
id: number;
|
|
6
5
|
name: string;
|
|
7
|
-
description?:
|
|
8
|
-
status: IndustryStatusEnum;
|
|
6
|
+
description?: string;
|
|
9
7
|
}
|
|
10
8
|
export interface IIndustryEntityCreateDto extends IEntityCreateDto<IIndustryEntity> {
|
|
11
9
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TaskTypeEnum } from "../enums/task.entity.enum";
|
|
2
|
+
import { TaskStatusEnum } from "../enums/task_status.enum";
|
|
2
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
4
|
import { IEntityFilterData } from "./entity.utils.interface";
|
|
4
5
|
export interface ITaskEntity extends IEntityAuditColumn {
|
|
@@ -1,34 +1,16 @@
|
|
|
1
1
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
-
import { BaseEntityModel } from "./base.entity.model";
|
|
3
|
-
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
|
-
import { IUserEntity } from "../interface/user.entity.interface";
|
|
5
|
-
import { UserEntityModel } from "./user.entity.model";
|
|
6
|
-
import { IRowActions } from "./interface/row-actions.interface";
|
|
7
2
|
import { IIndustryEntity } from "../interface/industry.entity.interface";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { IIndustryFlowConfigContextData } from "../flow-configs/industry_flow.config";
|
|
3
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
11
5
|
export declare class IndustryEntityModel extends BaseEntityModel<EntityEnum.INDUSTRY> implements IIndustryEntity {
|
|
12
6
|
id: number;
|
|
13
7
|
name: string;
|
|
14
8
|
description?: string;
|
|
15
|
-
status: IndustryStatusEnum;
|
|
16
9
|
createdOn: number;
|
|
17
10
|
updatedOn: number;
|
|
18
11
|
createdBy: number;
|
|
19
12
|
updatedBy: number;
|
|
20
13
|
static relationConfigs: RelationConfigs<[], EntityEnum.INDUSTRY>;
|
|
21
14
|
static fromEntity(entity: IIndustryEntity): IndustryEntityModel;
|
|
22
|
-
getRelationConfigs():
|
|
23
|
-
getNextStatus(currentUser: IUserEntity, action: IndustryActionEnum, industryFlowConfigContextData: IIndustryFlowConfigContextData): IndustryStatusEnum;
|
|
24
|
-
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
25
|
-
combinedActions?: Record<string, {
|
|
26
|
-
combineActions: IndustryActionEnum[];
|
|
27
|
-
label: string;
|
|
28
|
-
}>;
|
|
29
|
-
customLabels?: Partial<Record<IndustryActionEnum, string>>;
|
|
30
|
-
}): IRowActions<EntityEnum.INDUSTRY>[];
|
|
31
|
-
getUpdateActionVisibility(currentUser: UserEntityModel): {
|
|
32
|
-
[key: string]: () => boolean;
|
|
33
|
-
};
|
|
15
|
+
getRelationConfigs(): [];
|
|
34
16
|
}
|
|
@@ -3,17 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.IndustryEntityModel = void 0;
|
|
4
4
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
5
|
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
-
const exceptions_1 = require("../../exceptions");
|
|
7
|
-
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
8
|
-
const utils_1 = require("../../utils");
|
|
9
|
-
const industry_status_enum_1 = require("../enums/industry_status_enum");
|
|
10
|
-
const industry_flow_config_1 = require("../flow-configs/industry_flow.config");
|
|
11
6
|
class IndustryEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
12
7
|
constructor() {
|
|
13
8
|
super(...arguments);
|
|
14
9
|
this.id = 0;
|
|
15
10
|
this.name = "";
|
|
16
|
-
this.status = industry_status_enum_1.IndustryStatusEnum.APPROVED;
|
|
17
11
|
this.createdOn = 0;
|
|
18
12
|
this.updatedOn = 0;
|
|
19
13
|
this.createdBy = 0;
|
|
@@ -25,65 +19,7 @@ class IndustryEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
25
19
|
return result;
|
|
26
20
|
}
|
|
27
21
|
getRelationConfigs() {
|
|
28
|
-
return
|
|
29
|
-
}
|
|
30
|
-
getNextStatus(currentUser, action, industryFlowConfigContextData) {
|
|
31
|
-
if (!this.status) {
|
|
32
|
-
throw new exceptions_1.AppBadRequestException({
|
|
33
|
-
key: error_key_enum_1.ErrorKeyEnum.STATUS,
|
|
34
|
-
message: [`Status not found: ${this.status}`],
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
const flowForStatus = industry_flow_config_1.industryFlowConfig[this.status];
|
|
38
|
-
if (!flowForStatus) {
|
|
39
|
-
throw new exceptions_1.AppBadRequestException({
|
|
40
|
-
key: error_key_enum_1.ErrorKeyEnum.STATUS,
|
|
41
|
-
message: [`No flow configuration found for status: ${this.status}`],
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
if (!action) {
|
|
45
|
-
throw new exceptions_1.AppBadRequestException({
|
|
46
|
-
key: error_key_enum_1.ErrorKeyEnum.ACTION_DATA,
|
|
47
|
-
message: ["actionData is required"],
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
const matchingPermissionConfig = flowForStatus.actions[action];
|
|
51
|
-
if (!matchingPermissionConfig) {
|
|
52
|
-
throw new exceptions_1.AppBadRequestException({
|
|
53
|
-
key: error_key_enum_1.ErrorKeyEnum.ACTION,
|
|
54
|
-
message: [`Action '${action}' is not valid for the current status.`],
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
if (!currentUser.permissions || currentUser.permissions.length === 0) {
|
|
58
|
-
throw new exceptions_1.AppBadRequestException({
|
|
59
|
-
key: error_key_enum_1.ErrorKeyEnum.PERMISSIONS,
|
|
60
|
-
message: ["Permission not available for currentUser"],
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
const hasPermission = matchingPermissionConfig.permissions.some((permission) => currentUser.permissions.includes(permission));
|
|
64
|
-
if (!hasPermission) {
|
|
65
|
-
throw new exceptions_1.AppBadRequestException({
|
|
66
|
-
key: error_key_enum_1.ErrorKeyEnum.PERMISSION,
|
|
67
|
-
message: [`Current user does not have permission to ${action} industry`],
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
const nextStatus = matchingPermissionConfig.next(industryFlowConfigContextData);
|
|
71
|
-
return nextStatus;
|
|
72
|
-
}
|
|
73
|
-
getAvailableActions(currentUser, config) {
|
|
74
|
-
var _a;
|
|
75
|
-
const params = {
|
|
76
|
-
flowConfig: industry_flow_config_1.industryFlowConfig,
|
|
77
|
-
currentStatus: this.status,
|
|
78
|
-
userPermissions: (_a = currentUser.permissions) !== null && _a !== void 0 ? _a : [],
|
|
79
|
-
visibilityData: this.getUpdateActionVisibility.bind(this, currentUser),
|
|
80
|
-
combinedActions: config === null || config === void 0 ? void 0 : config.combinedActions,
|
|
81
|
-
customLabels: config === null || config === void 0 ? void 0 : config.customLabels,
|
|
82
|
-
};
|
|
83
|
-
return utils_1.EntityActionFlowResolverV2.getAvailableActionsData(params);
|
|
84
|
-
}
|
|
85
|
-
getUpdateActionVisibility(currentUser) {
|
|
86
|
-
return {};
|
|
22
|
+
return IndustryEntityModel.relationConfigs;
|
|
87
23
|
}
|
|
88
24
|
}
|
|
89
25
|
exports.IndustryEntityModel = IndustryEntityModel;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TaskActionEnum } from "../enums/task.action.enum";
|
|
2
|
+
import { TaskTypeEnum } from "../enums/task.entity.enum";
|
|
3
|
+
import { TaskStatusEnum } from "../enums/task_status.enum";
|
|
4
|
+
import { ITaskFlowConfigContextData } from "../flow-configs/task_flow.config";
|
|
2
5
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
6
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
3
7
|
import { ITaskEntity } from "../interface/task.entity.interface";
|
|
8
|
+
import { IUserEntity } from "../interface/user.entity.interface";
|
|
4
9
|
import { BaseEntityModel } from "./base.entity.model";
|
|
10
|
+
import { IRowActions } from "./interface/row-actions.interface";
|
|
11
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
5
12
|
export declare class TaskEntityModel extends BaseEntityModel<EntityEnum.TASK> implements ITaskEntity {
|
|
6
13
|
id: number;
|
|
7
14
|
name: string;
|
|
@@ -13,5 +20,17 @@ export declare class TaskEntityModel extends BaseEntityModel<EntityEnum.TASK> im
|
|
|
13
20
|
createdOn: number;
|
|
14
21
|
updatedOn: number;
|
|
15
22
|
static fromEntity(entity: ITaskEntity): TaskEntityModel;
|
|
23
|
+
static relationConfigs: RelationConfigs<[], EntityEnum.TASK>;
|
|
16
24
|
getRelationConfigs(): any[];
|
|
25
|
+
getNextStatus(currentUser: IUserEntity, action: TaskActionEnum, taskFlowConfigContextData: ITaskFlowConfigContextData): TaskStatusEnum;
|
|
26
|
+
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
27
|
+
combinedActions?: Record<string, {
|
|
28
|
+
combineActions: TaskActionEnum[];
|
|
29
|
+
label: string;
|
|
30
|
+
}>;
|
|
31
|
+
customLabels?: Partial<Record<TaskActionEnum, string>>;
|
|
32
|
+
}): IRowActions<EntityEnum.TASK>[];
|
|
33
|
+
getUpdateActionVisibility(currentUser: UserEntityModel): {
|
|
34
|
+
[key: string]: () => boolean;
|
|
35
|
+
};
|
|
17
36
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TaskEntityModel = void 0;
|
|
4
|
+
const enums_1 = require("../../enums");
|
|
5
|
+
const exceptions_1 = require("../../exceptions");
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
4
7
|
const task_entity_enum_1 = require("../enums/task.entity.enum");
|
|
8
|
+
const task_status_enum_1 = require("../enums/task_status.enum");
|
|
9
|
+
const task_flow_config_1 = require("../flow-configs/task_flow.config");
|
|
5
10
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
11
|
const base_entity_model_1 = require("./base.entity.model");
|
|
7
12
|
class TaskEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
@@ -10,7 +15,7 @@ class TaskEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
10
15
|
this.id = 0;
|
|
11
16
|
this.name = "";
|
|
12
17
|
this.description = "";
|
|
13
|
-
this.status =
|
|
18
|
+
this.status = task_status_enum_1.TaskStatusEnum.active;
|
|
14
19
|
this.type = task_entity_enum_1.TaskTypeEnum.billable;
|
|
15
20
|
this.createdBy = 0;
|
|
16
21
|
this.updatedBy = 0;
|
|
@@ -25,5 +30,64 @@ class TaskEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
25
30
|
getRelationConfigs() {
|
|
26
31
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
27
32
|
}
|
|
33
|
+
getNextStatus(currentUser, action, taskFlowConfigContextData) {
|
|
34
|
+
if (!this.status) {
|
|
35
|
+
throw new exceptions_1.AppBadRequestException({
|
|
36
|
+
key: enums_1.ErrorKeyEnum.STATUS,
|
|
37
|
+
message: [`Status not found: ${this.status}`],
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const flowForStatus = task_flow_config_1.taskFlowConfig[this.status];
|
|
41
|
+
if (!flowForStatus) {
|
|
42
|
+
throw new exceptions_1.AppBadRequestException({
|
|
43
|
+
key: enums_1.ErrorKeyEnum.STATUS,
|
|
44
|
+
message: [`No flow configuration found for status: ${this.status}`],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (!action) {
|
|
48
|
+
throw new exceptions_1.AppBadRequestException({
|
|
49
|
+
key: enums_1.ErrorKeyEnum.ACTION_DATA,
|
|
50
|
+
message: ["actionData is required"],
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const matchingPermissionConfig = flowForStatus.actions[action];
|
|
54
|
+
if (!matchingPermissionConfig) {
|
|
55
|
+
throw new exceptions_1.AppBadRequestException({
|
|
56
|
+
key: enums_1.ErrorKeyEnum.ACTION,
|
|
57
|
+
message: [`Action '${action}' is not valid for the current status.`],
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (!currentUser.permissions || currentUser.permissions.length === 0) {
|
|
61
|
+
throw new exceptions_1.AppBadRequestException({
|
|
62
|
+
key: enums_1.ErrorKeyEnum.PERMISSIONS,
|
|
63
|
+
message: ["Permission not available for currentUser"],
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
const hasPermission = matchingPermissionConfig.permissions.some((permission) => currentUser.permissions.includes(permission));
|
|
67
|
+
if (!hasPermission) {
|
|
68
|
+
throw new exceptions_1.AppBadRequestException({
|
|
69
|
+
key: enums_1.ErrorKeyEnum.PERMISSION,
|
|
70
|
+
message: [`Current user does not have permission to ${action} vendorAdvance`],
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const nextStatus = matchingPermissionConfig.next(taskFlowConfigContextData);
|
|
74
|
+
return nextStatus;
|
|
75
|
+
}
|
|
76
|
+
getAvailableActions(currentUser, config) {
|
|
77
|
+
var _a;
|
|
78
|
+
const params = {
|
|
79
|
+
flowConfig: task_flow_config_1.taskFlowConfig,
|
|
80
|
+
currentStatus: this.status,
|
|
81
|
+
userPermissions: (_a = currentUser.permissions) !== null && _a !== void 0 ? _a : [],
|
|
82
|
+
visibilityData: this.getUpdateActionVisibility.bind(this, currentUser),
|
|
83
|
+
combinedActions: config === null || config === void 0 ? void 0 : config.combinedActions,
|
|
84
|
+
customLabels: config === null || config === void 0 ? void 0 : config.customLabels,
|
|
85
|
+
};
|
|
86
|
+
return utils_1.EntityActionFlowResolverV2.getAvailableActionsData(params);
|
|
87
|
+
}
|
|
88
|
+
getUpdateActionVisibility(currentUser) {
|
|
89
|
+
return {};
|
|
90
|
+
}
|
|
28
91
|
}
|
|
29
92
|
exports.TaskEntityModel = TaskEntityModel;
|
|
93
|
+
TaskEntityModel.relationConfigs = [];
|
package/package.json
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "12.6.3-beta.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist/**/*"
|
|
8
|
-
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"clean": "rm -rf dist",
|
|
11
|
-
"build": "npm run clean && tsc",
|
|
12
|
-
"publish:beta": "npm run build && npm version prerelease --preid beta && git push && npm publish --tag beta",
|
|
13
|
-
"publish:beta:link": "npm run build && npm version prerelease --preid beta && git push && npm publish --tag beta && npm run link",
|
|
14
|
-
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
15
|
-
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
16
|
-
"publish:major": "npm verYsion major && git push && npm run build && npm publish",
|
|
17
|
-
"link": "npm run build && npm link",
|
|
18
|
-
"link:backend": "npm run build && npm link && cd ../law-backend && npm link law-common && cd ../law-common",
|
|
19
|
-
"link:frontend": "npm run build && npm link && cd ../law-admin-web && npm link law-common && cd ../law-common",
|
|
20
|
-
"link:both": "npm run build && npm link && cd ../law-backend && npm link law-common && cd ../law-admin-web && npm link law-common && cd ../law-common",
|
|
21
|
-
"test": "jest",
|
|
22
|
-
"format": "prettier --write .",
|
|
23
|
-
"check-format": "prettier --check .",
|
|
24
|
-
"pull:link": "git pull && npm run link",
|
|
25
|
-
"check-version": "npm view law-common versions --json | jq -r '.[-1]'",
|
|
26
|
-
"script:publish": "node scripts/publish.js",
|
|
27
|
-
"script:publish:latest:beta": "npm run build && node scripts/publish.js prerelease beta && git push",
|
|
28
|
-
"script:publish:latest:patch": "npm run build && node scripts/publish.js patch && git push",
|
|
29
|
-
"script:nobuild:publish:latest:beta": "node scripts/publish.js prerelease beta && git push",
|
|
30
|
-
"install:version": "node scripts/install-version.js",
|
|
31
|
-
"script:publish:install:beta": "node scripts/publish-and-install.js prerelease beta",
|
|
32
|
-
"script:publish:install:patch": "node scripts/publish-and-install.js patch",
|
|
33
|
-
"script:publish:install:minor": "node scripts/publish-and-install.js minor",
|
|
34
|
-
"script:publish:install:major": "node scripts/publish-and-install.js major"
|
|
35
|
-
},
|
|
36
|
-
"keywords": [],
|
|
37
|
-
"author": "",
|
|
38
|
-
"license": "ISC",
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@types/jest": "^29.5.13",
|
|
41
|
-
"@types/lodash": "^4.17.21",
|
|
42
|
-
"@types/node": "^22.6.1",
|
|
43
|
-
"jest": "^29.7.0",
|
|
44
|
-
"prettier": "3.8.1",
|
|
45
|
-
"semver": "^7.8.1",
|
|
46
|
-
"ts-jest": "^29.2.5",
|
|
47
|
-
"ts-node": "^10.9.2",
|
|
48
|
-
"typescript": "^5.6.2"
|
|
49
|
-
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"@types/express": "^5.0.0",
|
|
52
|
-
"@types/multer": "^1.4.12",
|
|
53
|
-
"date-fns": "^4.1.0",
|
|
54
|
-
"lodash": "4.17.21"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "law-common",
|
|
3
|
+
"version": "12.6.3-beta.3",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/**/*"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"build": "npm run clean && tsc",
|
|
12
|
+
"publish:beta": "npm run build && npm version prerelease --preid beta && git push && npm publish --tag beta",
|
|
13
|
+
"publish:beta:link": "npm run build && npm version prerelease --preid beta && git push && npm publish --tag beta && npm run link",
|
|
14
|
+
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
15
|
+
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
16
|
+
"publish:major": "npm verYsion major && git push && npm run build && npm publish",
|
|
17
|
+
"link": "npm run build && npm link",
|
|
18
|
+
"link:backend": "npm run build && npm link && cd ../law-backend && npm link law-common && cd ../law-common",
|
|
19
|
+
"link:frontend": "npm run build && npm link && cd ../law-admin-web && npm link law-common && cd ../law-common",
|
|
20
|
+
"link:both": "npm run build && npm link && cd ../law-backend && npm link law-common && cd ../law-admin-web && npm link law-common && cd ../law-common",
|
|
21
|
+
"test": "jest",
|
|
22
|
+
"format": "prettier --write .",
|
|
23
|
+
"check-format": "prettier --check .",
|
|
24
|
+
"pull:link": "git pull && npm run link",
|
|
25
|
+
"check-version": "npm view law-common versions --json | jq -r '.[-1]'",
|
|
26
|
+
"script:publish": "node scripts/publish.js",
|
|
27
|
+
"script:publish:latest:beta": "npm run build && node scripts/publish.js prerelease beta && git push",
|
|
28
|
+
"script:publish:latest:patch": "npm run build && node scripts/publish.js patch && git push",
|
|
29
|
+
"script:nobuild:publish:latest:beta": "node scripts/publish.js prerelease beta && git push",
|
|
30
|
+
"install:version": "node scripts/install-version.js",
|
|
31
|
+
"script:publish:install:beta": "node scripts/publish-and-install.js prerelease beta",
|
|
32
|
+
"script:publish:install:patch": "node scripts/publish-and-install.js patch",
|
|
33
|
+
"script:publish:install:minor": "node scripts/publish-and-install.js minor",
|
|
34
|
+
"script:publish:install:major": "node scripts/publish-and-install.js major"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [],
|
|
37
|
+
"author": "",
|
|
38
|
+
"license": "ISC",
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/jest": "^29.5.13",
|
|
41
|
+
"@types/lodash": "^4.17.21",
|
|
42
|
+
"@types/node": "^22.6.1",
|
|
43
|
+
"jest": "^29.7.0",
|
|
44
|
+
"prettier": "3.8.1",
|
|
45
|
+
"semver": "^7.8.1",
|
|
46
|
+
"ts-jest": "^29.2.5",
|
|
47
|
+
"ts-node": "^10.9.2",
|
|
48
|
+
"typescript": "^5.6.2"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@types/express": "^5.0.0",
|
|
52
|
+
"@types/multer": "^1.4.12",
|
|
53
|
+
"date-fns": "^4.1.0",
|
|
54
|
+
"lodash": "4.17.21"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IEntityCreateDto } from "../../entities";
|
|
2
|
-
import { IIndustryEntity } from "../../entities/interface/industry.entity.interface";
|
|
3
|
-
export type IIndustryCreateExclude = "status";
|
|
4
|
-
export interface IIndustryCreateDto extends Omit<IEntityCreateDto<IIndustryEntity>, IIndustryCreateExclude> {
|
|
5
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DeepPartialButRequired } from "./api.utils.interface";
|
|
2
|
-
import { IIndustryCreateDto } from "./industry.create.dto.interface";
|
|
3
|
-
export type IIndustryUpdateDto = DeepPartialButRequired<IIndustryCreateDto, never> & {
|
|
4
|
-
actionData: IIndustryActionDataDto;
|
|
5
|
-
};
|
|
6
|
-
export interface IIndustryActionDataDto {
|
|
7
|
-
action: IndustryActionEnum;
|
|
8
|
-
remark?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare enum IndustryActionEnum {
|
|
11
|
-
CREATE = "create",
|
|
12
|
-
UPDATE = "update",
|
|
13
|
-
DELETE = "delete",
|
|
14
|
-
DEACTIVATE = "deactivate",
|
|
15
|
-
ACTIVATE = "activate",
|
|
16
|
-
RESTORE = "restore"
|
|
17
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IndustryActionEnum = void 0;
|
|
4
|
-
var IndustryActionEnum;
|
|
5
|
-
(function (IndustryActionEnum) {
|
|
6
|
-
IndustryActionEnum["CREATE"] = "create";
|
|
7
|
-
IndustryActionEnum["UPDATE"] = "update";
|
|
8
|
-
IndustryActionEnum["DELETE"] = "delete";
|
|
9
|
-
IndustryActionEnum["DEACTIVATE"] = "deactivate";
|
|
10
|
-
IndustryActionEnum["ACTIVATE"] = "activate";
|
|
11
|
-
IndustryActionEnum["RESTORE"] = "restore";
|
|
12
|
-
// APPROVE = "approve",
|
|
13
|
-
// REJECT = "reject",
|
|
14
|
-
// RECALL = "recall",
|
|
15
|
-
// REQUEST_CHANGES = "request_changes",
|
|
16
|
-
// CHANGES_DONE = "changes_done",
|
|
17
|
-
})(IndustryActionEnum || (exports.IndustryActionEnum = IndustryActionEnum = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IndustryStatusEnum = void 0;
|
|
4
|
-
var IndustryStatusEnum;
|
|
5
|
-
(function (IndustryStatusEnum) {
|
|
6
|
-
IndustryStatusEnum["APPROVED"] = "APPROVED";
|
|
7
|
-
IndustryStatusEnum["DEACTIVATED"] = "DEACTIVATED";
|
|
8
|
-
IndustryStatusEnum["DELETED"] = "DELETED";
|
|
9
|
-
})(IndustryStatusEnum || (exports.IndustryStatusEnum = IndustryStatusEnum = {}));
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FlowConfig } from "./flow-config.type";
|
|
2
|
-
import { IndustryActionEnum } from "../../api";
|
|
3
|
-
import { IndustryStatusEnum } from "../enums/industry_status_enum";
|
|
4
|
-
export interface IIndustryFlowConfigContextData {
|
|
5
|
-
}
|
|
6
|
-
export declare const industryFlowConfig: FlowConfig<IndustryStatusEnum, IndustryActionEnum, IIndustryFlowConfigContextData>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.industryFlowConfig = void 0;
|
|
4
|
-
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
5
|
-
const api_1 = require("../../api");
|
|
6
|
-
const industry_status_enum_1 = require("../enums/industry_status_enum");
|
|
7
|
-
const INDUSTRY_CREATE_PERMISSION = ["INDUSTRY_CREATE"];
|
|
8
|
-
const INDUSTRY_UPDATE_PERMISSION = ["INDUSTRY_UPDATE"];
|
|
9
|
-
const INDUSTRY_DELETE_PERMISSION = ["INDUSTRY_DELETE"];
|
|
10
|
-
const INDUSTRY_DEACTIVATE_PERMISSION = ["INDUSTRY_DEACTIVATE"];
|
|
11
|
-
const INDUSTRY_ACTIVATE_PERMISSION = ["INDUSTRY_ACTIVATE"];
|
|
12
|
-
const INDUSTRY_RESTORE_PERMISSION = ["INDUSTRY_RESTORE"];
|
|
13
|
-
const ACTION_MAP = {
|
|
14
|
-
[api_1.IndustryActionEnum.CREATE]: {
|
|
15
|
-
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
16
|
-
permissions: INDUSTRY_CREATE_PERMISSION,
|
|
17
|
-
},
|
|
18
|
-
[api_1.IndustryActionEnum.UPDATE]: {
|
|
19
|
-
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
20
|
-
permissions: INDUSTRY_UPDATE_PERMISSION,
|
|
21
|
-
},
|
|
22
|
-
[api_1.IndustryActionEnum.DELETE]: {
|
|
23
|
-
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.DELETED],
|
|
24
|
-
permissions: INDUSTRY_DELETE_PERMISSION,
|
|
25
|
-
},
|
|
26
|
-
[api_1.IndustryActionEnum.DEACTIVATE]: {
|
|
27
|
-
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.DEACTIVATED],
|
|
28
|
-
permissions: INDUSTRY_DEACTIVATE_PERMISSION,
|
|
29
|
-
},
|
|
30
|
-
[api_1.IndustryActionEnum.ACTIVATE]: {
|
|
31
|
-
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
32
|
-
permissions: INDUSTRY_ACTIVATE_PERMISSION,
|
|
33
|
-
},
|
|
34
|
-
[api_1.IndustryActionEnum.RESTORE]: {
|
|
35
|
-
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
36
|
-
permissions: INDUSTRY_RESTORE_PERMISSION,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
40
|
-
// APPROVED status transitions
|
|
41
|
-
const transitionApprovedStatusUpdateAction = createActionConfig(api_1.IndustryActionEnum.UPDATE, industry_status_enum_1.IndustryStatusEnum.APPROVED);
|
|
42
|
-
const transitionApprovedStatusDeleteAction = createActionConfig(api_1.IndustryActionEnum.DELETE, industry_status_enum_1.IndustryStatusEnum.DELETED);
|
|
43
|
-
const transitionApprovedStatusDeactivateAction = createActionConfig(api_1.IndustryActionEnum.DEACTIVATE, industry_status_enum_1.IndustryStatusEnum.DEACTIVATED);
|
|
44
|
-
// DEACTIVATED status transitions
|
|
45
|
-
const transitionDeactivatedStatusDeleteAction = createActionConfig(api_1.IndustryActionEnum.DELETE, industry_status_enum_1.IndustryStatusEnum.DELETED);
|
|
46
|
-
const transitionDeactivatedStatusActivateAction = createActionConfig(api_1.IndustryActionEnum.ACTIVATE, industry_status_enum_1.IndustryStatusEnum.APPROVED);
|
|
47
|
-
// DELETED status transitions
|
|
48
|
-
const transitionDeletedStatusUpdateAction = createActionConfig(api_1.IndustryActionEnum.UPDATE, industry_status_enum_1.IndustryStatusEnum.APPROVED);
|
|
49
|
-
const transitionDeletedStatusRestoreAction = createActionConfig(api_1.IndustryActionEnum.RESTORE, industry_status_enum_1.IndustryStatusEnum.APPROVED);
|
|
50
|
-
exports.industryFlowConfig = {
|
|
51
|
-
[industry_status_enum_1.IndustryStatusEnum.APPROVED]: {
|
|
52
|
-
actions: {
|
|
53
|
-
[api_1.IndustryActionEnum.UPDATE]: transitionApprovedStatusUpdateAction,
|
|
54
|
-
[api_1.IndustryActionEnum.DELETE]: transitionApprovedStatusDeleteAction,
|
|
55
|
-
[api_1.IndustryActionEnum.DEACTIVATE]: transitionApprovedStatusDeactivateAction,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
[industry_status_enum_1.IndustryStatusEnum.DEACTIVATED]: {
|
|
59
|
-
actions: {
|
|
60
|
-
[api_1.IndustryActionEnum.DELETE]: transitionDeactivatedStatusDeleteAction,
|
|
61
|
-
[api_1.IndustryActionEnum.ACTIVATE]: transitionDeactivatedStatusActivateAction,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
[industry_status_enum_1.IndustryStatusEnum.DELETED]: {
|
|
65
|
-
actions: {
|
|
66
|
-
[api_1.IndustryActionEnum.UPDATE]: transitionDeletedStatusUpdateAction,
|
|
67
|
-
[api_1.IndustryActionEnum.RESTORE]: transitionDeletedStatusRestoreAction,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
};
|