law-common 14.1.4-beta.0 → 14.1.4-beta.10
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}/office_location.create.dto.interface.d.ts +1 -1
- package/dist/src/api/{interface → v1/interface}/office_location.update.dto.interface.d.ts +1 -1
- package/dist/src/api/v2/index.d.ts +7 -5
- package/dist/src/api/v2/index.js +7 -7
- package/dist/src/api/v2/interface/office_location.create.dto.interface.d.ts +15 -0
- package/dist/src/api/v2/interface/office_location.create.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/office_location.update.dto.interface.d.ts +13 -0
- package/dist/src/api/v2/interface/office_location.update.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/task.create.dto.interface.d.ts +5 -0
- package/dist/src/api/v2/interface/task.create.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/task.update.dto.interface.d.ts +12 -0
- package/dist/src/api/v2/interface/task.update.dto.interface.js +2 -0
- package/dist/src/entities/flow-configs/country_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/country_flow.config.js +14 -3
- package/dist/src/entities/flow-configs/designation_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/designation_flow.config.js +14 -3
- package/dist/src/entities/flow-configs/industry_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/industry_flow.config.js +14 -3
- 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/rate_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/rate_flow.config.js +14 -3
- package/dist/src/entities/flow-configs/task_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/task_flow.config.js +14 -3
- package/dist/src/entities/flow-configs/to_do_list_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/to_do_list_flow.config.js +16 -3
- package/dist/src/entities/flow-configs/utils/flow-config.utils.d.ts +224 -0
- package/dist/src/entities/flow-configs/utils/flow-config.utils.js +14 -0
- package/dist/src/entities/index.d.ts +8 -7
- package/dist/src/entities/index.js +23 -8
- package/dist/src/entities/interface/field-constraint/office_location_address_field_constraints.interface.d.ts +13 -0
- package/dist/src/entities/interface/field-constraint/office_location_address_field_constraints.interface.js +17 -0
- package/dist/src/entities/interface/field-constraint/office_location_field_constraints.interface.d.ts +0 -9
- package/dist/src/entities/interface/field-constraint/office_location_field_constraints.interface.js +4 -13
- package/dist/src/entities/model/entity.model.interface.d.ts +10 -1
- package/dist/src/entities/model/entity.model.interface.js +29 -0
- package/dist/src/entities/model/office_location.entity.model.d.ts +66 -8
- package/dist/src/entities/model/office_location.entity.model.js +405 -6
- package/package.json +1 -1
- /package/dist/src/api/{interface → v1/interface}/office_location.create.dto.interface.js +0 -0
- /package/dist/src/api/{interface → v1/interface}/office_location.update.dto.interface.js +0 -0
package/dist/src/api/index.d.ts
CHANGED
|
@@ -35,10 +35,8 @@ export * from "./interface/billing_timesheet.details.dto.interface";
|
|
|
35
35
|
export * from "./interface/billing_timesheet.filter.dto.interface";
|
|
36
36
|
export * from "./interface/billing_timesheet.update.dto.interface";
|
|
37
37
|
export * from "./interface/billing.entity.response";
|
|
38
|
-
export * from "./interface/office_location.create.dto.interface";
|
|
39
38
|
export * from "./interface/office_location.entity.response";
|
|
40
39
|
export * from "./interface/office_location.filter.dto.interface";
|
|
41
|
-
export * from "./interface/office_location.update.dto.interface";
|
|
42
40
|
export * from "./interface/organization.filter.dto.interface";
|
|
43
41
|
export * from "./interface/billing.update.dto.interface";
|
|
44
42
|
export * from "./interface/moving_timesheet.create.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -74,10 +74,8 @@ __exportStar(require("./interface/billing_timesheet.details.dto.interface"), exp
|
|
|
74
74
|
__exportStar(require("./interface/billing_timesheet.filter.dto.interface"), exports);
|
|
75
75
|
__exportStar(require("./interface/billing_timesheet.update.dto.interface"), exports);
|
|
76
76
|
__exportStar(require("./interface/billing.entity.response"), exports);
|
|
77
|
-
__exportStar(require("./interface/office_location.create.dto.interface"), exports);
|
|
78
77
|
__exportStar(require("./interface/office_location.entity.response"), exports);
|
|
79
78
|
__exportStar(require("./interface/office_location.filter.dto.interface"), exports);
|
|
80
|
-
__exportStar(require("./interface/office_location.update.dto.interface"), exports);
|
|
81
79
|
__exportStar(require("./interface/organization.filter.dto.interface"), exports);
|
|
82
80
|
__exportStar(require("./interface/billing.update.dto.interface"), exports);
|
|
83
81
|
__exportStar(require("./interface/moving_timesheet.create.dto.interface"), exports);
|
|
@@ -7,5 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export * from "./interface/expense_type.create.dto.interface";
|
|
9
9
|
export * from "./interface/expense_type.update.dto.interface";
|
|
10
|
+
export * from "./interface/office_location.create.dto.interface";
|
|
11
|
+
export * from "./interface/office_location.update.dto.interface";
|
|
10
12
|
export * from "./interface/to_do_list.create.dto.interface";
|
|
11
13
|
export * from "./interface/to_do_list.update.dto.interface";
|
package/dist/src/api/v1/index.js
CHANGED
|
@@ -23,5 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
*/
|
|
24
24
|
__exportStar(require("./interface/expense_type.create.dto.interface"), exports);
|
|
25
25
|
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
26
|
+
__exportStar(require("./interface/office_location.create.dto.interface"), exports);
|
|
27
|
+
__exportStar(require("./interface/office_location.update.dto.interface"), exports);
|
|
26
28
|
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
27
29
|
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEntityCreateDto, IOfficeLocationEntity } from "
|
|
1
|
+
import { IEntityCreateDto, IOfficeLocationEntity } from "../../../entities";
|
|
2
2
|
/** status is set by the entity flow, never by the client */
|
|
3
3
|
export type IOfficeLocationCreateExclude = "status";
|
|
4
4
|
export interface IOfficeLocationCreateDto extends Omit<IEntityCreateDto<IOfficeLocationEntity>, IOfficeLocationCreateExclude> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEntityUpdateDto, IOfficeLocationEntity } from "
|
|
1
|
+
import { IEntityUpdateDto, IOfficeLocationEntity } from "../../../entities";
|
|
2
2
|
import { IOfficeLocationCreateExclude } from "./office_location.create.dto.interface";
|
|
3
3
|
export interface IOfficeLocationUpdateDto extends Omit<IEntityUpdateDto<IOfficeLocationEntity>, IOfficeLocationCreateExclude> {
|
|
4
4
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* api/v2 - the new flow contracts.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* and
|
|
7
|
-
*
|
|
8
|
-
* The empty export keeps this a module so `export * as v2` in api/index.ts resolves.
|
|
4
|
+
* Namespaced under `v2` by the `export * as v2` in api/index.ts, so these deliberately reuse the
|
|
5
|
+
* same export names as the frozen api/v1 (and legacy api/interface) contracts — an entity's v1
|
|
6
|
+
* consumers and v2 consumers each resolve their own shape from their own module path.
|
|
9
7
|
*/
|
|
10
8
|
export * from "./interface/to_do_list.create.dto.interface";
|
|
11
9
|
export * from "./interface/to_do_list.update.dto.interface";
|
|
12
10
|
export * from "./interface/expense_type.create.dto.interface";
|
|
13
11
|
export * from "./interface/expense_type.update.dto.interface";
|
|
12
|
+
export * from "./interface/office_location.create.dto.interface";
|
|
13
|
+
export * from "./interface/office_location.update.dto.interface";
|
|
14
|
+
export * from "./interface/task.create.dto.interface";
|
|
15
|
+
export * from "./interface/task.update.dto.interface";
|
package/dist/src/api/v2/index.js
CHANGED
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* api/v2 - the new flow contracts.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* and
|
|
8
|
-
*
|
|
9
|
-
* The empty export keeps this a module so `export * as v2` in api/index.ts resolves.
|
|
5
|
+
* Namespaced under `v2` by the `export * as v2` in api/index.ts, so these deliberately reuse the
|
|
6
|
+
* same export names as the frozen api/v1 (and legacy api/interface) contracts — an entity's v1
|
|
7
|
+
* consumers and v2 consumers each resolve their own shape from their own module path.
|
|
10
8
|
*/
|
|
11
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -23,9 +21,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
23
21
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
22
|
};
|
|
25
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
// export {
|
|
27
|
-
// };
|
|
28
24
|
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
29
25
|
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
30
26
|
__exportStar(require("./interface/expense_type.create.dto.interface"), exports);
|
|
31
27
|
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
28
|
+
__exportStar(require("./interface/office_location.create.dto.interface"), exports);
|
|
29
|
+
__exportStar(require("./interface/office_location.update.dto.interface"), exports);
|
|
30
|
+
__exportStar(require("./interface/task.create.dto.interface"), exports);
|
|
31
|
+
__exportStar(require("./interface/task.update.dto.interface"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IEntityCreateDto, Nullable } from "../../../entities";
|
|
2
|
+
import { IOfficeLocationEntity } from "../../../entities/interface/office_location.entity.interface";
|
|
3
|
+
export interface IOfficeLocationAddress {
|
|
4
|
+
addressLine1: string;
|
|
5
|
+
addressLine2?: Nullable<string>;
|
|
6
|
+
city: string;
|
|
7
|
+
state: string;
|
|
8
|
+
}
|
|
9
|
+
export type IOfficeLocationAddressCreateExclude = never;
|
|
10
|
+
export interface IOfficeLocationAddressCreateDto extends Omit<IEntityCreateDto<IOfficeLocationAddress>, IOfficeLocationAddressCreateExclude> {
|
|
11
|
+
}
|
|
12
|
+
export type IOfficeLocationCreateExclude = "address" | "organizationId" | "status";
|
|
13
|
+
export interface IOfficeLocationCreateDto extends Omit<IEntityCreateDto<IOfficeLocationEntity>, IOfficeLocationCreateExclude> {
|
|
14
|
+
address: IOfficeLocationAddressCreateDto;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DeepPartialButRequired } from "../../interface/api.utils.interface";
|
|
2
|
+
import { OfficeLocationActionEnum } from "../../../entities";
|
|
3
|
+
import { IOfficeLocationAddressCreateDto, IOfficeLocationCreateDto } from "./office_location.create.dto.interface";
|
|
4
|
+
export type IOfficeLocationAddressUpdateDto = DeepPartialButRequired<IOfficeLocationAddressCreateDto, never>;
|
|
5
|
+
export type IOfficeLocationUpdateDto = DeepPartialButRequired<IOfficeLocationCreateDto, never> & {
|
|
6
|
+
actionData: IOfficeLocationActionDataDto;
|
|
7
|
+
} & {
|
|
8
|
+
id?: number;
|
|
9
|
+
};
|
|
10
|
+
export interface IOfficeLocationActionDataDto {
|
|
11
|
+
action: OfficeLocationActionEnum;
|
|
12
|
+
remark?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../../entities";
|
|
2
|
+
import { ITaskEntity } from "../../../entities/interface/task.entity.interface";
|
|
3
|
+
export type ITaskCreateExclude = "status";
|
|
4
|
+
export interface ITaskCreateDto extends Omit<IEntityCreateDto<ITaskEntity>, ITaskCreateExclude> {
|
|
5
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeepPartialButRequired } from "../../interface/api.utils.interface";
|
|
2
|
+
import { TaskActionEnum } from "../../../entities";
|
|
3
|
+
import { ITaskCreateDto } from "./task.create.dto.interface";
|
|
4
|
+
export type ITaskUpdateDto = DeepPartialButRequired<ITaskCreateDto, never> & {
|
|
5
|
+
actionData: ITaskActionDataDto;
|
|
6
|
+
} & {
|
|
7
|
+
id?: number;
|
|
8
|
+
};
|
|
9
|
+
export interface ITaskActionDataDto {
|
|
10
|
+
action: TaskActionEnum;
|
|
11
|
+
remark?: string;
|
|
12
|
+
}
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { CountryActionEnum } from "../enums/country_action_enum";
|
|
2
2
|
import { CountryStatusEnum } from "../enums/country_status_enum";
|
|
3
|
+
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
3
4
|
import { FlowConfig } from "./flow-config.type";
|
|
4
5
|
export interface ICountryFlowConfigContextData {
|
|
5
6
|
}
|
|
7
|
+
export declare const ACTION_MAP: {
|
|
8
|
+
CREATE: {
|
|
9
|
+
reachableStatues: readonly [CountryStatusEnum.APPROVED];
|
|
10
|
+
permissions: string[];
|
|
11
|
+
group: PermissionGroupEnum.CREATE;
|
|
12
|
+
};
|
|
13
|
+
UPDATE: {
|
|
14
|
+
reachableStatues: readonly [CountryStatusEnum.APPROVED];
|
|
15
|
+
permissions: string[];
|
|
16
|
+
group: PermissionGroupEnum.UPDATE;
|
|
17
|
+
};
|
|
18
|
+
DELETE: {
|
|
19
|
+
reachableStatues: readonly [CountryStatusEnum.DELETED];
|
|
20
|
+
permissions: string[];
|
|
21
|
+
group: PermissionGroupEnum.DELETE;
|
|
22
|
+
};
|
|
23
|
+
DEACTIVATE: {
|
|
24
|
+
reachableStatues: readonly [CountryStatusEnum.DEACTIVATED];
|
|
25
|
+
permissions: string[];
|
|
26
|
+
group: PermissionGroupEnum.UPDATE;
|
|
27
|
+
};
|
|
28
|
+
ACTIVATE: {
|
|
29
|
+
reachableStatues: readonly [CountryStatusEnum.APPROVED];
|
|
30
|
+
permissions: string[];
|
|
31
|
+
group: PermissionGroupEnum.UPDATE;
|
|
32
|
+
};
|
|
33
|
+
RESTORE: {
|
|
34
|
+
reachableStatues: readonly [CountryStatusEnum.APPROVED];
|
|
35
|
+
permissions: string[];
|
|
36
|
+
group: PermissionGroupEnum.UPDATE;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
6
39
|
export declare const countryFlowConfig: FlowConfig<CountryStatusEnum, CountryActionEnum, ICountryFlowConfigContextData>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.countryFlowConfig = void 0;
|
|
3
|
+
exports.countryFlowConfig = exports.ACTION_MAP = void 0;
|
|
4
4
|
const country_action_enum_1 = require("../enums/country_action_enum");
|
|
5
5
|
const country_status_enum_1 = require("../enums/country_status_enum");
|
|
6
|
+
const permission_group_enum_1 = require("../enums/permission_group_enum");
|
|
6
7
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
7
8
|
const COUNTRY_CREATE_PERMISSION = ["COUNTRY_CREATE"];
|
|
8
9
|
const COUNTRY_UPDATE_PERMISSION = ["COUNTRY_UPDATE"];
|
|
@@ -10,33 +11,43 @@ const COUNTRY_DELETE_PERMISSION = ["COUNTRY_DELETE"];
|
|
|
10
11
|
const COUNTRY_DEACTIVATE_PERMISSION = ["COUNTRY_DEACTIVATE"];
|
|
11
12
|
const COUNTRY_ACTIVATE_PERMISSION = ["COUNTRY_ACTIVATE"];
|
|
12
13
|
const COUNTRY_RESTORE_PERMISSION = ["COUNTRY_RESTORE"];
|
|
13
|
-
|
|
14
|
+
// Every action declares its group. country_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. The three lifecycle actions share the UPDATE group
|
|
17
|
+
// because that is where `derivePermissionGroup` classifies them.
|
|
18
|
+
exports.ACTION_MAP = {
|
|
14
19
|
[country_action_enum_1.CountryActionEnum.CREATE]: {
|
|
15
20
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
16
21
|
permissions: COUNTRY_CREATE_PERMISSION,
|
|
22
|
+
group: permission_group_enum_1.PermissionGroupEnum.CREATE,
|
|
17
23
|
},
|
|
18
24
|
[country_action_enum_1.CountryActionEnum.UPDATE]: {
|
|
19
25
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
20
26
|
permissions: COUNTRY_UPDATE_PERMISSION,
|
|
27
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
21
28
|
},
|
|
22
29
|
[country_action_enum_1.CountryActionEnum.DELETE]: {
|
|
23
30
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.DELETED],
|
|
24
31
|
permissions: COUNTRY_DELETE_PERMISSION,
|
|
32
|
+
group: permission_group_enum_1.PermissionGroupEnum.DELETE,
|
|
25
33
|
},
|
|
26
34
|
[country_action_enum_1.CountryActionEnum.DEACTIVATE]: {
|
|
27
35
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.DEACTIVATED],
|
|
28
36
|
permissions: COUNTRY_DEACTIVATE_PERMISSION,
|
|
37
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
29
38
|
},
|
|
30
39
|
[country_action_enum_1.CountryActionEnum.ACTIVATE]: {
|
|
31
40
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
32
41
|
permissions: COUNTRY_ACTIVATE_PERMISSION,
|
|
42
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
33
43
|
},
|
|
34
44
|
[country_action_enum_1.CountryActionEnum.RESTORE]: {
|
|
35
45
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
36
46
|
permissions: COUNTRY_RESTORE_PERMISSION,
|
|
47
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
37
48
|
},
|
|
38
49
|
};
|
|
39
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
50
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(exports.ACTION_MAP);
|
|
40
51
|
// APPROVED status transitions
|
|
41
52
|
const transitionApprovedStatusUpdateAction = createActionConfig(country_action_enum_1.CountryActionEnum.UPDATE, country_status_enum_1.CountryStatusEnum.APPROVED);
|
|
42
53
|
const transitionApprovedStatusDeleteAction = createActionConfig(country_action_enum_1.CountryActionEnum.DELETE, country_status_enum_1.CountryStatusEnum.DELETED);
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { FlowConfig } from "./flow-config.type";
|
|
2
2
|
import { DesignationActionEnum } from "../enums/designation_action_enum";
|
|
3
3
|
import { DesignationStatusEnum } from "../enums/designation_status_enum";
|
|
4
|
+
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
4
5
|
export interface IDesignationFlowConfigContextData {
|
|
5
6
|
}
|
|
7
|
+
export declare const ACTION_MAP: {
|
|
8
|
+
CREATE: {
|
|
9
|
+
reachableStatues: readonly [DesignationStatusEnum.APPROVED];
|
|
10
|
+
permissions: string[];
|
|
11
|
+
group: PermissionGroupEnum.CREATE;
|
|
12
|
+
};
|
|
13
|
+
UPDATE: {
|
|
14
|
+
reachableStatues: readonly [DesignationStatusEnum.APPROVED];
|
|
15
|
+
permissions: string[];
|
|
16
|
+
group: PermissionGroupEnum.UPDATE;
|
|
17
|
+
};
|
|
18
|
+
DELETE: {
|
|
19
|
+
reachableStatues: readonly [DesignationStatusEnum.DELETED];
|
|
20
|
+
permissions: string[];
|
|
21
|
+
group: PermissionGroupEnum.DELETE;
|
|
22
|
+
};
|
|
23
|
+
DEACTIVATE: {
|
|
24
|
+
reachableStatues: readonly [DesignationStatusEnum.DEACTIVATED];
|
|
25
|
+
permissions: string[];
|
|
26
|
+
group: PermissionGroupEnum.UPDATE;
|
|
27
|
+
};
|
|
28
|
+
ACTIVATE: {
|
|
29
|
+
reachableStatues: readonly [DesignationStatusEnum.APPROVED];
|
|
30
|
+
permissions: string[];
|
|
31
|
+
group: PermissionGroupEnum.UPDATE;
|
|
32
|
+
};
|
|
33
|
+
RESTORE: {
|
|
34
|
+
reachableStatues: readonly [DesignationStatusEnum.APPROVED];
|
|
35
|
+
permissions: string[];
|
|
36
|
+
group: PermissionGroupEnum.UPDATE;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
6
39
|
export declare const designationFlowConfig: FlowConfig<DesignationStatusEnum, DesignationActionEnum, IDesignationFlowConfigContextData>;
|
|
@@ -1,42 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.designationFlowConfig = void 0;
|
|
3
|
+
exports.designationFlowConfig = exports.ACTION_MAP = void 0;
|
|
4
4
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
5
5
|
const designation_action_enum_1 = require("../enums/designation_action_enum");
|
|
6
6
|
const designation_status_enum_1 = require("../enums/designation_status_enum");
|
|
7
|
+
const permission_group_enum_1 = require("../enums/permission_group_enum");
|
|
7
8
|
const DESIGNATION_CREATE_PERMISSION = ["DESIGNATION_CREATE"];
|
|
8
9
|
const DESIGNATION_UPDATE_PERMISSION = ["DESIGNATION_UPDATE"];
|
|
9
10
|
const DESIGNATION_DELETE_PERMISSION = ["DESIGNATION_DELETE"];
|
|
10
11
|
const DESIGNATION_DEACTIVATE_PERMISSION = ["DESIGNATION_DEACTIVATE"];
|
|
11
12
|
const DESIGNATION_ACTIVATE_PERMISSION = ["DESIGNATION_ACTIVATE"];
|
|
12
13
|
const DESIGNATION_RESTORE_PERMISSION = ["DESIGNATION_RESTORE"];
|
|
13
|
-
|
|
14
|
+
// Every action declares its group. designation_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. The three lifecycle actions share the UPDATE group
|
|
17
|
+
// because that is where `derivePermissionGroup` classifies them.
|
|
18
|
+
exports.ACTION_MAP = {
|
|
14
19
|
[designation_action_enum_1.DesignationActionEnum.CREATE]: {
|
|
15
20
|
reachableStatues: [designation_status_enum_1.DesignationStatusEnum.APPROVED],
|
|
16
21
|
permissions: DESIGNATION_CREATE_PERMISSION,
|
|
22
|
+
group: permission_group_enum_1.PermissionGroupEnum.CREATE,
|
|
17
23
|
},
|
|
18
24
|
[designation_action_enum_1.DesignationActionEnum.UPDATE]: {
|
|
19
25
|
reachableStatues: [designation_status_enum_1.DesignationStatusEnum.APPROVED],
|
|
20
26
|
permissions: DESIGNATION_UPDATE_PERMISSION,
|
|
27
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
21
28
|
},
|
|
22
29
|
[designation_action_enum_1.DesignationActionEnum.DELETE]: {
|
|
23
30
|
reachableStatues: [designation_status_enum_1.DesignationStatusEnum.DELETED],
|
|
24
31
|
permissions: DESIGNATION_DELETE_PERMISSION,
|
|
32
|
+
group: permission_group_enum_1.PermissionGroupEnum.DELETE,
|
|
25
33
|
},
|
|
26
34
|
[designation_action_enum_1.DesignationActionEnum.DEACTIVATE]: {
|
|
27
35
|
reachableStatues: [designation_status_enum_1.DesignationStatusEnum.DEACTIVATED],
|
|
28
36
|
permissions: DESIGNATION_DEACTIVATE_PERMISSION,
|
|
37
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
29
38
|
},
|
|
30
39
|
[designation_action_enum_1.DesignationActionEnum.ACTIVATE]: {
|
|
31
40
|
reachableStatues: [designation_status_enum_1.DesignationStatusEnum.APPROVED],
|
|
32
41
|
permissions: DESIGNATION_ACTIVATE_PERMISSION,
|
|
42
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
33
43
|
},
|
|
34
44
|
[designation_action_enum_1.DesignationActionEnum.RESTORE]: {
|
|
35
45
|
reachableStatues: [designation_status_enum_1.DesignationStatusEnum.APPROVED],
|
|
36
46
|
permissions: DESIGNATION_RESTORE_PERMISSION,
|
|
47
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
37
48
|
},
|
|
38
49
|
};
|
|
39
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
50
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(exports.ACTION_MAP);
|
|
40
51
|
// APPROVED status transitions
|
|
41
52
|
const transitionApprovedStatusUpdateAction = createActionConfig(designation_action_enum_1.DesignationActionEnum.UPDATE, designation_status_enum_1.DesignationStatusEnum.APPROVED);
|
|
42
53
|
const transitionApprovedStatusDeleteAction = createActionConfig(designation_action_enum_1.DesignationActionEnum.DELETE, designation_status_enum_1.DesignationStatusEnum.DELETED);
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { FlowConfig } from "./flow-config.type";
|
|
2
2
|
import { IndustryActionEnum } from "../enums/industry_action_enum";
|
|
3
3
|
import { IndustryStatusEnum } from "../enums/industry_status_enum";
|
|
4
|
+
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
4
5
|
export interface IIndustryFlowConfigContextData {
|
|
5
6
|
}
|
|
7
|
+
export declare const ACTION_MAP: {
|
|
8
|
+
CREATE: {
|
|
9
|
+
reachableStatues: readonly [IndustryStatusEnum.APPROVED];
|
|
10
|
+
permissions: string[];
|
|
11
|
+
group: PermissionGroupEnum.CREATE;
|
|
12
|
+
};
|
|
13
|
+
UPDATE: {
|
|
14
|
+
reachableStatues: readonly [IndustryStatusEnum.APPROVED];
|
|
15
|
+
permissions: string[];
|
|
16
|
+
group: PermissionGroupEnum.UPDATE;
|
|
17
|
+
};
|
|
18
|
+
DELETE: {
|
|
19
|
+
reachableStatues: readonly [IndustryStatusEnum.DELETED];
|
|
20
|
+
permissions: string[];
|
|
21
|
+
group: PermissionGroupEnum.DELETE;
|
|
22
|
+
};
|
|
23
|
+
DEACTIVATE: {
|
|
24
|
+
reachableStatues: readonly [IndustryStatusEnum.DEACTIVATED];
|
|
25
|
+
permissions: string[];
|
|
26
|
+
group: PermissionGroupEnum.UPDATE;
|
|
27
|
+
};
|
|
28
|
+
ACTIVATE: {
|
|
29
|
+
reachableStatues: readonly [IndustryStatusEnum.APPROVED];
|
|
30
|
+
permissions: string[];
|
|
31
|
+
group: PermissionGroupEnum.UPDATE;
|
|
32
|
+
};
|
|
33
|
+
RESTORE: {
|
|
34
|
+
reachableStatues: readonly [IndustryStatusEnum.APPROVED];
|
|
35
|
+
permissions: string[];
|
|
36
|
+
group: PermissionGroupEnum.UPDATE;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
6
39
|
export declare const industryFlowConfig: FlowConfig<IndustryStatusEnum, IndustryActionEnum, IIndustryFlowConfigContextData>;
|
|
@@ -1,42 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.industryFlowConfig = void 0;
|
|
3
|
+
exports.industryFlowConfig = exports.ACTION_MAP = void 0;
|
|
4
4
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
5
5
|
const industry_action_enum_1 = require("../enums/industry_action_enum");
|
|
6
6
|
const industry_status_enum_1 = require("../enums/industry_status_enum");
|
|
7
|
+
const permission_group_enum_1 = require("../enums/permission_group_enum");
|
|
7
8
|
const INDUSTRY_CREATE_PERMISSION = ["INDUSTRY_CREATE"];
|
|
8
9
|
const INDUSTRY_UPDATE_PERMISSION = ["INDUSTRY_UPDATE"];
|
|
9
10
|
const INDUSTRY_DELETE_PERMISSION = ["INDUSTRY_DELETE"];
|
|
10
11
|
const INDUSTRY_DEACTIVATE_PERMISSION = ["INDUSTRY_DEACTIVATE"];
|
|
11
12
|
const INDUSTRY_ACTIVATE_PERMISSION = ["INDUSTRY_ACTIVATE"];
|
|
12
13
|
const INDUSTRY_RESTORE_PERMISSION = ["INDUSTRY_RESTORE"];
|
|
13
|
-
|
|
14
|
+
// Every action declares its group. industry_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. The three lifecycle actions share the UPDATE group
|
|
17
|
+
// because that is where `derivePermissionGroup` classifies them.
|
|
18
|
+
exports.ACTION_MAP = {
|
|
14
19
|
[industry_action_enum_1.IndustryActionEnum.CREATE]: {
|
|
15
20
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
16
21
|
permissions: INDUSTRY_CREATE_PERMISSION,
|
|
22
|
+
group: permission_group_enum_1.PermissionGroupEnum.CREATE,
|
|
17
23
|
},
|
|
18
24
|
[industry_action_enum_1.IndustryActionEnum.UPDATE]: {
|
|
19
25
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
20
26
|
permissions: INDUSTRY_UPDATE_PERMISSION,
|
|
27
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
21
28
|
},
|
|
22
29
|
[industry_action_enum_1.IndustryActionEnum.DELETE]: {
|
|
23
30
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.DELETED],
|
|
24
31
|
permissions: INDUSTRY_DELETE_PERMISSION,
|
|
32
|
+
group: permission_group_enum_1.PermissionGroupEnum.DELETE,
|
|
25
33
|
},
|
|
26
34
|
[industry_action_enum_1.IndustryActionEnum.DEACTIVATE]: {
|
|
27
35
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.DEACTIVATED],
|
|
28
36
|
permissions: INDUSTRY_DEACTIVATE_PERMISSION,
|
|
37
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
29
38
|
},
|
|
30
39
|
[industry_action_enum_1.IndustryActionEnum.ACTIVATE]: {
|
|
31
40
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
32
41
|
permissions: INDUSTRY_ACTIVATE_PERMISSION,
|
|
42
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
33
43
|
},
|
|
34
44
|
[industry_action_enum_1.IndustryActionEnum.RESTORE]: {
|
|
35
45
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
36
46
|
permissions: INDUSTRY_RESTORE_PERMISSION,
|
|
47
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
37
48
|
},
|
|
38
49
|
};
|
|
39
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
50
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(exports.ACTION_MAP);
|
|
40
51
|
// APPROVED status transitions
|
|
41
52
|
const transitionApprovedStatusUpdateAction = createActionConfig(industry_action_enum_1.IndustryActionEnum.UPDATE, industry_status_enum_1.IndustryStatusEnum.APPROVED);
|
|
42
53
|
const transitionApprovedStatusDeleteAction = createActionConfig(industry_action_enum_1.IndustryActionEnum.DELETE, industry_status_enum_1.IndustryStatusEnum.DELETED);
|
|
@@ -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);
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { FlowConfig } from "./flow-config.type";
|
|
2
2
|
import { RateActionEnum } from "../enums/rate_action_enum";
|
|
3
3
|
import { RateStatusEnum } from "../enums/rate_status_enum";
|
|
4
|
+
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
4
5
|
export interface IRateFlowConfigContextData {
|
|
5
6
|
}
|
|
7
|
+
export declare const ACTION_MAP: {
|
|
8
|
+
CREATE: {
|
|
9
|
+
reachableStatues: readonly [RateStatusEnum.APPROVED];
|
|
10
|
+
permissions: string[];
|
|
11
|
+
group: PermissionGroupEnum.CREATE;
|
|
12
|
+
};
|
|
13
|
+
UPDATE: {
|
|
14
|
+
reachableStatues: readonly [RateStatusEnum.APPROVED];
|
|
15
|
+
permissions: string[];
|
|
16
|
+
group: PermissionGroupEnum.UPDATE;
|
|
17
|
+
};
|
|
18
|
+
DELETE: {
|
|
19
|
+
reachableStatues: readonly [RateStatusEnum.DELETED];
|
|
20
|
+
permissions: string[];
|
|
21
|
+
group: PermissionGroupEnum.DELETE;
|
|
22
|
+
};
|
|
23
|
+
DEACTIVATE: {
|
|
24
|
+
reachableStatues: readonly [RateStatusEnum.DEACTIVATED];
|
|
25
|
+
permissions: string[];
|
|
26
|
+
group: PermissionGroupEnum.UPDATE;
|
|
27
|
+
};
|
|
28
|
+
ACTIVATE: {
|
|
29
|
+
reachableStatues: readonly [RateStatusEnum.APPROVED];
|
|
30
|
+
permissions: string[];
|
|
31
|
+
group: PermissionGroupEnum.UPDATE;
|
|
32
|
+
};
|
|
33
|
+
RESTORE: {
|
|
34
|
+
reachableStatues: readonly [RateStatusEnum.APPROVED];
|
|
35
|
+
permissions: string[];
|
|
36
|
+
group: PermissionGroupEnum.UPDATE;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
6
39
|
export declare const rateFlowConfig: FlowConfig<RateStatusEnum, RateActionEnum, IRateFlowConfigContextData>;
|