law-common 10.26.1-beta.1 → 10.26.1-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 -11
- package/dist/src/api/index.js +0 -12
- package/dist/src/api/interface/billing.entity.response.d.ts +2 -3
- package/dist/src/api/interface/billing.transaction.create.dto.interface.d.ts +7 -2
- package/dist/src/api/interface/billing.transaction.entity.response.d.ts +25 -4
- package/dist/src/api/interface/billing.transaction.update.dto.interface.d.ts +13 -2
- package/dist/src/api/interface/leave.api.d.ts +1 -3
- package/dist/src/api/interface/reimbursement.entity.response.d.ts +3 -6
- package/dist/src/constants/entity_constants.d.ts +1 -0
- package/dist/src/constants/entity_constants.js +2 -1
- package/dist/src/entities/enums/billing-transaction-action.enum.d.ts +5 -0
- package/dist/src/entities/enums/billing-transaction-action.enum.js +15 -0
- package/dist/src/entities/enums/billing-transaction-status.enum.d.ts +6 -0
- package/dist/src/entities/enums/billing-transaction-status.enum.js +10 -0
- package/dist/src/entities/func/convert-to-common-entity.func.js +8 -2
- package/dist/src/entities/index.d.ts +5 -0
- package/dist/src/entities/index.js +5 -0
- package/dist/src/entities/interface/billing-reimbursement-expense.entity.interface.d.ts +2 -2
- package/dist/src/entities/interface/billing-transaction-history.entity.d.ts +7 -0
- package/dist/src/entities/interface/billing.entity.interface.d.ts +1 -0
- package/dist/src/entities/interface/billing_payment.entity.interface.d.ts +2 -2
- package/dist/src/entities/interface/billing_transaction.entity.interface.d.ts +9 -2
- package/dist/src/entities/interface/entity.utils.interface.d.ts +19 -9
- package/dist/src/entities/interface/entity.utils.interface.js +2 -1
- package/dist/src/entities/interface/leave.entity.interface.d.ts +3 -11
- package/dist/src/entities/interface/leave.entity.interface.js +1 -1
- package/dist/src/entities/interface/reimbursement.entity.interface.d.ts +2 -2
- package/dist/src/entities/interface/reimbursement_expense.entity.interface.d.ts +2 -2
- package/dist/src/entities/model/base.entity.model.d.ts +8 -2
- package/dist/src/entities/model/base.entity.model.js +53 -34
- package/dist/src/entities/model/billing-reimbursement-expense.entity.model.d.ts +5 -5
- package/dist/src/entities/model/billing-reimbursement-expense.entity.model.js +6 -6
- package/dist/src/entities/model/billing-timesheet.entity.model.d.ts +1 -1
- package/dist/src/entities/model/billing-timesheet.entity.model.js +1 -1
- package/dist/src/entities/model/billing-transaction.model.d.ts +38 -0
- package/dist/src/entities/model/billing-transaction.model.js +71 -0
- package/dist/src/entities/model/billing.entity.model.d.ts +4 -1
- package/dist/src/entities/model/billing.entity.model.js +11 -1
- package/dist/src/entities/model/entity.model.interface.d.ts +12 -1
- package/dist/src/entities/model/entity.model.interface.js +48 -4
- package/dist/src/entities/model/holiday.entity.model.d.ts +14 -1
- package/dist/src/entities/model/holiday.entity.model.js +26 -42
- package/dist/src/entities/model/leave.entity.model.d.ts +54 -7
- package/dist/src/entities/model/leave.entity.model.js +171 -23
- package/dist/src/entities/model/leave_count.entity.model.d.ts +19 -0
- package/dist/src/entities/model/leave_count.entity.model.js +60 -0
- package/dist/src/entities/model/reimbursement-expense.entity.model.d.ts +5 -5
- package/dist/src/entities/model/reimbursement-expense.entity.model.js +3 -3
- package/dist/src/entities/model/reimbursement.entity.model.d.ts +5 -5
- package/dist/src/entities/model/reimbursement.entity.model.js +6 -6
- package/dist/src/utils/entity.flow.util.d.ts +32 -0
- package/dist/src/utils/entity.flow.util.js +83 -0
- package/dist/src/utils/helper.fn.util.d.ts +37 -1
- package/dist/src/utils/helper.fn.util.js +53 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.js +2 -0
- package/dist/src/utils/string.util.d.ts +1 -0
- package/dist/src/utils/string.util.js +14 -0
- package/package.json +1 -1
- package/dist/src/api/interface/bank_history.api.d.ts +0 -3
- package/dist/src/api/interface/billing-reimbursement-expense-history.api.d.ts +0 -4
- package/dist/src/api/interface/billing-reimbursement-expense-history.api.js +0 -2
- package/dist/src/api/interface/billing-reimbursement-expense.api.d.ts +0 -3
- package/dist/src/api/interface/billing-reimbursement-expense.api.js +0 -2
- package/dist/src/api/interface/billing.history.api.d.ts +0 -3
- package/dist/src/api/interface/billing.history.api.js +0 -2
- package/dist/src/api/interface/billing.payment.entity.api.d.ts +0 -3
- package/dist/src/api/interface/billing.payment.entity.api.js +0 -2
- package/dist/src/api/interface/billing_timesheet_history.api.d.ts +0 -3
- package/dist/src/api/interface/billing_timesheet_history.api.js +0 -2
- package/dist/src/api/interface/leave_history.api.d.ts +0 -3
- package/dist/src/api/interface/leave_history.api.js +0 -2
- package/dist/src/api/interface/reimbursement_expense.api.d.ts +0 -3
- package/dist/src/api/interface/reimbursement_expense.api.js +0 -2
- package/dist/src/api/interface/reimbursement_history.api.d.ts +0 -3
- package/dist/src/api/interface/reimbursement_history.api.js +0 -2
- package/dist/src/api/interface/timesheet.history.api.d.ts +0 -3
- package/dist/src/api/interface/timesheet.history.api.js +0 -2
- package/dist/src/api/interface/work_from_home_history.api.d.ts +0 -4
- package/dist/src/api/interface/work_from_home_history.api.js +0 -2
- /package/dist/src/{api/interface/bank_history.api.js → entities/interface/billing-transaction-history.entity.js} +0 -0
|
@@ -1,58 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseEntityModel = void 0;
|
|
4
|
-
|
|
3
|
+
exports.BaseEntityModel = exports.RelationType = void 0;
|
|
4
|
+
var RelationType;
|
|
5
|
+
(function (RelationType) {
|
|
6
|
+
RelationType["ONE"] = "one";
|
|
7
|
+
RelationType["MANY"] = "many";
|
|
8
|
+
})(RelationType || (exports.RelationType = RelationType = {}));
|
|
5
9
|
class BaseEntityModel {
|
|
6
10
|
constructor(entityName) {
|
|
7
11
|
this.entityName = entityName;
|
|
8
12
|
}
|
|
9
13
|
populateRelationsByIndex(entityIndexMap) {
|
|
10
14
|
for (const relationConfig of this.getRelationConfigs() || []) {
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
const thisMappingKey = relationConfig.mapKeyConfig.key;
|
|
16
|
+
const relatedMappingKey = relationConfig.mapKeyConfig.relationKey;
|
|
17
|
+
const thisKey = relationConfig.key;
|
|
18
|
+
// console.log('Populating relation for', relationConfig.name, 'on', this.entityName, relationConfig);
|
|
19
|
+
// debugger;
|
|
20
|
+
if (relationConfig.relation === RelationType.ONE) {
|
|
13
21
|
const relatedEntities = entityIndexMap[relationConfig.name] || {};
|
|
14
|
-
|
|
22
|
+
if (Object.is(relatedEntities, null))
|
|
23
|
+
continue;
|
|
15
24
|
let foundRelatedEntities = [];
|
|
16
|
-
if (
|
|
17
|
-
const [parentKey, childKey] =
|
|
18
|
-
|
|
19
|
-
if (this[parentKey]
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
if (thisMappingKey.includes(".")) {
|
|
26
|
+
const [parentKey, childKey] = thisMappingKey.split(".");
|
|
27
|
+
console.log(`[populateRelationsByIndex] Checking nested relation "${relationConfig.name}" on entity "${this.entityName}" → parentKey="${parentKey}", childKey="${childKey}"`);
|
|
28
|
+
if (!this[parentKey]) {
|
|
29
|
+
console.warn(`[populateRelationsByIndex] Missing parent key "${parentKey}" on entity "${this.entityName}". Current entity:`, this);
|
|
30
|
+
continue;
|
|
22
31
|
}
|
|
32
|
+
if (!this[parentKey][childKey]) {
|
|
33
|
+
console.warn(`[populateRelationsByIndex] Missing child key "${childKey}" in parent "${parentKey}" on entity "${this.entityName}". Parent value:`, this[parentKey]);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
foundRelatedEntities = [relatedEntities[this[parentKey][childKey]]];
|
|
23
37
|
}
|
|
24
38
|
else {
|
|
25
|
-
foundRelatedEntities = relatedEntities[
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
// foundRelatedEntities = relatedEntities[this[thisKey]] ? [relatedEntities[this[thisKey]]] : [];
|
|
40
|
+
const relatedEntity = relatedEntities[this[thisMappingKey]];
|
|
41
|
+
if (relatedEntity) {
|
|
42
|
+
foundRelatedEntities = [relatedEntity];
|
|
43
|
+
}
|
|
44
|
+
else if (relatedMappingKey !== "id") {
|
|
45
|
+
foundRelatedEntities = Object.values(relatedEntities).filter((entity) => entity[relatedMappingKey] === this[thisMappingKey]);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
foundRelatedEntities = [];
|
|
49
|
+
}
|
|
31
50
|
}
|
|
32
51
|
if (foundRelatedEntities.length > 1) {
|
|
33
52
|
throw new Error(`Expected one related entity for ${relationConfig.name} but found ${foundRelatedEntities.length}`);
|
|
34
53
|
}
|
|
35
54
|
if (foundRelatedEntities.length === 0) {
|
|
36
|
-
console.warn(`No related entity found for ${relationConfig.name} with ${relationConfig.mapKeyConfig.
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
}=${this[relationConfig.mapKeyConfig.foreignKey]}`);
|
|
55
|
+
console.warn(`No related entity found for ${relationConfig.name} with ${thisMappingKey}=${this[relationConfig.mapKeyConfig.foreignKey]}`);
|
|
39
56
|
}
|
|
40
|
-
|
|
41
|
-
this[relationConfig.key] = foundRelatedEntities[0];
|
|
57
|
+
this[thisKey] = foundRelatedEntities[0];
|
|
42
58
|
}
|
|
43
|
-
else if (relationConfig.relation ===
|
|
44
|
-
|
|
45
|
-
this[relationConfig.key] = [];
|
|
46
|
-
// @ts-ignore
|
|
59
|
+
else if (relationConfig.relation === RelationType.MANY) {
|
|
60
|
+
this[thisKey] = [];
|
|
47
61
|
const relatedEntities = entityIndexMap[relationConfig.name] || {};
|
|
48
62
|
for (const relatedEntity of Object.values(relatedEntities)) {
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
relatedEntity[relationConfig.mapKeyConfig.relationKey] ===
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
this[relationConfig.mapKeyConfig.key]) {
|
|
54
|
-
// @ts-ignore
|
|
55
|
-
this[relationConfig.key].push(relatedEntity);
|
|
63
|
+
if (relatedEntity[relatedMappingKey] === this[thisMappingKey]) {
|
|
64
|
+
this[thisKey].push(relatedEntity);
|
|
56
65
|
}
|
|
57
66
|
}
|
|
58
67
|
}
|
|
@@ -60,10 +69,20 @@ class BaseEntityModel {
|
|
|
60
69
|
}
|
|
61
70
|
static populateRelationsForEntities(entityIndexMap, entityType) {
|
|
62
71
|
for (const key of Object.keys(entityIndexMap[entityType] || {})) {
|
|
63
|
-
// @ts-ignore
|
|
64
72
|
const entity = entityIndexMap[entityType][key];
|
|
65
73
|
entity.populateRelationsByIndex(entityIndexMap);
|
|
66
74
|
}
|
|
67
75
|
}
|
|
76
|
+
populateRelations(entityIndexMap) {
|
|
77
|
+
this.populateRelationsByIndex(entityIndexMap);
|
|
78
|
+
}
|
|
79
|
+
overwrite(entityIndexMap, indexKey = "id") {
|
|
80
|
+
if (this[indexKey] === undefined) {
|
|
81
|
+
console.warn(`Entity of type ${this.entityName} does not have ${indexKey}, cannot merge`);
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
entityIndexMap[this.entityName][this[indexKey]] = this;
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
68
87
|
}
|
|
69
88
|
exports.BaseEntityModel = BaseEntityModel;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IBillingReimbursementExpenseApiEntity } from "../../api";
|
|
2
1
|
import { BillingReimbursementExpenseImpactEnum } from "../enums/billing-reimburement-expense-impact.enum";
|
|
3
2
|
import { BillingReimbursementExpenseChangedStatusEnum } from "../enums/billing-reimbursement-expense-change-status.enum";
|
|
3
|
+
import { IBillingReimbursementExpenseEntity } from "../interface/billing-reimbursement-expense.entity.interface";
|
|
4
4
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
5
5
|
import { BaseEntityModel } from "./base.entity.model";
|
|
6
|
-
export declare class BillingReimbursementExpneseEntityModel extends BaseEntityModel<EntityEnum.BILLING_REIMBURSEMENT_EXPENSE> implements
|
|
6
|
+
export declare class BillingReimbursementExpneseEntityModel extends BaseEntityModel<EntityEnum.BILLING_REIMBURSEMENT_EXPENSE> implements IBillingReimbursementExpenseEntity {
|
|
7
7
|
id: number;
|
|
8
8
|
billingId: number;
|
|
9
9
|
userId: number;
|
|
@@ -17,9 +17,9 @@ export declare class BillingReimbursementExpneseEntityModel extends BaseEntityMo
|
|
|
17
17
|
impact?: BillingReimbursementExpenseImpactEnum;
|
|
18
18
|
updatedBy: number;
|
|
19
19
|
createdBy: number;
|
|
20
|
-
createdOn:
|
|
21
|
-
updatedOn:
|
|
20
|
+
createdOn: number;
|
|
21
|
+
updatedOn: number;
|
|
22
22
|
static relationConfigs: never[];
|
|
23
23
|
getRelationConfigs(): any[];
|
|
24
|
-
static
|
|
24
|
+
static fromEntity(entity: IBillingReimbursementExpenseEntity): BillingReimbursementExpneseEntityModel;
|
|
25
25
|
}
|
|
@@ -19,16 +19,16 @@ class BillingReimbursementExpneseEntityModel extends base_entity_model_1.BaseEnt
|
|
|
19
19
|
this.amendmentPurpose = "";
|
|
20
20
|
this.updatedBy = 0;
|
|
21
21
|
this.createdBy = 0;
|
|
22
|
-
this.createdOn =
|
|
23
|
-
this.updatedOn =
|
|
22
|
+
this.createdOn = 0;
|
|
23
|
+
this.updatedOn = 0;
|
|
24
24
|
}
|
|
25
25
|
getRelationConfigs() {
|
|
26
26
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
27
27
|
}
|
|
28
|
-
static
|
|
29
|
-
const
|
|
30
|
-
Object.assign(
|
|
31
|
-
return
|
|
28
|
+
static fromEntity(entity) {
|
|
29
|
+
const result = new BillingReimbursementExpneseEntityModel(entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE);
|
|
30
|
+
Object.assign(result, entity);
|
|
31
|
+
return result;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
exports.BillingReimbursementExpneseEntityModel = BillingReimbursementExpneseEntityModel;
|
|
@@ -22,5 +22,5 @@ export declare class BillingTimesheetEntityModel extends BaseEntityModel<EntityE
|
|
|
22
22
|
createdBy: number;
|
|
23
23
|
updatedBy: number;
|
|
24
24
|
getRelationConfigs(): any;
|
|
25
|
-
static
|
|
25
|
+
static fromEntity(entity: IBillingTimesheetEntity): BillingTimesheetEntityModel;
|
|
26
26
|
}
|
|
@@ -27,7 +27,7 @@ class BillingTimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
27
27
|
getRelationConfigs() {
|
|
28
28
|
return this.constructor.prototype.constructor.relationConfigs;
|
|
29
29
|
}
|
|
30
|
-
static
|
|
30
|
+
static fromEntity(entity) {
|
|
31
31
|
const result = new BillingTimesheetEntityModel(entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET);
|
|
32
32
|
Object.assign(result, entity);
|
|
33
33
|
return result;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BillingTransactionStatusEnum } from "../enums/billing-transaction-status.enum";
|
|
2
|
+
import { BillingTransactionType } from "../enums/billing.transaction.enum";
|
|
3
|
+
import { IBillingTransactionEntity } from "../interface/billing_transaction.entity.interface";
|
|
4
|
+
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
5
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
6
|
+
import { BankEntityModel } from "./bank.entity.model";
|
|
7
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
8
|
+
import { BillingEntityModel } from "./billing.entity.model";
|
|
9
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
10
|
+
export declare class BillingTransactionEntityModel extends BaseEntityModel<EntityEnum.BILLING_TRANSACTION> implements IBillingTransactionEntity {
|
|
11
|
+
id: number;
|
|
12
|
+
billingId: number;
|
|
13
|
+
type: BillingTransactionType;
|
|
14
|
+
amount: number;
|
|
15
|
+
details: string;
|
|
16
|
+
bankCharges?: number;
|
|
17
|
+
bankId?: number;
|
|
18
|
+
paymentDate?: string;
|
|
19
|
+
referenceNo?: string;
|
|
20
|
+
supportingDocsUrls?: string;
|
|
21
|
+
status: BillingTransactionStatusEnum;
|
|
22
|
+
createdOn: number;
|
|
23
|
+
updatedOn: number;
|
|
24
|
+
createdBy: number;
|
|
25
|
+
updatedBy: number;
|
|
26
|
+
createdByUser?: UserEntityModel;
|
|
27
|
+
updatedByUser?: UserEntityModel;
|
|
28
|
+
bank?: BankEntityModel;
|
|
29
|
+
billing?: BillingEntityModel;
|
|
30
|
+
getRelationConfigs(): any;
|
|
31
|
+
static relationConfigs: RelationConfigs<[
|
|
32
|
+
EntityEnum.USER,
|
|
33
|
+
EntityEnum.USER,
|
|
34
|
+
EntityEnum.BANK,
|
|
35
|
+
EntityEnum.BILLING
|
|
36
|
+
], EnumEntityType<EntityEnum.BILLING_TRANSACTION>>;
|
|
37
|
+
static fromEntity(entity: IBillingTransactionEntity): BillingTransactionEntityModel;
|
|
38
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingTransactionEntityModel = void 0;
|
|
4
|
+
const billing_transaction_status_enum_1 = require("../enums/billing-transaction-status.enum");
|
|
5
|
+
const billing_transaction_enum_1 = require("../enums/billing.transaction.enum");
|
|
6
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
7
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
8
|
+
class BillingTransactionEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.id = 0;
|
|
12
|
+
this.billingId = 0;
|
|
13
|
+
this.type = billing_transaction_enum_1.BillingTransactionType.PAYMENT;
|
|
14
|
+
this.amount = 0;
|
|
15
|
+
this.details = "";
|
|
16
|
+
this.status = billing_transaction_status_enum_1.BillingTransactionStatusEnum.APPROVED;
|
|
17
|
+
this.createdOn = 0;
|
|
18
|
+
this.updatedOn = 0;
|
|
19
|
+
this.createdBy = 0;
|
|
20
|
+
this.updatedBy = 0;
|
|
21
|
+
}
|
|
22
|
+
// billing?: BillingEntityModel;
|
|
23
|
+
// bank?: BankEntityModel;
|
|
24
|
+
getRelationConfigs() {
|
|
25
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
26
|
+
}
|
|
27
|
+
static fromEntity(entity) {
|
|
28
|
+
const result = new BillingTransactionEntityModel(entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION);
|
|
29
|
+
Object.assign(result, entity);
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.BillingTransactionEntityModel = BillingTransactionEntityModel;
|
|
34
|
+
BillingTransactionEntityModel.relationConfigs = [
|
|
35
|
+
{
|
|
36
|
+
name: entity_utils_interface_1.EntityEnum.USER,
|
|
37
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
38
|
+
key: "createdByUser",
|
|
39
|
+
mapKeyConfig: {
|
|
40
|
+
relationKey: "id",
|
|
41
|
+
key: "createdBy",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: entity_utils_interface_1.EntityEnum.USER,
|
|
46
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
47
|
+
key: "updatedByUser",
|
|
48
|
+
mapKeyConfig: {
|
|
49
|
+
relationKey: "id",
|
|
50
|
+
key: "updatedBy",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: entity_utils_interface_1.EntityEnum.BANK,
|
|
55
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
56
|
+
key: "bank",
|
|
57
|
+
mapKeyConfig: {
|
|
58
|
+
relationKey: "id",
|
|
59
|
+
key: "bankId",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: entity_utils_interface_1.EntityEnum.BILLING,
|
|
64
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
65
|
+
key: "billing",
|
|
66
|
+
mapKeyConfig: {
|
|
67
|
+
relationKey: "id",
|
|
68
|
+
key: "billingId",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
];
|
|
@@ -12,6 +12,7 @@ import { BankEntityModel } from "./bank.entity.model";
|
|
|
12
12
|
import { BaseEntityModel } from "./base.entity.model";
|
|
13
13
|
import { BillingReimbursementExpneseEntityModel } from "./billing-reimbursement-expense.entity.model";
|
|
14
14
|
import { BillingTimesheetEntityModel } from "./billing-timesheet.entity.model";
|
|
15
|
+
import { BillingTransactionEntityModel } from "./billing-transaction.model";
|
|
15
16
|
import { ClientEntityModel } from "./client.entity.model";
|
|
16
17
|
import { ProjectEntityModel } from "./project.entity.model";
|
|
17
18
|
import { ReimbursementExpenseEntityModel } from "./reimbursement-expense.entity.model";
|
|
@@ -60,6 +61,7 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
|
|
|
60
61
|
reimbursementExpense?: ReimbursementExpenseEntityModel[];
|
|
61
62
|
bank?: BankEntityModel[];
|
|
62
63
|
billingTimesheets?: BillingTimesheetEntityModel[];
|
|
64
|
+
billingTransactions?: BillingTransactionEntityModel[];
|
|
63
65
|
static relationConfigs: RelationConfigs<[
|
|
64
66
|
EntityEnum.PROJECT,
|
|
65
67
|
EntityEnum.CLIENT,
|
|
@@ -67,7 +69,8 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
|
|
|
67
69
|
EntityEnum.REIMBURSEMENT_EXPENSE,
|
|
68
70
|
EntityEnum.BILLING_REIMBURSEMENT_EXPENSE,
|
|
69
71
|
EntityEnum.BILLING_TIMESHEET,
|
|
70
|
-
EntityEnum.BANK
|
|
72
|
+
EntityEnum.BANK,
|
|
73
|
+
EntityEnum.BILLING_TRANSACTION
|
|
71
74
|
], EnumEntityType<EntityEnum.BILLING>>;
|
|
72
75
|
static fromEntity(entity: IBillingEntity): BillingEntityModel;
|
|
73
76
|
getStatusCategory(): BillingStatusCategoryEnumForUI;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BillingEntityModel = exports.BillingStatusCategoryEnumForUI = void 0;
|
|
4
4
|
const enums_1 = require("../../enums");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
5
6
|
const billing_type_enum_1 = require("../enums/billing-type.enum");
|
|
6
7
|
const billing_status_enum_1 = require("../enums/billing.status.enum");
|
|
7
8
|
const billing_invoice_type_enum_1 = require("../enums/billing_invoice_type.enum");
|
|
@@ -63,7 +64,7 @@ class BillingEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
63
64
|
return `${this.formatDate(this.startDate)} - ${this.formatDate(this.endDate, true)}`;
|
|
64
65
|
}
|
|
65
66
|
getBillDate() {
|
|
66
|
-
return new Date(this.createdOn);
|
|
67
|
+
return new Date((0, utils_1.epochToDateTime)(this.createdOn));
|
|
67
68
|
}
|
|
68
69
|
mapOverdue(configValue) {
|
|
69
70
|
var _a, _b, _c, _d;
|
|
@@ -243,4 +244,13 @@ BillingEntityModel.relationConfigs = [
|
|
|
243
244
|
key: "bankId",
|
|
244
245
|
},
|
|
245
246
|
},
|
|
247
|
+
{
|
|
248
|
+
name: entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION,
|
|
249
|
+
relation: relation_type_enum_1.RelationType.MANY,
|
|
250
|
+
key: "billingTransactions",
|
|
251
|
+
mapKeyConfig: {
|
|
252
|
+
relationKey: "billingId",
|
|
253
|
+
key: "id",
|
|
254
|
+
},
|
|
255
|
+
},
|
|
246
256
|
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityEnum, EntityIndexMap, EntityMap, EnumEntityType, IBaseEntityApiResponse } from "../interface/entity.utils.interface";
|
|
1
|
+
import { EntityEnum, EntityIndexMap, EntityMap, EnumEntityType, EnumToModel, IApiEntity, IBaseEntityApiResponse, VirtualEntityEnum } from "../interface/entity.utils.interface";
|
|
2
2
|
export declare function mapToIndex(entityMap: EntityMap): EntityIndexMap;
|
|
3
3
|
export declare function getEntityIndexMap<T extends EntityEnum>(data: IBaseEntityApiResponse<EnumEntityType<T>>, baseEntity: T, reusedConfig?: {
|
|
4
4
|
existingEntityIndexMap: EntityIndexMap;
|
|
@@ -6,3 +6,14 @@ export declare function getEntityIndexMap<T extends EntityEnum>(data: IBaseEntit
|
|
|
6
6
|
}): EntityIndexMap;
|
|
7
7
|
export declare function populateRelationsFor(entityIndexMap: EntityIndexMap, enumEntities: EntityEnum[]): void;
|
|
8
8
|
export declare function parseEntities<T extends EnumEntityType<EntityEnum>>(json: IBaseEntityApiResponse<T>, baseEntity: EntityEnum, entityMap: EntityMap): EntityMap;
|
|
9
|
+
export declare const entityEnumToEntityModel: {
|
|
10
|
+
[E in EntityEnum | VirtualEntityEnum]?: (json: IApiEntity<EnumEntityType<E>> & {
|
|
11
|
+
createdOn: number;
|
|
12
|
+
updatedOn: number;
|
|
13
|
+
}) => EnumToModel<E>;
|
|
14
|
+
};
|
|
15
|
+
export declare function parseEntitiesWithoutModels<T extends EnumEntityType<EntityEnum | VirtualEntityEnum>>(json: IBaseEntityApiResponse<T>, baseEntity: EntityEnum | VirtualEntityEnum, entityMap?: {
|
|
16
|
+
[E in EntityEnum | VirtualEntityEnum]?: IApiEntity<EnumEntityType<E>>[];
|
|
17
|
+
}): {
|
|
18
|
+
[E in EntityEnum | VirtualEntityEnum]?: IApiEntity<EnumEntityType<E>>[];
|
|
19
|
+
};
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.entityEnumToEntityModel = void 0;
|
|
3
4
|
exports.mapToIndex = mapToIndex;
|
|
4
5
|
exports.getEntityIndexMap = getEntityIndexMap;
|
|
5
6
|
exports.populateRelationsFor = populateRelationsFor;
|
|
6
7
|
exports.parseEntities = parseEntities;
|
|
8
|
+
exports.parseEntitiesWithoutModels = parseEntitiesWithoutModels;
|
|
7
9
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
8
10
|
const bank_entity_model_1 = require("./bank.entity.model");
|
|
9
11
|
const base_entity_model_1 = require("./base.entity.model");
|
|
10
12
|
const billing_reimbursement_expense_entity_model_1 = require("./billing-reimbursement-expense.entity.model");
|
|
11
13
|
const billing_timesheet_entity_model_1 = require("./billing-timesheet.entity.model");
|
|
14
|
+
const billing_transaction_model_1 = require("./billing-transaction.model");
|
|
12
15
|
const billing_entity_model_1 = require("./billing.entity.model");
|
|
13
16
|
const client_affiliate_entity_model_1 = require("./client-affiliate.entity.model");
|
|
14
17
|
const client_entity_model_1 = require("./client.entity.model");
|
|
15
18
|
const configuration_model_1 = require("./configuration.model");
|
|
19
|
+
const holiday_entity_model_1 = require("./holiday.entity.model");
|
|
20
|
+
const leave_entity_model_1 = require("./leave.entity.model");
|
|
21
|
+
const leave_count_entity_model_1 = require("./leave_count.entity.model");
|
|
16
22
|
const project_user_mapping_entity_model_1 = require("./project-user-mapping.entity.model");
|
|
17
23
|
const project_entity_model_1 = require("./project.entity.model");
|
|
18
24
|
const reimbursement_expense_entity_model_1 = require("./reimbursement-expense.entity.model");
|
|
@@ -55,15 +61,16 @@ function parseEntities(json, baseEntity, entityMap) {
|
|
|
55
61
|
[entity_utils_interface_1.EntityEnum.BILLING]: billing_entity_model_1.BillingEntityModel.fromEntity,
|
|
56
62
|
[entity_utils_interface_1.EntityEnum.USER]: user_entity_model_1.UserEntityModel.fromEntity,
|
|
57
63
|
[entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.ProjectUserMappingEntityModel.fromEntity,
|
|
58
|
-
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.ReimbursementEntityModel.
|
|
59
|
-
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE]: reimbursement_expense_entity_model_1.ReimbursementExpenseEntityModel.
|
|
60
|
-
[entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE]: billing_reimbursement_expense_entity_model_1.BillingReimbursementExpneseEntityModel.
|
|
64
|
+
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.ReimbursementEntityModel.fromEntity,
|
|
65
|
+
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE]: reimbursement_expense_entity_model_1.ReimbursementExpenseEntityModel.fromEntity,
|
|
66
|
+
[entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE]: billing_reimbursement_expense_entity_model_1.BillingReimbursementExpneseEntityModel.fromEntity,
|
|
61
67
|
[entity_utils_interface_1.EntityEnum.CLIENT_AFFILIATE]: client_affiliate_entity_model_1.ClientAffiliateEntityModel.fromEntity,
|
|
62
68
|
[entity_utils_interface_1.EntityEnum.BANK]: bank_entity_model_1.BankEntityModel.fromEntity,
|
|
63
69
|
[entity_utils_interface_1.EntityEnum.CONFIGURATION]: configuration_model_1.ConfigurationEntityModel.fromEntity,
|
|
64
70
|
[entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromEntity,
|
|
65
|
-
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.
|
|
71
|
+
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromEntity,
|
|
66
72
|
[entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromEntity,
|
|
73
|
+
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION]: billing_transaction_model_1.BillingTransactionEntityModel.fromEntity,
|
|
67
74
|
};
|
|
68
75
|
if (!(baseEntity in entityFromJsonMappings)) {
|
|
69
76
|
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
@@ -81,3 +88,40 @@ function parseEntities(json, baseEntity, entityMap) {
|
|
|
81
88
|
}
|
|
82
89
|
return entityMap;
|
|
83
90
|
}
|
|
91
|
+
exports.entityEnumToEntityModel = {
|
|
92
|
+
[entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromEntity,
|
|
93
|
+
[entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.ClientEntityModel.fromEntity,
|
|
94
|
+
[entity_utils_interface_1.EntityEnum.BILLING]: billing_entity_model_1.BillingEntityModel.fromEntity,
|
|
95
|
+
[entity_utils_interface_1.EntityEnum.USER]: user_entity_model_1.UserEntityModel.fromEntity,
|
|
96
|
+
[entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.ProjectUserMappingEntityModel.fromEntity,
|
|
97
|
+
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.ReimbursementEntityModel.fromEntity,
|
|
98
|
+
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE]: reimbursement_expense_entity_model_1.ReimbursementExpenseEntityModel.fromEntity,
|
|
99
|
+
[entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE]: billing_reimbursement_expense_entity_model_1.BillingReimbursementExpneseEntityModel.fromEntity,
|
|
100
|
+
[entity_utils_interface_1.EntityEnum.HOLIDAY]: holiday_entity_model_1.HolidayEntityModel.fromEntity,
|
|
101
|
+
[entity_utils_interface_1.EntityEnum.LEAVE]: leave_entity_model_1.LeaveEntityModel.fromEntity,
|
|
102
|
+
[entity_utils_interface_1.VirtualEntityEnum.LEAVE_COUNT]: leave_count_entity_model_1.LeaveCountVirtualEntityModel.fromEntity,
|
|
103
|
+
// Add other entities here as needed
|
|
104
|
+
[entity_utils_interface_1.EntityEnum.CLIENT_AFFILIATE]: client_affiliate_entity_model_1.ClientAffiliateEntityModel.fromEntity,
|
|
105
|
+
[entity_utils_interface_1.EntityEnum.BANK]: bank_entity_model_1.BankEntityModel.fromEntity,
|
|
106
|
+
[entity_utils_interface_1.EntityEnum.CONFIGURATION]: configuration_model_1.ConfigurationEntityModel.fromEntity,
|
|
107
|
+
[entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromEntity,
|
|
108
|
+
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromEntity,
|
|
109
|
+
[entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromEntity,
|
|
110
|
+
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION]: billing_transaction_model_1.BillingTransactionEntityModel.fromEntity,
|
|
111
|
+
};
|
|
112
|
+
function parseEntitiesWithoutModels(json, baseEntity, entityMap = {}) {
|
|
113
|
+
var _a;
|
|
114
|
+
if (!(baseEntity in exports.entityEnumToEntityModel)) {
|
|
115
|
+
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
116
|
+
}
|
|
117
|
+
entityMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []);
|
|
118
|
+
if (json["relatedEntities"]) {
|
|
119
|
+
const relatedEntities = json["relatedEntities"];
|
|
120
|
+
for (const entityName in relatedEntities) {
|
|
121
|
+
parseEntitiesWithoutModels(
|
|
122
|
+
// @ts-ignore
|
|
123
|
+
relatedEntities[entityName], entityName, entityMap);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return entityMap;
|
|
127
|
+
}
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
+
import { IHolidayEntity } from "../interface/holiday.entity.interface";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class HolidayEntityModel extends BaseEntityModel<EntityEnum.HOLIDAY> implements IHolidayEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
holidayListId: number;
|
|
7
|
+
dateCode: string;
|
|
8
|
+
createdBy: number;
|
|
9
|
+
updatedBy: number;
|
|
10
|
+
createdOn: number;
|
|
11
|
+
updatedOn: number;
|
|
12
|
+
getRelationConfigs(): never[];
|
|
13
|
+
static fromEntity(entity: IHolidayEntity): HolidayEntityModel;
|
|
14
|
+
}
|
|
@@ -1,44 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// import { DateCodeModel } from "../../utils";
|
|
3
|
-
// import { IAuditColumnEntity } from "../interface/audit-column.entity.interface";
|
|
4
|
-
// import { IHolidayEntity } from "../interface/holiday.entity.interface";
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// getDateCodeModel(): DateCodeModel {
|
|
33
|
-
// return new DateCodeModel(this.dateCode);
|
|
34
|
-
// }
|
|
35
|
-
// static fromEntity(data: IHolidayEntity): HolidayEntityModel {
|
|
36
|
-
// return new HolidayEntityModel(data);
|
|
37
|
-
// }
|
|
38
|
-
// static getDateCodeModelFromDate(
|
|
39
|
-
// models: HolidayEntityModel[]
|
|
40
|
-
// ): DateCodeModel[] {
|
|
41
|
-
// return models.map((model) => model.getDateCodeModel());
|
|
42
|
-
// }
|
|
43
|
-
// }
|
|
44
|
-
exports.toBeDeleted = "holiday";
|
|
3
|
+
exports.HolidayEntityModel = void 0;
|
|
4
|
+
// import { EntityEnum, IHolidayEntity } from "law-common/dist/src/entities";
|
|
5
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
// import { IHolidayApiEntity } from "law-common/dist/src/api";
|
|
8
|
+
class HolidayEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.id = 0;
|
|
12
|
+
this.holidayListId = 0;
|
|
13
|
+
this.dateCode = "";
|
|
14
|
+
this.createdBy = 0;
|
|
15
|
+
this.updatedBy = 0;
|
|
16
|
+
this.createdOn = 0;
|
|
17
|
+
this.updatedOn = 0;
|
|
18
|
+
}
|
|
19
|
+
getRelationConfigs() {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
static fromEntity(entity) {
|
|
23
|
+
const result = new HolidayEntityModel(entity_utils_interface_1.EntityEnum.HOLIDAY);
|
|
24
|
+
Object.assign(result, entity);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.HolidayEntityModel = HolidayEntityModel;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { ILeaveApiEntity } from "../../api";
|
|
2
1
|
import { DateCodeModel, Weekday } from "../../utils";
|
|
3
2
|
import { DurationTypeEnum } from "../enums/duration-type.enum";
|
|
4
3
|
import { LeaveTypeEnum } from "../enums/leave-type.enum";
|
|
5
4
|
import { LeaveStatusEnum } from "../enums/leave.status.enum";
|
|
6
|
-
|
|
5
|
+
import { RelationType } from "../enums/relation-type.enum";
|
|
6
|
+
import { EntityEnum, VirtualEntityEnum } from "../interface/entity.utils.interface";
|
|
7
|
+
import { ILeaveEntity } from "../interface/leave.entity.interface";
|
|
8
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
9
|
+
import { LeaveCountVirtualEntityModel } from "./leave_count.entity.model";
|
|
10
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
11
|
+
export declare class LeaveEntityModel extends BaseEntityModel<EntityEnum.LEAVE> implements ILeaveEntity {
|
|
7
12
|
id: number;
|
|
8
13
|
employeeId: number;
|
|
9
14
|
fromDate: string;
|
|
@@ -13,17 +18,59 @@ export declare class LeaveEntityModel implements ILeaveApiEntity {
|
|
|
13
18
|
status: LeaveStatusEnum;
|
|
14
19
|
remark?: string;
|
|
15
20
|
type: LeaveTypeEnum;
|
|
16
|
-
createdOn:
|
|
17
|
-
updatedOn:
|
|
21
|
+
createdOn: number;
|
|
22
|
+
updatedOn: number;
|
|
18
23
|
createdBy: number;
|
|
19
24
|
updatedBy: number;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
leaveCount?: LeaveCountVirtualEntityModel;
|
|
26
|
+
createdByUser?: UserEntityModel;
|
|
27
|
+
updatedByUser?: UserEntityModel;
|
|
28
|
+
user?: UserEntityModel;
|
|
29
|
+
static fromEntity(data: ILeaveEntity): LeaveEntityModel;
|
|
23
30
|
getLeaveDuration(excludeWeekdays?: Weekday[], excludeDates?: DateCodeModel[]): number;
|
|
24
31
|
static getLeaveDuration(leaves: LeaveEntityModel[], excludeWeekdays?: Weekday[], excludeDates?: DateCodeModel[], leaveStatusEnum?: LeaveStatusEnum[]): number;
|
|
25
32
|
getDateCodeModels(dateCodeIncludePredicates?: ((dateModel: DateCodeModel) => boolean)[], dateCodeExcludePredicates?: ((dateModel: DateCodeModel) => boolean)[]): DateCodeModel[];
|
|
26
33
|
static getLeaveApprovePredicate(): (leave: LeaveEntityModel) => boolean;
|
|
27
34
|
static getLeavePendingPredicate(): (leave: LeaveEntityModel) => boolean;
|
|
28
35
|
static getLeavesByPredicates(leaves: LeaveEntityModel[], includePredicates?: ((leave: LeaveEntityModel) => boolean)[], excludePredicates?: ((leave: LeaveEntityModel) => boolean)[]): LeaveEntityModel[];
|
|
36
|
+
static orderByFromDateAsc(leaves: LeaveEntityModel[]): LeaveEntityModel[];
|
|
37
|
+
isWeekendSucceeds(): boolean;
|
|
38
|
+
isWeekendPrecedes(): boolean;
|
|
39
|
+
isHolidaySucceeds(holidays: DateCodeModel[]): boolean;
|
|
40
|
+
isHolidayPrecedes(holidays: DateCodeModel[]): boolean;
|
|
41
|
+
getRelationConfigs(): any[];
|
|
42
|
+
static relationConfigs: ({
|
|
43
|
+
name: VirtualEntityEnum;
|
|
44
|
+
relation: RelationType;
|
|
45
|
+
key: string;
|
|
46
|
+
mapKeyConfig: {
|
|
47
|
+
relationKey: string;
|
|
48
|
+
key: string;
|
|
49
|
+
};
|
|
50
|
+
} | {
|
|
51
|
+
name: EntityEnum;
|
|
52
|
+
relation: RelationType;
|
|
53
|
+
key: string;
|
|
54
|
+
mapKeyConfig: {
|
|
55
|
+
relationKey: string;
|
|
56
|
+
key: string;
|
|
57
|
+
};
|
|
58
|
+
})[];
|
|
59
|
+
static fromApiEntity(apiEntity: ILeaveEntity): LeaveEntityModel;
|
|
60
|
+
static getPendingApprovalStatuses(): LeaveStatusEnum[];
|
|
61
|
+
getStatusLabel(): string;
|
|
62
|
+
getTypeLabel(): string;
|
|
63
|
+
getLeaveCount(): number;
|
|
64
|
+
static getLeaveCount(leaveEntities: LeaveEntityModel[]): number;
|
|
65
|
+
isMoreThanOneDayLeave(): boolean;
|
|
66
|
+
getFromDateLabel(): string;
|
|
67
|
+
getToDateLabel(): string;
|
|
68
|
+
getDateDurationLabel(): string;
|
|
69
|
+
static getLeaveStatusPriority(): {
|
|
70
|
+
pending_approval: number;
|
|
71
|
+
edit_approval: number;
|
|
72
|
+
delete_approval: number;
|
|
73
|
+
approved: number;
|
|
74
|
+
rejected: number;
|
|
75
|
+
};
|
|
29
76
|
}
|