law-common 14.1.1 → 14.1.2-beta.1
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/api/index.d.ts +0 -2
- package/dist/src/api/index.js +0 -2
- package/dist/src/api/v1/index.d.ts +2 -0
- package/dist/src/api/v1/index.js +2 -0
- package/dist/src/api/{interface → v1/interface}/expense_type.create.dto.interface.d.ts +1 -1
- package/dist/src/api/{interface → v1/interface}/expense_type.update.dto.interface.d.ts +1 -1
- package/dist/src/api/v2/index.d.ts +2 -0
- package/dist/src/api/v2/index.js +2 -0
- package/dist/src/api/v2/interface/expense_type.create.dto.interface.d.ts +5 -0
- package/dist/src/api/v2/interface/expense_type.create.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/expense_type.update.dto.interface.d.ts +12 -0
- package/dist/src/api/v2/interface/expense_type.update.dto.interface.js +2 -0
- package/dist/src/entities/flow-configs/expense_type_flow.config.d.ts +34 -1
- package/dist/src/entities/flow-configs/expense_type_flow.config.js +39 -24
- package/dist/src/entities/flow-configs/utils/flow-config.utils.d.ts +110 -0
- package/dist/src/entities/flow-configs/utils/flow-config.utils.js +64 -0
- package/dist/src/entities/flow-configs/work_from_home_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/work_from_home_flow.config.js +4 -3
- package/dist/src/entities/index.d.ts +3 -2
- package/dist/src/entities/index.js +6 -2
- package/dist/src/entities/interface/expense_type.entity.interface.d.ts +3 -2
- package/dist/src/entities/interface/field-constraint/expense_type_field_constraints.interface.d.ts +0 -8
- package/dist/src/entities/model/expense_type.entity.model.d.ts +7 -7
- package/dist/src/entities/model/expense_type.entity.model.js +6 -6
- package/package.json +1 -1
- /package/dist/src/api/{interface → v1/interface}/expense_type.create.dto.interface.js +0 -0
- /package/dist/src/api/{interface → v1/interface}/expense_type.update.dto.interface.js +0 -0
- /package/dist/src/entities/enums/{expense_type_entity_enum.d.ts → expense_type_enum.d.ts} +0 -0
- /package/dist/src/entities/enums/{expense_type_entity_enum.js → expense_type_enum.js} +0 -0
package/dist/src/api/index.d.ts
CHANGED
|
@@ -20,8 +20,6 @@ export * from "./interface/reimbursement_expense.update.dto.interface";
|
|
|
20
20
|
export * from "./interface/billing_reimbursement_expense.create.dto.interface";
|
|
21
21
|
export * from "./interface/billing_reimbursement_expense.filter.dto.interface";
|
|
22
22
|
export * from "./interface/billing_reimbursement_expense.update.dto.interface";
|
|
23
|
-
export * from "./interface/expense_type.create.dto.interface";
|
|
24
|
-
export * from "./interface/expense_type.update.dto.interface";
|
|
25
23
|
export * from "./interface/expense_type.entity.response";
|
|
26
24
|
export * from "./interface/billing.create.dto.interface";
|
|
27
25
|
export * from "./interface/billing_particular_line_item.create.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -59,8 +59,6 @@ __exportStar(require("./interface/reimbursement_expense.update.dto.interface"),
|
|
|
59
59
|
__exportStar(require("./interface/billing_reimbursement_expense.create.dto.interface"), exports);
|
|
60
60
|
__exportStar(require("./interface/billing_reimbursement_expense.filter.dto.interface"), exports);
|
|
61
61
|
__exportStar(require("./interface/billing_reimbursement_expense.update.dto.interface"), exports);
|
|
62
|
-
__exportStar(require("./interface/expense_type.create.dto.interface"), exports);
|
|
63
|
-
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
64
62
|
__exportStar(require("./interface/expense_type.entity.response"), exports);
|
|
65
63
|
__exportStar(require("./interface/billing.create.dto.interface"), exports);
|
|
66
64
|
__exportStar(require("./interface/billing_particular_line_item.create.dto.interface"), exports);
|
|
@@ -5,5 +5,7 @@
|
|
|
5
5
|
* generator never writes to this directory (checklist 12.4). An entity appears either in
|
|
6
6
|
* api/interface/ or in v1 + v2 - never both.
|
|
7
7
|
*/
|
|
8
|
+
export * from "./interface/expense_type.create.dto.interface";
|
|
9
|
+
export * from "./interface/expense_type.update.dto.interface";
|
|
8
10
|
export * from "./interface/to_do_list.create.dto.interface";
|
|
9
11
|
export * from "./interface/to_do_list.update.dto.interface";
|
package/dist/src/api/v1/index.js
CHANGED
|
@@ -21,5 +21,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
* generator never writes to this directory (checklist 12.4). An entity appears either in
|
|
22
22
|
* api/interface/ or in v1 + v2 - never both.
|
|
23
23
|
*/
|
|
24
|
+
__exportStar(require("./interface/expense_type.create.dto.interface"), exports);
|
|
25
|
+
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
24
26
|
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
25
27
|
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
package/dist/src/api/v2/index.js
CHANGED
|
@@ -27,3 +27,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
27
27
|
// };
|
|
28
28
|
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
29
29
|
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
30
|
+
__exportStar(require("./interface/expense_type.create.dto.interface"), exports);
|
|
31
|
+
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../../entities";
|
|
2
|
+
import { IExpenseTypeEntity } from "../../../entities/interface/expense_type.entity.interface";
|
|
3
|
+
export type IExpenseTypeCreateExclude = "status";
|
|
4
|
+
export interface IExpenseTypeCreateDto extends Omit<IEntityCreateDto<IExpenseTypeEntity>, IExpenseTypeCreateExclude> {
|
|
5
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeepPartialButRequired } from "../../interface/api.utils.interface";
|
|
2
|
+
import { ExpenseTypeActionEnum } from "../../../entities";
|
|
3
|
+
import { IExpenseTypeCreateDto } from "./expense_type.create.dto.interface";
|
|
4
|
+
export type IExpenseTypeUpdateDto = DeepPartialButRequired<IExpenseTypeCreateDto, never> & {
|
|
5
|
+
actionData: IExpenseTypeActionDataDto;
|
|
6
|
+
} & {
|
|
7
|
+
id?: number;
|
|
8
|
+
};
|
|
9
|
+
export interface IExpenseTypeActionDataDto {
|
|
10
|
+
action: ExpenseTypeActionEnum;
|
|
11
|
+
remark?: string;
|
|
12
|
+
}
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { FlowConfig } from "./flow-config.type";
|
|
2
|
-
import { ExpenseTypeActionEnum } from "
|
|
2
|
+
import { ExpenseTypeActionEnum } from "../../entities";
|
|
3
3
|
import { ExpenseTypeStatusEnum } from "../enums/expense_type_status_enum";
|
|
4
|
+
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
4
5
|
export interface IExpenseTypeFlowConfigContextData {
|
|
5
6
|
}
|
|
7
|
+
export declare const ACTION_MAP: {
|
|
8
|
+
CREATE: {
|
|
9
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.APPROVED];
|
|
10
|
+
permissions: string[];
|
|
11
|
+
group: PermissionGroupEnum.CREATE;
|
|
12
|
+
};
|
|
13
|
+
UPDATE: {
|
|
14
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.APPROVED];
|
|
15
|
+
permissions: string[];
|
|
16
|
+
group: PermissionGroupEnum.UPDATE;
|
|
17
|
+
};
|
|
18
|
+
DELETE: {
|
|
19
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.DELETED];
|
|
20
|
+
permissions: string[];
|
|
21
|
+
group: PermissionGroupEnum.DELETE;
|
|
22
|
+
};
|
|
23
|
+
DEACTIVATE: {
|
|
24
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.DEACTIVATED];
|
|
25
|
+
permissions: string[];
|
|
26
|
+
group: PermissionGroupEnum.UPDATE;
|
|
27
|
+
};
|
|
28
|
+
ACTIVATE: {
|
|
29
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.APPROVED];
|
|
30
|
+
permissions: string[];
|
|
31
|
+
group: PermissionGroupEnum.UPDATE;
|
|
32
|
+
};
|
|
33
|
+
RESTORE: {
|
|
34
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.APPROVED];
|
|
35
|
+
permissions: string[];
|
|
36
|
+
group: PermissionGroupEnum.UPDATE;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
6
39
|
export declare const expenseTypeFlowConfig: FlowConfig<ExpenseTypeStatusEnum, ExpenseTypeActionEnum, IExpenseTypeFlowConfigContextData>;
|
|
@@ -1,70 +1,85 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.expenseTypeFlowConfig = void 0;
|
|
3
|
+
exports.expenseTypeFlowConfig = exports.ACTION_MAP = void 0;
|
|
4
4
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
5
|
-
const
|
|
5
|
+
const entities_1 = require("../../entities");
|
|
6
6
|
const expense_type_status_enum_1 = require("../enums/expense_type_status_enum");
|
|
7
|
+
const permission_group_enum_1 = require("../enums/permission_group_enum");
|
|
7
8
|
const EXPENSE_TYPE_CREATE_PERMISSION = ["EXPENSE_TYPE_CREATE"];
|
|
8
9
|
const EXPENSE_TYPE_UPDATE_PERMISSION = ["EXPENSE_TYPE_UPDATE"];
|
|
9
10
|
const EXPENSE_TYPE_DELETE_PERMISSION = ["EXPENSE_TYPE_DELETE"];
|
|
10
11
|
const EXPENSE_TYPE_DEACTIVATE_PERMISSION = ["EXPENSE_TYPE_DEACTIVATE"];
|
|
11
12
|
const EXPENSE_TYPE_ACTIVATE_PERMISSION = ["EXPENSE_TYPE_ACTIVATE"];
|
|
12
13
|
const EXPENSE_TYPE_RESTORE_PERMISSION = ["EXPENSE_TYPE_RESTORE"];
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
// Every action declares its group. expense_type_bulk_update.transaction.ts reads `group` to pick the
|
|
15
|
+
// permission a dto is authorised under and refuses to default an absent one, so all six must be
|
|
16
|
+
// annotated for any transition to keep working.
|
|
17
|
+
//
|
|
18
|
+
// The three lifecycle actions share the UPDATE group because that is where `derivePermissionGroup`
|
|
19
|
+
// classifies them — matching work_from_home_flow.config.ts, where RECALL is likewise UPDATE. They are
|
|
20
|
+
// still distinguished by `permissions` above, which `getNextStatus` consults per action, so grouping
|
|
21
|
+
// them together narrows nothing.
|
|
22
|
+
exports.ACTION_MAP = {
|
|
23
|
+
[entities_1.ExpenseTypeActionEnum.CREATE]: {
|
|
15
24
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
16
25
|
permissions: EXPENSE_TYPE_CREATE_PERMISSION,
|
|
26
|
+
group: permission_group_enum_1.PermissionGroupEnum.CREATE,
|
|
17
27
|
},
|
|
18
|
-
[
|
|
28
|
+
[entities_1.ExpenseTypeActionEnum.UPDATE]: {
|
|
19
29
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
20
30
|
permissions: EXPENSE_TYPE_UPDATE_PERMISSION,
|
|
31
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
21
32
|
},
|
|
22
|
-
[
|
|
33
|
+
[entities_1.ExpenseTypeActionEnum.DELETE]: {
|
|
23
34
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED],
|
|
24
35
|
permissions: EXPENSE_TYPE_DELETE_PERMISSION,
|
|
36
|
+
group: permission_group_enum_1.PermissionGroupEnum.DELETE,
|
|
25
37
|
},
|
|
26
|
-
[
|
|
38
|
+
[entities_1.ExpenseTypeActionEnum.DEACTIVATE]: {
|
|
27
39
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.DEACTIVATED],
|
|
28
40
|
permissions: EXPENSE_TYPE_DEACTIVATE_PERMISSION,
|
|
41
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
29
42
|
},
|
|
30
|
-
[
|
|
43
|
+
[entities_1.ExpenseTypeActionEnum.ACTIVATE]: {
|
|
31
44
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
32
45
|
permissions: EXPENSE_TYPE_ACTIVATE_PERMISSION,
|
|
46
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
33
47
|
},
|
|
34
|
-
[
|
|
48
|
+
[entities_1.ExpenseTypeActionEnum.RESTORE]: {
|
|
35
49
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
36
50
|
permissions: EXPENSE_TYPE_RESTORE_PERMISSION,
|
|
51
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
37
52
|
},
|
|
38
53
|
};
|
|
39
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
54
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(exports.ACTION_MAP);
|
|
40
55
|
// APPROVED status transitions
|
|
41
|
-
const transitionApprovedStatusUpdateAction = createActionConfig(
|
|
42
|
-
const transitionApprovedStatusDeleteAction = createActionConfig(
|
|
43
|
-
const transitionApprovedStatusDeactivateAction = createActionConfig(
|
|
56
|
+
const transitionApprovedStatusUpdateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.UPDATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
57
|
+
const transitionApprovedStatusDeleteAction = createActionConfig(entities_1.ExpenseTypeActionEnum.DELETE, expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED);
|
|
58
|
+
const transitionApprovedStatusDeactivateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.DEACTIVATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.DEACTIVATED);
|
|
44
59
|
// DEACTIVATED status transitions
|
|
45
|
-
const transitionDeactivatedStatusDeleteAction = createActionConfig(
|
|
46
|
-
const transitionDeactivatedStatusActivateAction = createActionConfig(
|
|
60
|
+
const transitionDeactivatedStatusDeleteAction = createActionConfig(entities_1.ExpenseTypeActionEnum.DELETE, expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED);
|
|
61
|
+
const transitionDeactivatedStatusActivateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.ACTIVATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
47
62
|
// DELETED status transitions
|
|
48
|
-
const transitionDeletedStatusUpdateAction = createActionConfig(
|
|
49
|
-
const transitionDeletedStatusRestoreAction = createActionConfig(
|
|
63
|
+
const transitionDeletedStatusUpdateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.UPDATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
64
|
+
const transitionDeletedStatusRestoreAction = createActionConfig(entities_1.ExpenseTypeActionEnum.RESTORE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
50
65
|
exports.expenseTypeFlowConfig = {
|
|
51
66
|
[expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED]: {
|
|
52
67
|
actions: {
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
68
|
+
[entities_1.ExpenseTypeActionEnum.UPDATE]: transitionApprovedStatusUpdateAction,
|
|
69
|
+
[entities_1.ExpenseTypeActionEnum.DELETE]: transitionApprovedStatusDeleteAction,
|
|
70
|
+
[entities_1.ExpenseTypeActionEnum.DEACTIVATE]: transitionApprovedStatusDeactivateAction,
|
|
56
71
|
},
|
|
57
72
|
},
|
|
58
73
|
[expense_type_status_enum_1.ExpenseTypeStatusEnum.DEACTIVATED]: {
|
|
59
74
|
actions: {
|
|
60
|
-
[
|
|
61
|
-
[
|
|
75
|
+
[entities_1.ExpenseTypeActionEnum.DELETE]: transitionDeactivatedStatusDeleteAction,
|
|
76
|
+
[entities_1.ExpenseTypeActionEnum.ACTIVATE]: transitionDeactivatedStatusActivateAction,
|
|
62
77
|
},
|
|
63
78
|
},
|
|
64
79
|
[expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED]: {
|
|
65
80
|
actions: {
|
|
66
|
-
[
|
|
67
|
-
[
|
|
81
|
+
[entities_1.ExpenseTypeActionEnum.UPDATE]: transitionDeletedStatusUpdateAction,
|
|
82
|
+
[entities_1.ExpenseTypeActionEnum.RESTORE]: transitionDeletedStatusRestoreAction,
|
|
68
83
|
},
|
|
69
84
|
},
|
|
70
85
|
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { PermissionGroupEnum } from "../../enums/permission_group_enum";
|
|
2
|
+
/**
|
|
3
|
+
* Registry of per-entity action maps used by {@link FlowConfigUtils}.
|
|
4
|
+
*
|
|
5
|
+
* Every entry maps an {@link EntityEnum} member to the `ACTION_MAP` declared by that entity's
|
|
6
|
+
* flow config file. To register another entity: add `export` to its `ACTION_MAP` (only
|
|
7
|
+
* expense_type and work_from_home export it today) and add one line here. The typing below
|
|
8
|
+
* follows automatically:
|
|
9
|
+
* the entity parameter and the action parameter of `getPermissionGroupByAction` both derive
|
|
10
|
+
* from this object, so a new entity's actions are accepted only with that entity, and rejected
|
|
11
|
+
* for every other entity — including actions from a different enum that share the same string
|
|
12
|
+
* value (string enums are nominal across types).
|
|
13
|
+
*/
|
|
14
|
+
export declare const enumToActionMap: {
|
|
15
|
+
expense_type: {
|
|
16
|
+
CREATE: {
|
|
17
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.APPROVED];
|
|
18
|
+
permissions: string[];
|
|
19
|
+
group: PermissionGroupEnum.CREATE;
|
|
20
|
+
};
|
|
21
|
+
UPDATE: {
|
|
22
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.APPROVED];
|
|
23
|
+
permissions: string[];
|
|
24
|
+
group: PermissionGroupEnum.UPDATE;
|
|
25
|
+
};
|
|
26
|
+
DELETE: {
|
|
27
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.DELETED];
|
|
28
|
+
permissions: string[];
|
|
29
|
+
group: PermissionGroupEnum.DELETE;
|
|
30
|
+
};
|
|
31
|
+
DEACTIVATE: {
|
|
32
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.DEACTIVATED];
|
|
33
|
+
permissions: string[];
|
|
34
|
+
group: PermissionGroupEnum.UPDATE;
|
|
35
|
+
};
|
|
36
|
+
ACTIVATE: {
|
|
37
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.APPROVED];
|
|
38
|
+
permissions: string[];
|
|
39
|
+
group: PermissionGroupEnum.UPDATE;
|
|
40
|
+
};
|
|
41
|
+
RESTORE: {
|
|
42
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.APPROVED];
|
|
43
|
+
permissions: string[];
|
|
44
|
+
group: PermissionGroupEnum.UPDATE;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
work_from_home: {
|
|
48
|
+
CREATE: {
|
|
49
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING];
|
|
50
|
+
permissions: string[];
|
|
51
|
+
group: PermissionGroupEnum.CREATE;
|
|
52
|
+
};
|
|
53
|
+
UPDATE: {
|
|
54
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING, import("../..").WorkFromHomeStatusEnum.UPDATE_APPROVAL_PENDING];
|
|
55
|
+
permissions: string[];
|
|
56
|
+
group: PermissionGroupEnum.UPDATE;
|
|
57
|
+
};
|
|
58
|
+
DELETE: {
|
|
59
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.DELETE_APPROVAL_PENDING, import("../..").WorkFromHomeStatusEnum.DELETED];
|
|
60
|
+
permissions: string[];
|
|
61
|
+
group: PermissionGroupEnum.DELETE;
|
|
62
|
+
};
|
|
63
|
+
APPROVE: {
|
|
64
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.APPROVED, import("../..").WorkFromHomeStatusEnum.DELETED];
|
|
65
|
+
permissions: string[];
|
|
66
|
+
group: PermissionGroupEnum.APPROVAL_FLOW;
|
|
67
|
+
};
|
|
68
|
+
REJECT: {
|
|
69
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.REJECTED, import("../..").WorkFromHomeStatusEnum.RESOLVED_REJECTED];
|
|
70
|
+
permissions: string[];
|
|
71
|
+
group: PermissionGroupEnum.APPROVAL_FLOW;
|
|
72
|
+
};
|
|
73
|
+
RECALL: {
|
|
74
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.APPROVED];
|
|
75
|
+
permissions: string[];
|
|
76
|
+
group: PermissionGroupEnum.UPDATE;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export type EnumToActionMap = typeof enumToActionMap;
|
|
81
|
+
/**
|
|
82
|
+
* The action enum registered for entity `E`, derived from {@link enumToActionMap}.
|
|
83
|
+
*
|
|
84
|
+
* Written as a mapped-union lookup rather than `EnumToActionMap[E]`'s `keyof`: both forms are
|
|
85
|
+
* strict at the call site, but only this form also lets the method body index the erased map
|
|
86
|
+
* below without a cast (TS cannot resolve `EnumToActionMap[E][keyof EnumToActionMap[E]]` —
|
|
87
|
+
* property access on that deferred generic indexed access is a compile error). Intersected
|
|
88
|
+
* with `string` because a bare `keyof` constraint includes `symbol`, which forbids template
|
|
89
|
+
* interpolation of the parameter (TS2731); map keys are always string enum members, so the
|
|
90
|
+
* intersection loses nothing.
|
|
91
|
+
*/
|
|
92
|
+
export type RegisteredActions<E extends keyof EnumToActionMap> = {
|
|
93
|
+
[K in keyof EnumToActionMap]: keyof EnumToActionMap[K] & string;
|
|
94
|
+
}[E];
|
|
95
|
+
export declare class FlowConfigUtils {
|
|
96
|
+
/**
|
|
97
|
+
* Resolves the permission group an entity's action is authorised under, from the entity's
|
|
98
|
+
* flat `ACTION_MAP`. Needs only the entity and the action — deliberately no status and no
|
|
99
|
+
* existing entity — so callers building search filters can use it before any entity data
|
|
100
|
+
* has been fetched.
|
|
101
|
+
*
|
|
102
|
+
* @param entity Registered entity; entities missing from `enumToActionMap` are compile errors.
|
|
103
|
+
* @param action That entity's action enum member. A member of another entity's action enum
|
|
104
|
+
* is a compile error even when its string value coincides.
|
|
105
|
+
* @throws AppBadRequestException (400) when the registry, the action, or the action's
|
|
106
|
+
* `group` annotation is missing. Never falls back to a default group: defaulting
|
|
107
|
+
* would authorise the action under another action's permissions.
|
|
108
|
+
*/
|
|
109
|
+
static getPermissionGroupByAction<E extends keyof EnumToActionMap>(entity: E, action: RegisteredActions<E>): PermissionGroupEnum;
|
|
110
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowConfigUtils = exports.enumToActionMap = void 0;
|
|
4
|
+
const error_key_enum_1 = require("../../../enums/error.key.enum");
|
|
5
|
+
const exceptions_1 = require("../../../exceptions");
|
|
6
|
+
const entity_utils_interface_1 = require("../../interface/entity.utils.interface");
|
|
7
|
+
const expense_type_flow_config_1 = require("../expense_type_flow.config");
|
|
8
|
+
const work_from_home_flow_config_1 = require("../work_from_home_flow.config");
|
|
9
|
+
/**
|
|
10
|
+
* Registry of per-entity action maps used by {@link FlowConfigUtils}.
|
|
11
|
+
*
|
|
12
|
+
* Every entry maps an {@link EntityEnum} member to the `ACTION_MAP` declared by that entity's
|
|
13
|
+
* flow config file. To register another entity: add `export` to its `ACTION_MAP` (only
|
|
14
|
+
* expense_type and work_from_home export it today) and add one line here. The typing below
|
|
15
|
+
* follows automatically:
|
|
16
|
+
* the entity parameter and the action parameter of `getPermissionGroupByAction` both derive
|
|
17
|
+
* from this object, so a new entity's actions are accepted only with that entity, and rejected
|
|
18
|
+
* for every other entity — including actions from a different enum that share the same string
|
|
19
|
+
* value (string enums are nominal across types).
|
|
20
|
+
*/
|
|
21
|
+
exports.enumToActionMap = {
|
|
22
|
+
[entity_utils_interface_1.EntityEnum.EXPENSE_TYPE]: expense_type_flow_config_1.ACTION_MAP,
|
|
23
|
+
[entity_utils_interface_1.EntityEnum.WORK_FROM_HOME]: work_from_home_flow_config_1.ACTION_MAP,
|
|
24
|
+
};
|
|
25
|
+
class FlowConfigUtils {
|
|
26
|
+
/**
|
|
27
|
+
* Resolves the permission group an entity's action is authorised under, from the entity's
|
|
28
|
+
* flat `ACTION_MAP`. Needs only the entity and the action — deliberately no status and no
|
|
29
|
+
* existing entity — so callers building search filters can use it before any entity data
|
|
30
|
+
* has been fetched.
|
|
31
|
+
*
|
|
32
|
+
* @param entity Registered entity; entities missing from `enumToActionMap` are compile errors.
|
|
33
|
+
* @param action That entity's action enum member. A member of another entity's action enum
|
|
34
|
+
* is a compile error even when its string value coincides.
|
|
35
|
+
* @throws AppBadRequestException (400) when the registry, the action, or the action's
|
|
36
|
+
* `group` annotation is missing. Never falls back to a default group: defaulting
|
|
37
|
+
* would authorise the action under another action's permissions.
|
|
38
|
+
*/
|
|
39
|
+
static getPermissionGroupByAction(entity, action) {
|
|
40
|
+
const actionMap = exports.enumToActionMap[entity];
|
|
41
|
+
if (!actionMap) {
|
|
42
|
+
throw new exceptions_1.AppBadRequestException({
|
|
43
|
+
key: error_key_enum_1.ErrorKeyEnum.ENTITY,
|
|
44
|
+
message: [`No action map registered for entity '${entity}'`],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const actionConfig = actionMap[action];
|
|
48
|
+
if (!actionConfig) {
|
|
49
|
+
throw new exceptions_1.AppBadRequestException({
|
|
50
|
+
key: error_key_enum_1.ErrorKeyEnum.ACTION,
|
|
51
|
+
message: [`Action '${action}' is not configured for entity '${entity}'`],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const group = actionConfig.group;
|
|
55
|
+
if (!group) {
|
|
56
|
+
throw new exceptions_1.AppBadRequestException({
|
|
57
|
+
key: error_key_enum_1.ErrorKeyEnum.PERMISSION_GROUP,
|
|
58
|
+
message: [`Action '${action}' for entity '${entity}' has no permission group configured. Declare it in the entity's flow config.`],
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return group;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.FlowConfigUtils = FlowConfigUtils;
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { FlowConfig } from "./flow-config.type";
|
|
2
|
+
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
2
3
|
import { WorkFromHomeActionEnum } from "../enums/work_from_home_action_enum";
|
|
3
4
|
import { WorkFromHomeStatusEnum } from "../enums/work_from_home_status_enum";
|
|
4
5
|
export interface IWorkFromHomeFlowConfigContextData {
|
|
5
6
|
}
|
|
7
|
+
export declare const ACTION_MAP: {
|
|
8
|
+
CREATE: {
|
|
9
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING];
|
|
10
|
+
permissions: string[];
|
|
11
|
+
group: PermissionGroupEnum.CREATE;
|
|
12
|
+
};
|
|
13
|
+
UPDATE: {
|
|
14
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING, WorkFromHomeStatusEnum.UPDATE_APPROVAL_PENDING];
|
|
15
|
+
permissions: string[];
|
|
16
|
+
group: PermissionGroupEnum.UPDATE;
|
|
17
|
+
};
|
|
18
|
+
DELETE: {
|
|
19
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.DELETE_APPROVAL_PENDING, WorkFromHomeStatusEnum.DELETED];
|
|
20
|
+
permissions: string[];
|
|
21
|
+
group: PermissionGroupEnum.DELETE;
|
|
22
|
+
};
|
|
23
|
+
APPROVE: {
|
|
24
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.APPROVED, WorkFromHomeStatusEnum.DELETED];
|
|
25
|
+
permissions: string[];
|
|
26
|
+
group: PermissionGroupEnum.APPROVAL_FLOW;
|
|
27
|
+
};
|
|
28
|
+
REJECT: {
|
|
29
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.REJECTED, WorkFromHomeStatusEnum.RESOLVED_REJECTED];
|
|
30
|
+
permissions: string[];
|
|
31
|
+
group: PermissionGroupEnum.APPROVAL_FLOW;
|
|
32
|
+
};
|
|
33
|
+
RECALL: {
|
|
34
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.APPROVED];
|
|
35
|
+
permissions: string[];
|
|
36
|
+
group: PermissionGroupEnum.UPDATE;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
6
39
|
export declare const workFromHomeFlowConfig: FlowConfig<WorkFromHomeStatusEnum, WorkFromHomeActionEnum, IWorkFromHomeFlowConfigContextData>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.workFromHomeFlowConfig = void 0;
|
|
3
|
+
exports.workFromHomeFlowConfig = exports.ACTION_MAP = void 0;
|
|
4
4
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
5
5
|
const permission_group_enum_1 = require("../enums/permission_group_enum");
|
|
6
6
|
const work_from_home_action_enum_1 = require("../enums/work_from_home_action_enum");
|
|
@@ -14,7 +14,8 @@ const WORK_FROM_HOME_REJECT_PERMISSION = ["WORK_FROM_HOME_APPROVER_ORG"];
|
|
|
14
14
|
const WORK_FROM_HOME_RECALL_PERMISSION = ["WORK_FROM_HOME_UPDATE_ORG", "WORK_FROM_HOME_UPDATE_SELF"];
|
|
15
15
|
// Every action declares its group. work_from_home_bulk_update.transaction.ts refuses to
|
|
16
16
|
// default an absent group, so all six must be annotated for any transition to keep working.
|
|
17
|
-
|
|
17
|
+
// Exported for the FlowConfigUtils.getPermissionGroupByAction registry.
|
|
18
|
+
exports.ACTION_MAP = {
|
|
18
19
|
[work_from_home_action_enum_1.WorkFromHomeActionEnum.CREATE]: {
|
|
19
20
|
reachableStatues: [work_from_home_status_enum_1.WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING],
|
|
20
21
|
permissions: WORK_FROM_HOME_CREATE_PERMISSION,
|
|
@@ -50,7 +51,7 @@ const ACTION_MAP = {
|
|
|
50
51
|
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
51
52
|
},
|
|
52
53
|
};
|
|
53
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
54
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(exports.ACTION_MAP);
|
|
54
55
|
// CREATE_APPROVAL_PENDING status transitions
|
|
55
56
|
const transitionCreateApprovalPendingStatusUpdateAction = createActionConfig(work_from_home_action_enum_1.WorkFromHomeActionEnum.UPDATE, work_from_home_status_enum_1.WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING);
|
|
56
57
|
const transitionCreateApprovalPendingStatusDeleteAction = createActionConfig(work_from_home_action_enum_1.WorkFromHomeActionEnum.DELETE, work_from_home_status_enum_1.WorkFromHomeStatusEnum.DELETED);
|
|
@@ -47,7 +47,7 @@ export * from "./flow-configs/reimbursement_flow.config";
|
|
|
47
47
|
export * from "./flow-configs/reimbursement_expense_flow.config";
|
|
48
48
|
export * from "./interface/reimbursement.entity.interface";
|
|
49
49
|
export * from "./interface/field-constraint/reimbursement_field_constraints.interface";
|
|
50
|
-
export * from "./enums/
|
|
50
|
+
export * from "./enums/expense_type_enum";
|
|
51
51
|
export * from "./enums/expense_type_action_enum";
|
|
52
52
|
export * from "./enums/expense_type_status_enum";
|
|
53
53
|
export * from "./flow-configs/expense_type_flow.config";
|
|
@@ -403,10 +403,11 @@ export * from "./interface/field-constraint/rate_field_constraints.interface";
|
|
|
403
403
|
export * from "./model/rate.entity.model";
|
|
404
404
|
export * from "./enums/work_from_home_action_enum";
|
|
405
405
|
export * from "./enums/work_from_home_status_enum";
|
|
406
|
-
export
|
|
406
|
+
export { IWorkFromHomeFlowConfigContextData, ACTION_MAP as WORK_FROM_HOME_ACTION_MAP, workFromHomeFlowConfig } from "./flow-configs/work_from_home_flow.config";
|
|
407
407
|
export * from "./interface/field-constraint/work_from_home_field_constraints.interface";
|
|
408
408
|
export * from "./interface/work_from_home.entity.interface";
|
|
409
409
|
export * from "./model/work_from_home.entity.model";
|
|
410
410
|
export * from "./enums/user_gender_enum";
|
|
411
411
|
export * from "./enums/user_role_enum";
|
|
412
412
|
export * from "./enums/user_status_enum";
|
|
413
|
+
export * from "./flow-configs/utils/flow-config.utils";
|
|
@@ -14,6 +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
18
|
__exportStar(require("./enums/organization_action_enum"), exports);
|
|
18
19
|
__exportStar(require("./enums/organization_status_enum"), exports);
|
|
19
20
|
__exportStar(require("./flow-configs/organization_flow.config"), exports);
|
|
@@ -63,7 +64,7 @@ __exportStar(require("./flow-configs/reimbursement_flow.config"), exports);
|
|
|
63
64
|
__exportStar(require("./flow-configs/reimbursement_expense_flow.config"), exports);
|
|
64
65
|
__exportStar(require("./interface/reimbursement.entity.interface"), exports);
|
|
65
66
|
__exportStar(require("./interface/field-constraint/reimbursement_field_constraints.interface"), exports);
|
|
66
|
-
__exportStar(require("./enums/
|
|
67
|
+
__exportStar(require("./enums/expense_type_enum"), exports);
|
|
67
68
|
__exportStar(require("./enums/expense_type_action_enum"), exports);
|
|
68
69
|
__exportStar(require("./enums/expense_type_status_enum"), exports);
|
|
69
70
|
__exportStar(require("./flow-configs/expense_type_flow.config"), exports);
|
|
@@ -420,10 +421,13 @@ __exportStar(require("./interface/field-constraint/rate_field_constraints.interf
|
|
|
420
421
|
__exportStar(require("./model/rate.entity.model"), exports);
|
|
421
422
|
__exportStar(require("./enums/work_from_home_action_enum"), exports);
|
|
422
423
|
__exportStar(require("./enums/work_from_home_status_enum"), exports);
|
|
423
|
-
|
|
424
|
+
var work_from_home_flow_config_1 = require("./flow-configs/work_from_home_flow.config");
|
|
425
|
+
Object.defineProperty(exports, "WORK_FROM_HOME_ACTION_MAP", { enumerable: true, get: function () { return work_from_home_flow_config_1.ACTION_MAP; } });
|
|
426
|
+
Object.defineProperty(exports, "workFromHomeFlowConfig", { enumerable: true, get: function () { return work_from_home_flow_config_1.workFromHomeFlowConfig; } });
|
|
424
427
|
__exportStar(require("./interface/field-constraint/work_from_home_field_constraints.interface"), exports);
|
|
425
428
|
__exportStar(require("./interface/work_from_home.entity.interface"), exports);
|
|
426
429
|
__exportStar(require("./model/work_from_home.entity.model"), exports);
|
|
427
430
|
__exportStar(require("./enums/user_gender_enum"), exports);
|
|
428
431
|
__exportStar(require("./enums/user_role_enum"), exports);
|
|
429
432
|
__exportStar(require("./enums/user_status_enum"), exports);
|
|
433
|
+
__exportStar(require("./flow-configs/utils/flow-config.utils"), exports);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ExpenseTypeEnum } from "../enums/
|
|
1
|
+
import { ExpenseTypeEnum } from "../enums/expense_type_enum";
|
|
2
2
|
import { ExpenseTypeStatusEnum } from "../enums/expense_type_status_enum";
|
|
3
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
4
|
+
import { Nullable } from "./entity.utils.interface";
|
|
4
5
|
export interface IExpenseTypeEntity extends IEntityAuditColumn {
|
|
5
6
|
id: number;
|
|
6
7
|
name: string;
|
|
7
|
-
description?: string
|
|
8
|
+
description?: Nullable<string>;
|
|
8
9
|
type: ExpenseTypeEnum;
|
|
9
10
|
status: ExpenseTypeStatusEnum;
|
|
10
11
|
}
|
package/dist/src/entities/interface/field-constraint/expense_type_field_constraints.interface.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { IEntityAuditColumn } from "../entity-audit-columns.interface";
|
|
2
2
|
import { IExpenseTypeEntity } from "../expense_type.entity.interface";
|
|
3
3
|
import { IFieldMinMaxConstraint } from "./utils";
|
|
4
|
-
/**
|
|
5
|
-
* excluded, and why:
|
|
6
|
-
* - "type", "status" enum columns, enums carry no min/max
|
|
7
|
-
* - "id", keyof IEntityAuditColumn generated columns
|
|
8
|
-
*
|
|
9
|
-
* this entity has a create DTO only — there is no ExpenseTypeUpdateDto, so no
|
|
10
|
-
* create/update disagreement is possible
|
|
11
|
-
*/
|
|
12
4
|
export type IExpenseTypeFieldLengthConstraintsExclude = "status" | "type" | "id" | keyof IEntityAuditColumn;
|
|
13
5
|
/**
|
|
14
6
|
* since some fields are optional, but we still need their
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
3
3
|
import { IUserEntity } from "../interface/user.entity.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
5
|
import { IRowActions } from "./interface/row-actions.interface";
|
|
5
6
|
import { UserEntityModel } from "./user.entity.model";
|
|
6
|
-
import {
|
|
7
|
+
import { ExpenseTypeActionEnum } from "../../entities";
|
|
8
|
+
import { ExpenseTypeEnum } from "../enums/expense_type_enum";
|
|
7
9
|
import { ExpenseTypeStatusEnum } from "../enums/expense_type_status_enum";
|
|
8
|
-
import {
|
|
10
|
+
import { IExpenseTypeFlowConfigContextData } from "../flow-configs/expense_type_flow.config";
|
|
9
11
|
import { IExpenseTypeEntity } from "../interface/expense_type.entity.interface";
|
|
10
|
-
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
11
|
-
import { BaseEntityModel } from "./base.entity.model";
|
|
12
12
|
export declare class ExpenseTypeEntityModel extends BaseEntityModel<EntityEnum.EXPENSE_TYPE> implements IExpenseTypeEntity {
|
|
13
13
|
id: number;
|
|
14
14
|
name: string;
|
|
@@ -21,7 +21,7 @@ export declare class ExpenseTypeEntityModel extends BaseEntityModel<EntityEnum.E
|
|
|
21
21
|
updatedBy: number;
|
|
22
22
|
static relationConfigs: RelationConfigs<[], EntityEnum.EXPENSE_TYPE>;
|
|
23
23
|
static fromEntity(entity: IExpenseTypeEntity): ExpenseTypeEntityModel;
|
|
24
|
-
getRelationConfigs(): [];
|
|
24
|
+
getRelationConfigs(): any[];
|
|
25
25
|
getNextStatus(currentUser: IUserEntity, action: ExpenseTypeActionEnum, expenseTypeFlowConfigContextData: IExpenseTypeFlowConfigContextData): ExpenseTypeStatusEnum;
|
|
26
26
|
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
27
27
|
combinedActions?: Record<string, {
|
|
@@ -4,17 +4,17 @@ exports.ExpenseTypeEntityModel = void 0;
|
|
|
4
4
|
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
5
5
|
const exceptions_1 = require("../../exceptions");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
|
-
const expense_type_flow_config_1 = require("../flow-configs/expense_type_flow.config");
|
|
8
|
-
const expense_type_entity_enum_1 = require("../enums/expense_type_entity_enum");
|
|
9
|
-
const expense_type_status_enum_1 = require("../enums/expense_type_status_enum");
|
|
10
7
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
11
8
|
const base_entity_model_1 = require("./base.entity.model");
|
|
9
|
+
const expense_type_enum_1 = require("../enums/expense_type_enum");
|
|
10
|
+
const expense_type_status_enum_1 = require("../enums/expense_type_status_enum");
|
|
11
|
+
const expense_type_flow_config_1 = require("../flow-configs/expense_type_flow.config");
|
|
12
12
|
class ExpenseTypeEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.id = 0;
|
|
16
16
|
this.name = "";
|
|
17
|
-
this.type =
|
|
17
|
+
this.type = expense_type_enum_1.ExpenseTypeEnum.BILLABLE;
|
|
18
18
|
this.status = expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED;
|
|
19
19
|
this.createdOn = 0;
|
|
20
20
|
this.updatedOn = 0;
|
|
@@ -27,7 +27,7 @@ class ExpenseTypeEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
29
29
|
getRelationConfigs() {
|
|
30
|
-
return
|
|
30
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
31
31
|
}
|
|
32
32
|
getNextStatus(currentUser, action, expenseTypeFlowConfigContextData) {
|
|
33
33
|
if (!this.status) {
|
|
@@ -66,7 +66,7 @@ class ExpenseTypeEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
66
66
|
if (!hasPermission) {
|
|
67
67
|
throw new exceptions_1.AppBadRequestException({
|
|
68
68
|
key: error_key_enum_1.ErrorKeyEnum.PERMISSION,
|
|
69
|
-
message: [`Current user does not have permission to ${action}
|
|
69
|
+
message: [`Current user does not have permission to ${action} expenseType`],
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
const nextStatus = matchingPermissionConfig.next(expenseTypeFlowConfigContextData);
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|