law-common 12.8.1-beta.2 → 12.8.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/entities/enums/work_from_home_status_enum.js +9 -0
- package/dist/src/entities/flow-configs/work_from_home_flow.config.js +12 -11
- package/dist/src/entities/model/work_from_home.entity.model.d.ts +19 -16
- package/dist/src/entities/model/work_from_home.entity.model.js +14 -5
- package/package.json +1 -1
|
@@ -3,6 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WorkFromHomeStatusEnum = void 0;
|
|
4
4
|
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
5
5
|
const exceptions_1 = require("../../exceptions");
|
|
6
|
+
// export enum WorkFromHomeStatusEnum {
|
|
7
|
+
// PENDING_APPROVAL = "pending_approval",
|
|
8
|
+
// EDIT_APPROVAL = "edit_approval",
|
|
9
|
+
// DELETE_APPROVAL = "delete_approval",
|
|
10
|
+
// RESOLVE_REJECTED = "resolve_rejected",
|
|
11
|
+
// APPROVED = "approved",
|
|
12
|
+
// REJECTED = "rejected",
|
|
13
|
+
// DELETED = "deleted",
|
|
14
|
+
// }
|
|
6
15
|
var WorkFromHomeStatusEnum;
|
|
7
16
|
(function (WorkFromHomeStatusEnum) {
|
|
8
17
|
WorkFromHomeStatusEnum["CREATE_APPROVAL_PENDING"] = "pending_approval";
|
|
@@ -4,17 +4,18 @@ exports.workFromHomeFlowConfig = void 0;
|
|
|
4
4
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
5
5
|
const api_1 = require("../../api");
|
|
6
6
|
const work_from_home_status_enum_1 = require("../enums/work_from_home_status_enum");
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
7
|
+
// ORG/SELF permissions — matching legacy pattern from work_from_home.flow.config.ts
|
|
8
|
+
const WORK_FROM_HOME_CREATE_PERMISSION = ["WORK_FROM_HOME_CREATOR_ORG", "WORK_FROM_HOME_CREATOR_SELF"];
|
|
9
|
+
const WORK_FROM_HOME_UPDATE_PERMISSION = ["WORK_FROM_HOME_UPDATE_ORG", "WORK_FROM_HOME_UPDATE_SELF"];
|
|
10
|
+
const WORK_FROM_HOME_DELETE_PERMISSION = ["WORK_FROM_HOME_DELETE_SELF"];
|
|
11
|
+
const WORK_FROM_HOME_APPROVE_PERMISSION = ["WORK_FROM_HOME_APPROVER_ORG"];
|
|
12
|
+
const WORK_FROM_HOME_REJECT_PERMISSION = ["WORK_FROM_HOME_APPROVER_ORG"];
|
|
13
|
+
const WORK_FROM_HOME_RECALL_PERMISSION = ["WORK_FROM_HOME_UPDATE_ORG", "WORK_FROM_HOME_UPDATE_SELF"];
|
|
14
|
+
const WORK_FROM_HOME_DEACTIVATE_PERMISSION = ["WORK_FROM_HOME_APPROVER_ORG"];
|
|
15
|
+
const WORK_FROM_HOME_REQUEST_CHANGES_PERMISSION = ["WORK_FROM_HOME_APPROVER_ORG"];
|
|
16
|
+
const WORK_FROM_HOME_ACTIVATE_PERMISSION = ["WORK_FROM_HOME_APPROVER_ORG"];
|
|
17
|
+
const WORK_FROM_HOME_RESTORE_PERMISSION = ["WORK_FROM_HOME_DELETE_SELF"];
|
|
18
|
+
const WORK_FROM_HOME_CHANGES_DONE_PERMISSION = ["WORK_FROM_HOME_UPDATE_ORG", "WORK_FROM_HOME_UPDATE_SELF"];
|
|
18
19
|
const ACTION_MAP = {
|
|
19
20
|
[api_1.WorkFromHomeActionEnum.CREATE]: {
|
|
20
21
|
reachableStatues: [work_from_home_status_enum_1.WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING],
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
-
import { BaseEntityModel } from "./base.entity.model";
|
|
3
2
|
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
3
|
import { IUserEntity } from "../interface/user.entity.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
5
|
import { IRowActions } from "./interface/row-actions.interface";
|
|
6
|
-
import { IWorkFromHomeEntity } from "../interface/work_from_home.entity.interface";
|
|
7
6
|
import { WorkFromHomeStatusEnum } from "../enums/work_from_home_status_enum";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { LeaveEntityModel } from "./leave.entity.model";
|
|
7
|
+
import { IWorkFromHomeEntity } from "../interface/work_from_home.entity.interface";
|
|
8
|
+
import { BankEntityModel } from "./bank.entity.model";
|
|
11
9
|
import { ClientEntityModel } from "./client.entity.model";
|
|
12
10
|
import { ClientDebitNoteEntityModel } from "./client_debit_note.entity.model";
|
|
13
|
-
import { BankEntityModel } from "./bank.entity.model";
|
|
14
|
-
import { VendorTdsChallanEntityModel } from "./vendor_tds_challan.entity.model";
|
|
15
|
-
import { TdsRateEntityModel } from "./tds_rate.entity.model";
|
|
16
|
-
import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
|
|
17
|
-
import { VendorEntityModel } from "./vendor.entity.model";
|
|
18
|
-
import { StateEntityModel } from "./state.entity.model";
|
|
19
11
|
import { CountryEntityModel } from "./country.entity.model";
|
|
20
|
-
import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
|
|
21
|
-
import { OfficeLocationEntityModel } from "./office_location.entity.model";
|
|
22
|
-
import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
|
|
23
|
-
import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
|
|
24
12
|
import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
|
|
25
13
|
import { GstRateEntityModel } from "./gst_rate.entity.model";
|
|
14
|
+
import { LeaveEntityModel } from "./leave.entity.model";
|
|
15
|
+
import { LeaveApprovalEntityModel } from "./leave_approval.entity.model";
|
|
16
|
+
import { OfficeLocationEntityModel } from "./office_location.entity.model";
|
|
17
|
+
import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
|
|
18
|
+
import { StateEntityModel } from "./state.entity.model";
|
|
19
|
+
import { TdsRateEntityModel } from "./tds_rate.entity.model";
|
|
20
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
21
|
+
import { VendorEntityModel } from "./vendor.entity.model";
|
|
26
22
|
import { VendorAdvanceEntityModel } from "./vendor_advance.entity.model";
|
|
23
|
+
import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
|
|
27
24
|
import { VendorInvoiceAdvanceEntityModel } from "./vendor_invoice_advance.entity.model";
|
|
25
|
+
import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
|
|
28
26
|
import { VendorInvoicePaymentEntityModel } from "./vendor_invoice_payment.entity.model";
|
|
27
|
+
import { VendorTdsChallanEntityModel } from "./vendor_tds_challan.entity.model";
|
|
29
28
|
import { VendorTdsLiabilityEntityModel } from "./vendor_tds_liability.entity.model";
|
|
30
|
-
import {
|
|
29
|
+
import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
|
|
31
30
|
import { WorkFromHomeActionEnum } from "../../api";
|
|
32
31
|
import { IWorkFromHomeFlowConfigContextData } from "../flow-configs/work_from_home_flow.config";
|
|
33
32
|
import { ClientAffiliateEntityModel } from "./client-affiliate.entity.model";
|
|
33
|
+
import { ClientDebitNoteParticularsEntityModel } from "./client_debit_note_particulars.entity.model";
|
|
34
34
|
export declare class WorkFromHomeEntityModel extends BaseEntityModel<EntityEnum.WORK_FROM_HOME> implements IWorkFromHomeEntity {
|
|
35
35
|
id: number;
|
|
36
36
|
employeeId: number;
|
|
@@ -81,4 +81,7 @@ export declare class WorkFromHomeEntityModel extends BaseEntityModel<EntityEnum.
|
|
|
81
81
|
getUpdateActionVisibility(currentUser: UserEntityModel): {
|
|
82
82
|
[key: string]: () => boolean;
|
|
83
83
|
};
|
|
84
|
+
getUpdateActionVisibilityV2(currentUser: UserEntityModel): {
|
|
85
|
+
[key: string]: () => boolean;
|
|
86
|
+
};
|
|
84
87
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WorkFromHomeEntityModel = void 0;
|
|
4
|
-
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
|
-
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
-
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
7
|
-
const exceptions_1 = require("../../exceptions");
|
|
8
4
|
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
5
|
+
const exceptions_1 = require("../../exceptions");
|
|
9
6
|
const utils_1 = require("../../utils");
|
|
7
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
8
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
9
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
10
10
|
const work_from_home_status_enum_1 = require("../enums/work_from_home_status_enum");
|
|
11
11
|
const work_from_home_flow_config_1 = require("../flow-configs/work_from_home_flow.config");
|
|
12
12
|
class WorkFromHomeEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
@@ -379,7 +379,8 @@ class WorkFromHomeEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
379
379
|
flowConfig: work_from_home_flow_config_1.workFromHomeFlowConfig,
|
|
380
380
|
currentStatus: this.status,
|
|
381
381
|
userPermissions: (_a = currentUser.permissions) !== null && _a !== void 0 ? _a : [],
|
|
382
|
-
visibilityData: this.getUpdateActionVisibility.bind(this, currentUser),
|
|
382
|
+
// visibilityData: this.getUpdateActionVisibility.bind(this, currentUser),
|
|
383
|
+
visibilityData: this.getUpdateActionVisibilityV2.bind(this, currentUser),
|
|
383
384
|
combinedActions: config === null || config === void 0 ? void 0 : config.combinedActions,
|
|
384
385
|
customLabels: config === null || config === void 0 ? void 0 : config.customLabels,
|
|
385
386
|
};
|
|
@@ -392,6 +393,14 @@ class WorkFromHomeEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
392
393
|
// this.currentUserDetails.user.id === rowData.createdBy,
|
|
393
394
|
};
|
|
394
395
|
}
|
|
396
|
+
getUpdateActionVisibilityV2(currentUser) {
|
|
397
|
+
return {
|
|
398
|
+
WORK_FROM_HOME_UPDATE: () => currentUser.id === this.createdBy,
|
|
399
|
+
WORK_FROM_HOME_DELETE: () => currentUser.id === this.createdBy,
|
|
400
|
+
WORK_FROM_HOME_RECALL: () => currentUser.id === this.createdBy,
|
|
401
|
+
WORK_FROM_HOME_CHANGES_DONE: () => currentUser.id === this.createdBy,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
395
404
|
}
|
|
396
405
|
exports.WorkFromHomeEntityModel = WorkFromHomeEntityModel;
|
|
397
406
|
WorkFromHomeEntityModel.relationConfigs = [
|