law-common 12.6.3-beta.6 → 12.6.3-beta.7
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/entities/index.d.ts +0 -3
- package/dist/src/entities/index.js +0 -3
- package/dist/src/entities/interface/country.entity.interface.d.ts +3 -11
- package/dist/src/entities/interface/country.entity.interface.js +0 -7
- package/dist/src/entities/model/country.entity.model.d.ts +3 -25
- package/dist/src/entities/model/country.entity.model.js +8 -77
- package/dist/src/entities/model/entity.model.interface.js +1 -1
- package/package.json +1 -1
- package/dist/src/api/interface/country.create.dto.interface.d.ts +0 -4
- package/dist/src/api/interface/country.create.dto.interface.js +0 -2
- package/dist/src/api/interface/country.update.dto.interface.d.ts +0 -11
- package/dist/src/api/interface/country.update.dto.interface.js +0 -5
- package/dist/src/entities/enums/country.action.enum.d.ts +0 -8
- package/dist/src/entities/enums/country.action.enum.js +0 -17
- package/dist/src/entities/enums/country_status_enum.d.ts +0 -5
- package/dist/src/entities/enums/country_status_enum.js +0 -9
- package/dist/src/entities/flow-configs/country_flow.config.d.ts +0 -6
- package/dist/src/entities/flow-configs/country_flow.config.js +0 -70
package/dist/src/api/index.d.ts
CHANGED
|
@@ -66,8 +66,6 @@ export * from "./interface/tds_rate_voucher_type_mapping.create.dto.interface";
|
|
|
66
66
|
export * from "./interface/tds_rate_voucher_type_mapping.update.dto.interface";
|
|
67
67
|
export * from "./interface/voucher_type.create.dto.interface";
|
|
68
68
|
export * from "./interface/voucher_type.update.dto.interface";
|
|
69
|
-
export * from "./interface/country.create.dto.interface";
|
|
70
|
-
export * from "./interface/country.update.dto.interface";
|
|
71
69
|
export * from "./interface/client.create.dto.interface";
|
|
72
70
|
export * from "./interface/expense_head.create.dto.interface";
|
|
73
71
|
export * from "./interface/expense_head.update.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -86,8 +86,6 @@ __exportStar(require("./interface/tds_rate_voucher_type_mapping.create.dto.inter
|
|
|
86
86
|
__exportStar(require("./interface/tds_rate_voucher_type_mapping.update.dto.interface"), exports);
|
|
87
87
|
__exportStar(require("./interface/voucher_type.create.dto.interface"), exports);
|
|
88
88
|
__exportStar(require("./interface/voucher_type.update.dto.interface"), exports);
|
|
89
|
-
__exportStar(require("./interface/country.create.dto.interface"), exports);
|
|
90
|
-
__exportStar(require("./interface/country.update.dto.interface"), exports);
|
|
91
89
|
__exportStar(require("./interface/client.create.dto.interface"), exports);
|
|
92
90
|
__exportStar(require("./interface/expense_head.create.dto.interface"), exports);
|
|
93
91
|
__exportStar(require("./interface/expense_head.update.dto.interface"), exports);
|
|
@@ -59,9 +59,6 @@ export * from "./enums/work.from.home.action.enum";
|
|
|
59
59
|
export * from "./enums/work.from.home.status.enum";
|
|
60
60
|
export * from "./interface/work_from_home.entity.interface";
|
|
61
61
|
export * from "./interface/work_from_home_history.entity.interface";
|
|
62
|
-
export * from "./enums/country.action.enum";
|
|
63
|
-
export * from "./enums/country_status_enum";
|
|
64
|
-
export * from "./flow-configs/country_flow.config";
|
|
65
62
|
export * from "./interface/country.entity.interface";
|
|
66
63
|
export * from "./enums/billing_invoice_type.enum";
|
|
67
64
|
export * from "./interface/billing_timesheet.entity.interface";
|
|
@@ -75,9 +75,6 @@ __exportStar(require("./enums/work.from.home.action.enum"), exports);
|
|
|
75
75
|
__exportStar(require("./enums/work.from.home.status.enum"), exports);
|
|
76
76
|
__exportStar(require("./interface/work_from_home.entity.interface"), exports);
|
|
77
77
|
__exportStar(require("./interface/work_from_home_history.entity.interface"), exports);
|
|
78
|
-
__exportStar(require("./enums/country.action.enum"), exports);
|
|
79
|
-
__exportStar(require("./enums/country_status_enum"), exports);
|
|
80
|
-
__exportStar(require("./flow-configs/country_flow.config"), exports);
|
|
81
78
|
__exportStar(require("./interface/country.entity.interface"), exports);
|
|
82
79
|
__exportStar(require("./enums/billing_invoice_type.enum"), exports);
|
|
83
80
|
__exportStar(require("./interface/billing_timesheet.entity.interface"), exports);
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import { CountryStatusEnum } from "../enums/country_status_enum";
|
|
2
1
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
|
-
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto
|
|
2
|
+
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
4
3
|
export interface ICountryEntity extends IEntityAuditColumn {
|
|
5
4
|
id: number;
|
|
6
5
|
name: string;
|
|
7
|
-
status: CountryStatusEnum;
|
|
8
6
|
}
|
|
9
|
-
export
|
|
10
|
-
export interface ICountryEntityCreateDto extends Omit<IEntityCreateDto<ICountryEntity>, ICountryCreateDtoExclude> {
|
|
7
|
+
export interface ICountryEntityCreateDto extends IEntityCreateDto<ICountryEntity> {
|
|
11
8
|
}
|
|
12
|
-
export interface ICountryEntityUpdateDto extends
|
|
9
|
+
export interface ICountryEntityUpdateDto extends IEntityUpdateDto<ICountryEntity> {
|
|
13
10
|
}
|
|
14
11
|
export type ICountryEntityFilterData = IEntityFilterData<ICountryEntity>;
|
|
15
|
-
export type ICountryFieldLengthConstraintsExclude = "status" | "id" | keyof IEntityAuditColumn;
|
|
16
|
-
export type ICountryFieldLengthConstraints = {
|
|
17
|
-
[K in keyof Omit<ICountryEntity, ICountryFieldLengthConstraintsExclude>]-?: IFieldLengthConstraint;
|
|
18
|
-
};
|
|
19
|
-
export declare const countryFieldLengthConstraints: ICountryFieldLengthConstraints;
|
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
import { CountryActionEnum } from "../enums/country.action.enum";
|
|
2
|
-
import { CountryStatusEnum } from "../enums/country_status_enum";
|
|
3
|
-
import { ICountryFlowConfigContextData } from "../flow-configs/country_flow.config";
|
|
4
1
|
import { ICountryEntity } from "../interface/country.entity.interface";
|
|
5
|
-
|
|
6
|
-
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
7
|
-
import { IUserEntity } from "../interface/user.entity.interface";
|
|
8
|
-
import { BaseEntityModel } from "./base.entity.model";
|
|
9
|
-
import { IRowActions } from "./interface/row-actions.interface";
|
|
10
|
-
import { UserEntityModel } from "./user.entity.model";
|
|
11
|
-
export declare class CountryEntityModel extends BaseEntityModel<EntityEnum.COUNTRY> implements ICountryEntity {
|
|
2
|
+
export declare class CountryEntityModel implements ICountryEntity {
|
|
12
3
|
id: number;
|
|
13
4
|
name: string;
|
|
14
|
-
status: CountryStatusEnum;
|
|
15
5
|
createdBy: number;
|
|
16
6
|
updatedBy: number;
|
|
17
7
|
createdOn: number;
|
|
18
8
|
updatedOn: number;
|
|
19
|
-
|
|
20
|
-
static
|
|
21
|
-
getRelationConfigs(): any[];
|
|
22
|
-
getNextStatus(currentUser: IUserEntity, action: CountryActionEnum, countryFlowConfigContextData: ICountryFlowConfigContextData): CountryStatusEnum;
|
|
23
|
-
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
24
|
-
combinedActions?: Record<string, {
|
|
25
|
-
combineActions: CountryActionEnum[];
|
|
26
|
-
label: string;
|
|
27
|
-
}>;
|
|
28
|
-
customLabels?: Partial<Record<CountryActionEnum, string>>;
|
|
29
|
-
}): IRowActions<EntityEnum.COUNTRY>[];
|
|
30
|
-
getUpdateActionVisibility(currentUser: UserEntityModel): {
|
|
31
|
-
[key: string]: () => boolean;
|
|
32
|
-
};
|
|
9
|
+
constructor(data?: ICountryEntity);
|
|
10
|
+
static fromApiEntity(apiEntity: ICountryEntity): CountryEntityModel;
|
|
33
11
|
}
|
|
@@ -1,90 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// import { ICountryApiEntity } from "../../api";
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.CountryEntityModel = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const utils_1 = require("../../utils");
|
|
7
|
-
const country_status_enum_1 = require("../enums/country_status_enum");
|
|
8
|
-
const country_flow_config_1 = require("../flow-configs/country_flow.config");
|
|
9
|
-
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
10
|
-
const base_entity_model_1 = require("./base.entity.model");
|
|
11
|
-
class CountryEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
5
|
+
class CountryEntityModel {
|
|
6
|
+
constructor(data) {
|
|
14
7
|
this.id = 0;
|
|
15
8
|
this.name = "";
|
|
16
|
-
this.status = country_status_enum_1.CountryStatusEnum.APPROVED;
|
|
17
9
|
this.createdBy = 0;
|
|
18
10
|
this.updatedBy = 0;
|
|
19
11
|
this.createdOn = 0;
|
|
20
12
|
this.updatedOn = 0;
|
|
13
|
+
Object.assign(this, data);
|
|
21
14
|
}
|
|
22
|
-
static
|
|
23
|
-
const
|
|
24
|
-
Object.assign(
|
|
25
|
-
return
|
|
26
|
-
}
|
|
27
|
-
getRelationConfigs() {
|
|
28
|
-
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
29
|
-
}
|
|
30
|
-
getNextStatus(currentUser, action, countryFlowConfigContextData) {
|
|
31
|
-
if (!this.status) {
|
|
32
|
-
throw new exceptions_1.AppBadRequestException({
|
|
33
|
-
key: enums_1.ErrorKeyEnum.STATUS,
|
|
34
|
-
message: [`Status not found: ${this.status}`],
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
const flowForStatus = country_flow_config_1.countryFlowConfig[this.status];
|
|
38
|
-
if (!flowForStatus) {
|
|
39
|
-
throw new exceptions_1.AppBadRequestException({
|
|
40
|
-
key: enums_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: enums_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: enums_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: enums_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: enums_1.ErrorKeyEnum.PERMISSION,
|
|
67
|
-
message: [`Current user does not have permission to ${action} country`],
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
const nextStatus = matchingPermissionConfig.next(countryFlowConfigContextData);
|
|
71
|
-
return nextStatus;
|
|
72
|
-
}
|
|
73
|
-
getAvailableActions(currentUser, config) {
|
|
74
|
-
var _a;
|
|
75
|
-
const params = {
|
|
76
|
-
flowConfig: country_flow_config_1.countryFlowConfig,
|
|
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 {};
|
|
15
|
+
static fromApiEntity(apiEntity) {
|
|
16
|
+
const entity = new CountryEntityModel(apiEntity);
|
|
17
|
+
Object.assign(entity, apiEntity);
|
|
18
|
+
return entity;
|
|
87
19
|
}
|
|
88
20
|
}
|
|
89
21
|
exports.CountryEntityModel = CountryEntityModel;
|
|
90
|
-
CountryEntityModel.relationConfigs = [];
|
|
@@ -146,7 +146,7 @@ exports.entityEnumToEntityModel = {
|
|
|
146
146
|
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET_HISTORY]: billing_timesheet_history_entity_model_1.BillingTimesheetHistoryEntityModel.fromEntity,
|
|
147
147
|
[entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromEntity,
|
|
148
148
|
[entity_utils_interface_1.EntityEnum.TIMESHEET_HISTORY]: timesheet_history_entity_model_1.TimesheetHistoryEntityModel.fromEntity,
|
|
149
|
-
[entity_utils_interface_1.EntityEnum.COUNTRY]: country_entity_model_1.CountryEntityModel.
|
|
149
|
+
[entity_utils_interface_1.EntityEnum.COUNTRY]: country_entity_model_1.CountryEntityModel.fromApiEntity,
|
|
150
150
|
[entity_utils_interface_1.EntityEnum.ADDRESS_BOOK]: address_book_model_1.AddressBookEntityModel.fromEntity,
|
|
151
151
|
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION]: billing_transaction_model_1.BillingTransactionEntityModel.fromEntity,
|
|
152
152
|
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION_HISTORY]: billing_transaction_history_entity_model_1.BillingTransactionHistoryEntityModel.fromEntity,
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CountryActionEnum } from "../../entities/enums/country.action.enum";
|
|
2
|
-
export { CountryActionEnum };
|
|
3
|
-
import { DeepPartialButRequired } from "./api.utils.interface";
|
|
4
|
-
import { ICountryCreateDto, ICountryCreateDtoExclude } from "./country.create.dto.interface";
|
|
5
|
-
export type ICountryEntityUpdateDto = Omit<DeepPartialButRequired<ICountryCreateDto, never> & {
|
|
6
|
-
actionData: ICountryActionDataDto;
|
|
7
|
-
}, ICountryCreateDtoExclude>;
|
|
8
|
-
export interface ICountryActionDataDto {
|
|
9
|
-
action: CountryActionEnum;
|
|
10
|
-
remark?: string;
|
|
11
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CountryActionEnum = void 0;
|
|
4
|
-
const country_action_enum_1 = require("../../entities/enums/country.action.enum");
|
|
5
|
-
Object.defineProperty(exports, "CountryActionEnum", { enumerable: true, get: function () { return country_action_enum_1.CountryActionEnum; } });
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CountryActionEnum = void 0;
|
|
4
|
-
var CountryActionEnum;
|
|
5
|
-
(function (CountryActionEnum) {
|
|
6
|
-
CountryActionEnum["CREATE"] = "create";
|
|
7
|
-
CountryActionEnum["UPDATE"] = "update";
|
|
8
|
-
CountryActionEnum["DELETE"] = "delete";
|
|
9
|
-
CountryActionEnum["DEACTIVATE"] = "deactivate";
|
|
10
|
-
CountryActionEnum["ACTIVATE"] = "activate";
|
|
11
|
-
CountryActionEnum["RESTORE"] = "restore";
|
|
12
|
-
// APPROVE = "approve",
|
|
13
|
-
// REJECT = "reject",
|
|
14
|
-
// RECALL = "recall",
|
|
15
|
-
// REQUEST_CHANGES = "request_changes",
|
|
16
|
-
// CHANGES_DONE = "changes_done",
|
|
17
|
-
})(CountryActionEnum || (exports.CountryActionEnum = CountryActionEnum = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CountryStatusEnum = void 0;
|
|
4
|
-
var CountryStatusEnum;
|
|
5
|
-
(function (CountryStatusEnum) {
|
|
6
|
-
CountryStatusEnum["APPROVED"] = "APPROVED";
|
|
7
|
-
CountryStatusEnum["DEACTIVATED"] = "DEACTIVATED";
|
|
8
|
-
CountryStatusEnum["DELETED"] = "DELETED";
|
|
9
|
-
})(CountryStatusEnum || (exports.CountryStatusEnum = CountryStatusEnum = {}));
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CountryActionEnum } from "../enums/country.action.enum";
|
|
2
|
-
import { CountryStatusEnum } from "../enums/country_status_enum";
|
|
3
|
-
import { FlowConfig } from "./flow-config.type";
|
|
4
|
-
export interface ICountryFlowConfigContextData {
|
|
5
|
-
}
|
|
6
|
-
export declare const countryFlowConfig: FlowConfig<CountryStatusEnum, CountryActionEnum, ICountryFlowConfigContextData>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.countryFlowConfig = void 0;
|
|
4
|
-
const country_action_enum_1 = require("../enums/country.action.enum");
|
|
5
|
-
const country_status_enum_1 = require("../enums/country_status_enum");
|
|
6
|
-
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
7
|
-
const COUNTRY_CREATE_PERMISSION = ["COUNTRY_CREATE"];
|
|
8
|
-
const COUNTRY_UPDATE_PERMISSION = ["COUNTRY_UPDATE"];
|
|
9
|
-
const COUNTRY_DELETE_PERMISSION = ["COUNTRY_DELETE"];
|
|
10
|
-
const COUNTRY_DEACTIVATE_PERMISSION = ["COUNTRY_DEACTIVATE"];
|
|
11
|
-
const COUNTRY_ACTIVATE_PERMISSION = ["COUNTRY_ACTIVATE"];
|
|
12
|
-
const COUNTRY_RESTORE_PERMISSION = ["COUNTRY_RESTORE"];
|
|
13
|
-
const ACTION_MAP = {
|
|
14
|
-
[country_action_enum_1.CountryActionEnum.CREATE]: {
|
|
15
|
-
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
16
|
-
permissions: COUNTRY_CREATE_PERMISSION,
|
|
17
|
-
},
|
|
18
|
-
[country_action_enum_1.CountryActionEnum.UPDATE]: {
|
|
19
|
-
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
20
|
-
permissions: COUNTRY_UPDATE_PERMISSION,
|
|
21
|
-
},
|
|
22
|
-
[country_action_enum_1.CountryActionEnum.DELETE]: {
|
|
23
|
-
reachableStatues: [country_status_enum_1.CountryStatusEnum.DELETED],
|
|
24
|
-
permissions: COUNTRY_DELETE_PERMISSION,
|
|
25
|
-
},
|
|
26
|
-
[country_action_enum_1.CountryActionEnum.DEACTIVATE]: {
|
|
27
|
-
reachableStatues: [country_status_enum_1.CountryStatusEnum.DEACTIVATED],
|
|
28
|
-
permissions: COUNTRY_DEACTIVATE_PERMISSION,
|
|
29
|
-
},
|
|
30
|
-
[country_action_enum_1.CountryActionEnum.ACTIVATE]: {
|
|
31
|
-
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
32
|
-
permissions: COUNTRY_ACTIVATE_PERMISSION,
|
|
33
|
-
},
|
|
34
|
-
[country_action_enum_1.CountryActionEnum.RESTORE]: {
|
|
35
|
-
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
36
|
-
permissions: COUNTRY_RESTORE_PERMISSION,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
40
|
-
// APPROVED status transitions
|
|
41
|
-
const transitionApprovedStatusUpdateAction = createActionConfig(country_action_enum_1.CountryActionEnum.UPDATE, country_status_enum_1.CountryStatusEnum.APPROVED);
|
|
42
|
-
const transitionApprovedStatusDeleteAction = createActionConfig(country_action_enum_1.CountryActionEnum.DELETE, country_status_enum_1.CountryStatusEnum.DELETED);
|
|
43
|
-
const transitionApprovedStatusDeactivateAction = createActionConfig(country_action_enum_1.CountryActionEnum.DEACTIVATE, country_status_enum_1.CountryStatusEnum.DEACTIVATED);
|
|
44
|
-
// DEACTIVATED status transitions
|
|
45
|
-
const transitionDeactivatedStatusDeleteAction = createActionConfig(country_action_enum_1.CountryActionEnum.DELETE, country_status_enum_1.CountryStatusEnum.DELETED);
|
|
46
|
-
const transitionDeactivatedStatusActivateAction = createActionConfig(country_action_enum_1.CountryActionEnum.ACTIVATE, country_status_enum_1.CountryStatusEnum.APPROVED);
|
|
47
|
-
// DELETED status transitions
|
|
48
|
-
const transitionDeletedStatusUpdateAction = createActionConfig(country_action_enum_1.CountryActionEnum.UPDATE, country_status_enum_1.CountryStatusEnum.APPROVED);
|
|
49
|
-
const transitionDeletedStatusRestoreAction = createActionConfig(country_action_enum_1.CountryActionEnum.RESTORE, country_status_enum_1.CountryStatusEnum.APPROVED);
|
|
50
|
-
exports.countryFlowConfig = {
|
|
51
|
-
[country_status_enum_1.CountryStatusEnum.APPROVED]: {
|
|
52
|
-
actions: {
|
|
53
|
-
[country_action_enum_1.CountryActionEnum.UPDATE]: transitionApprovedStatusUpdateAction,
|
|
54
|
-
[country_action_enum_1.CountryActionEnum.DELETE]: transitionApprovedStatusDeleteAction,
|
|
55
|
-
[country_action_enum_1.CountryActionEnum.DEACTIVATE]: transitionApprovedStatusDeactivateAction,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
[country_status_enum_1.CountryStatusEnum.DEACTIVATED]: {
|
|
59
|
-
actions: {
|
|
60
|
-
[country_action_enum_1.CountryActionEnum.DELETE]: transitionDeactivatedStatusDeleteAction,
|
|
61
|
-
[country_action_enum_1.CountryActionEnum.ACTIVATE]: transitionDeactivatedStatusActivateAction,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
[country_status_enum_1.CountryStatusEnum.DELETED]: {
|
|
65
|
-
actions: {
|
|
66
|
-
[country_action_enum_1.CountryActionEnum.UPDATE]: transitionDeletedStatusUpdateAction,
|
|
67
|
-
[country_action_enum_1.CountryActionEnum.RESTORE]: transitionDeletedStatusRestoreAction,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
};
|