law-common 14.1.4-beta.1 → 14.1.4-beta.2
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/src/entities/flow-configs/office_location_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/office_location_flow.config.js +13 -3
- package/dist/src/entities/flow-configs/utils/flow-config.utils.d.ts +32 -0
- package/dist/src/entities/flow-configs/utils/flow-config.utils.js +2 -0
- package/dist/src/entities/index.d.ts +1 -1
- package/dist/src/entities/index.js +4 -2
- package/package.json +1 -1
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { FlowConfig } from "./flow-config.type";
|
|
2
2
|
import { OfficeLocationActionEnum } from "../enums/office_location_action_enum";
|
|
3
3
|
import { OfficeLocationStatusEnum } from "../enums/office_location_status_enum";
|
|
4
|
+
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
4
5
|
export interface IOfficeLocationFlowConfigContextData {
|
|
5
6
|
}
|
|
7
|
+
export declare const ACTION_MAP: {
|
|
8
|
+
CREATE: {
|
|
9
|
+
reachableStatues: readonly [OfficeLocationStatusEnum.APPROVED];
|
|
10
|
+
permissions: string[];
|
|
11
|
+
group: PermissionGroupEnum.CREATE;
|
|
12
|
+
};
|
|
13
|
+
UPDATE: {
|
|
14
|
+
reachableStatues: readonly [OfficeLocationStatusEnum.APPROVED];
|
|
15
|
+
permissions: string[];
|
|
16
|
+
group: PermissionGroupEnum.UPDATE;
|
|
17
|
+
};
|
|
18
|
+
DELETE: {
|
|
19
|
+
reachableStatues: readonly [OfficeLocationStatusEnum.DELETED];
|
|
20
|
+
permissions: string[];
|
|
21
|
+
group: PermissionGroupEnum.DELETE;
|
|
22
|
+
};
|
|
23
|
+
DEACTIVATE: {
|
|
24
|
+
reachableStatues: readonly [OfficeLocationStatusEnum.DEACTIVATED];
|
|
25
|
+
permissions: string[];
|
|
26
|
+
group: PermissionGroupEnum.UPDATE;
|
|
27
|
+
};
|
|
28
|
+
ACTIVATE: {
|
|
29
|
+
reachableStatues: readonly [OfficeLocationStatusEnum.APPROVED];
|
|
30
|
+
permissions: string[];
|
|
31
|
+
group: PermissionGroupEnum.UPDATE;
|
|
32
|
+
};
|
|
33
|
+
RESTORE: {
|
|
34
|
+
reachableStatues: readonly [OfficeLocationStatusEnum.APPROVED];
|
|
35
|
+
permissions: string[];
|
|
36
|
+
group: PermissionGroupEnum.UPDATE;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
6
39
|
export declare const officeLocationFlowConfig: FlowConfig<OfficeLocationStatusEnum, OfficeLocationActionEnum, IOfficeLocationFlowConfigContextData>;
|
|
@@ -1,42 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.officeLocationFlowConfig = void 0;
|
|
3
|
+
exports.officeLocationFlowConfig = exports.ACTION_MAP = void 0;
|
|
4
4
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
5
5
|
const office_location_action_enum_1 = require("../enums/office_location_action_enum");
|
|
6
6
|
const office_location_status_enum_1 = require("../enums/office_location_status_enum");
|
|
7
|
+
const permission_group_enum_1 = require("../enums/permission_group_enum");
|
|
7
8
|
const OFFICE_LOCATION_CREATE_PERMISSION = ["OFFICE_LOCATION_CREATE"];
|
|
8
9
|
const OFFICE_LOCATION_UPDATE_PERMISSION = ["OFFICE_LOCATION_UPDATE"];
|
|
9
10
|
const OFFICE_LOCATION_DELETE_PERMISSION = ["OFFICE_LOCATION_DELETE"];
|
|
10
11
|
const OFFICE_LOCATION_DEACTIVATE_PERMISSION = ["OFFICE_LOCATION_DEACTIVATE"];
|
|
11
12
|
const OFFICE_LOCATION_ACTIVATE_PERMISSION = ["OFFICE_LOCATION_ACTIVATE"];
|
|
12
13
|
const OFFICE_LOCATION_RESTORE_PERMISSION = ["OFFICE_LOCATION_RESTORE"];
|
|
13
|
-
|
|
14
|
+
// Every action declares its group; office_location_bulk_update.transaction.ts reads `group` to pick the
|
|
15
|
+
// permission a dto is authorised under. The three lifecycle actions share the UPDATE group because that
|
|
16
|
+
// is where `derivePermissionGroup` classifies them (see expense_type_flow.config.ts).
|
|
17
|
+
exports.ACTION_MAP = {
|
|
14
18
|
[office_location_action_enum_1.OfficeLocationActionEnum.CREATE]: {
|
|
15
19
|
reachableStatues: [office_location_status_enum_1.OfficeLocationStatusEnum.APPROVED],
|
|
16
20
|
permissions: OFFICE_LOCATION_CREATE_PERMISSION,
|
|
21
|
+
group: permission_group_enum_1.PermissionGroupEnum.CREATE,
|
|
17
22
|
},
|
|
18
23
|
[office_location_action_enum_1.OfficeLocationActionEnum.UPDATE]: {
|
|
19
24
|
reachableStatues: [office_location_status_enum_1.OfficeLocationStatusEnum.APPROVED],
|
|
20
25
|
permissions: OFFICE_LOCATION_UPDATE_PERMISSION,
|
|
26
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
21
27
|
},
|
|
22
28
|
[office_location_action_enum_1.OfficeLocationActionEnum.DELETE]: {
|
|
23
29
|
reachableStatues: [office_location_status_enum_1.OfficeLocationStatusEnum.DELETED],
|
|
24
30
|
permissions: OFFICE_LOCATION_DELETE_PERMISSION,
|
|
31
|
+
group: permission_group_enum_1.PermissionGroupEnum.DELETE,
|
|
25
32
|
},
|
|
26
33
|
[office_location_action_enum_1.OfficeLocationActionEnum.DEACTIVATE]: {
|
|
27
34
|
reachableStatues: [office_location_status_enum_1.OfficeLocationStatusEnum.DEACTIVATED],
|
|
28
35
|
permissions: OFFICE_LOCATION_DEACTIVATE_PERMISSION,
|
|
36
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
29
37
|
},
|
|
30
38
|
[office_location_action_enum_1.OfficeLocationActionEnum.ACTIVATE]: {
|
|
31
39
|
reachableStatues: [office_location_status_enum_1.OfficeLocationStatusEnum.APPROVED],
|
|
32
40
|
permissions: OFFICE_LOCATION_ACTIVATE_PERMISSION,
|
|
41
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
33
42
|
},
|
|
34
43
|
[office_location_action_enum_1.OfficeLocationActionEnum.RESTORE]: {
|
|
35
44
|
reachableStatues: [office_location_status_enum_1.OfficeLocationStatusEnum.APPROVED],
|
|
36
45
|
permissions: OFFICE_LOCATION_RESTORE_PERMISSION,
|
|
46
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
37
47
|
},
|
|
38
48
|
};
|
|
39
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
49
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(exports.ACTION_MAP);
|
|
40
50
|
// APPROVED status transitions
|
|
41
51
|
const transitionApprovedStatusUpdateAction = createActionConfig(office_location_action_enum_1.OfficeLocationActionEnum.UPDATE, office_location_status_enum_1.OfficeLocationStatusEnum.APPROVED);
|
|
42
52
|
const transitionApprovedStatusDeleteAction = createActionConfig(office_location_action_enum_1.OfficeLocationActionEnum.DELETE, office_location_status_enum_1.OfficeLocationStatusEnum.DELETED);
|
|
@@ -37,6 +37,38 @@ export declare const enumToActionMap: {
|
|
|
37
37
|
group: PermissionGroupEnum.UPDATE;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
+
office_location: {
|
|
41
|
+
CREATE: {
|
|
42
|
+
reachableStatues: readonly [import("../..").OfficeLocationStatusEnum.APPROVED];
|
|
43
|
+
permissions: string[];
|
|
44
|
+
group: PermissionGroupEnum.CREATE;
|
|
45
|
+
};
|
|
46
|
+
UPDATE: {
|
|
47
|
+
reachableStatues: readonly [import("../..").OfficeLocationStatusEnum.APPROVED];
|
|
48
|
+
permissions: string[];
|
|
49
|
+
group: PermissionGroupEnum.UPDATE;
|
|
50
|
+
};
|
|
51
|
+
DELETE: {
|
|
52
|
+
reachableStatues: readonly [import("../..").OfficeLocationStatusEnum.DELETED];
|
|
53
|
+
permissions: string[];
|
|
54
|
+
group: PermissionGroupEnum.DELETE;
|
|
55
|
+
};
|
|
56
|
+
DEACTIVATE: {
|
|
57
|
+
reachableStatues: readonly [import("../..").OfficeLocationStatusEnum.DEACTIVATED];
|
|
58
|
+
permissions: string[];
|
|
59
|
+
group: PermissionGroupEnum.UPDATE;
|
|
60
|
+
};
|
|
61
|
+
ACTIVATE: {
|
|
62
|
+
reachableStatues: readonly [import("../..").OfficeLocationStatusEnum.APPROVED];
|
|
63
|
+
permissions: string[];
|
|
64
|
+
group: PermissionGroupEnum.UPDATE;
|
|
65
|
+
};
|
|
66
|
+
RESTORE: {
|
|
67
|
+
reachableStatues: readonly [import("../..").OfficeLocationStatusEnum.APPROVED];
|
|
68
|
+
permissions: string[];
|
|
69
|
+
group: PermissionGroupEnum.UPDATE;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
40
72
|
work_from_home: {
|
|
41
73
|
CREATE: {
|
|
42
74
|
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING];
|
|
@@ -5,6 +5,7 @@ const error_key_enum_1 = require("../../../enums/error.key.enum");
|
|
|
5
5
|
const exceptions_1 = require("../../../exceptions");
|
|
6
6
|
const entity_utils_interface_1 = require("../../interface/entity.utils.interface");
|
|
7
7
|
const expense_type_flow_config_1 = require("../expense_type_flow.config");
|
|
8
|
+
const office_location_flow_config_1 = require("../office_location_flow.config");
|
|
8
9
|
const work_from_home_flow_config_1 = require("../work_from_home_flow.config");
|
|
9
10
|
/**
|
|
10
11
|
* Registry of per-entity action maps; each value is the whole ACTION_MAP that entity's flow config exports
|
|
@@ -13,6 +14,7 @@ const work_from_home_flow_config_1 = require("../work_from_home_flow.config");
|
|
|
13
14
|
*/
|
|
14
15
|
exports.enumToActionMap = {
|
|
15
16
|
[entity_utils_interface_1.EntityEnum.EXPENSE_TYPE]: expense_type_flow_config_1.ACTION_MAP,
|
|
17
|
+
[entity_utils_interface_1.EntityEnum.OFFICE_LOCATION]: office_location_flow_config_1.ACTION_MAP,
|
|
16
18
|
[entity_utils_interface_1.EntityEnum.WORK_FROM_HOME]: work_from_home_flow_config_1.ACTION_MAP,
|
|
17
19
|
};
|
|
18
20
|
class FlowConfigUtils {
|
|
@@ -62,7 +62,7 @@ export * from "./enums/billing_status_enum";
|
|
|
62
62
|
export * from "./enums/billing_timesheet_change_status_enum";
|
|
63
63
|
export * from "./enums/office_location_action_enum";
|
|
64
64
|
export * from "./enums/office_location_status_enum";
|
|
65
|
-
export
|
|
65
|
+
export { IOfficeLocationFlowConfigContextData, ACTION_MAP as OFFICE_LOCATION_ACTION_MAP, officeLocationFlowConfig } from "./flow-configs/office_location_flow.config";
|
|
66
66
|
export * from "./interface/office_location.entity.interface";
|
|
67
67
|
export * from "./interface/field-constraint/office_location_field_constraints.interface";
|
|
68
68
|
export * from "./interface/bank.entity.interface";
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.workFromHomeFlowConfig = exports.WORK_FROM_HOME_ACTION_MAP = void 0;
|
|
17
|
+
exports.workFromHomeFlowConfig = exports.WORK_FROM_HOME_ACTION_MAP = exports.officeLocationFlowConfig = exports.OFFICE_LOCATION_ACTION_MAP = void 0;
|
|
18
18
|
__exportStar(require("./enums/organization_action_enum"), exports);
|
|
19
19
|
__exportStar(require("./enums/organization_status_enum"), exports);
|
|
20
20
|
__exportStar(require("./flow-configs/organization_flow.config"), exports);
|
|
@@ -79,7 +79,9 @@ __exportStar(require("./enums/billing_status_enum"), exports);
|
|
|
79
79
|
__exportStar(require("./enums/billing_timesheet_change_status_enum"), exports);
|
|
80
80
|
__exportStar(require("./enums/office_location_action_enum"), exports);
|
|
81
81
|
__exportStar(require("./enums/office_location_status_enum"), exports);
|
|
82
|
-
|
|
82
|
+
var office_location_flow_config_1 = require("./flow-configs/office_location_flow.config");
|
|
83
|
+
Object.defineProperty(exports, "OFFICE_LOCATION_ACTION_MAP", { enumerable: true, get: function () { return office_location_flow_config_1.ACTION_MAP; } });
|
|
84
|
+
Object.defineProperty(exports, "officeLocationFlowConfig", { enumerable: true, get: function () { return office_location_flow_config_1.officeLocationFlowConfig; } });
|
|
83
85
|
__exportStar(require("./interface/office_location.entity.interface"), exports);
|
|
84
86
|
__exportStar(require("./interface/field-constraint/office_location_field_constraints.interface"), exports);
|
|
85
87
|
__exportStar(require("./interface/bank.entity.interface"), exports);
|