law-common 10.18.2-beta.4 → 10.18.2-beta.5
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.
|
@@ -26,7 +26,6 @@ export declare class LeaveEntityModel extends BaseEntityModel<EntityEnum.LEAVE>
|
|
|
26
26
|
createdByUser?: UserEntityModel;
|
|
27
27
|
updatedByUser?: UserEntityModel;
|
|
28
28
|
user?: UserEntityModel;
|
|
29
|
-
private constructor();
|
|
30
29
|
static fromEntity(data: ILeaveApiEntity): LeaveEntityModel;
|
|
31
30
|
getLeaveDuration(excludeWeekdays?: Weekday[], excludeDates?: DateCodeModel[]): number;
|
|
32
31
|
static getLeaveDuration(leaves: LeaveEntityModel[], excludeWeekdays?: Weekday[], excludeDates?: DateCodeModel[], leaveStatusEnum?: LeaveStatusEnum[]): number;
|
|
@@ -4,31 +4,31 @@ exports.LeaveEntityModel = void 0;
|
|
|
4
4
|
const utils_1 = require("../../utils");
|
|
5
5
|
const string_util_1 = require("../../utils/string.util");
|
|
6
6
|
const duration_type_enum_1 = require("../enums/duration-type.enum");
|
|
7
|
+
const leave_type_enum_1 = require("../enums/leave-type.enum");
|
|
7
8
|
const leave_status_enum_1 = require("../enums/leave.status.enum");
|
|
8
9
|
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
9
10
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
10
11
|
const base_entity_model_1 = require("./base.entity.model");
|
|
11
12
|
class LeaveEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
12
|
-
constructor(
|
|
13
|
-
super(
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.id = 0;
|
|
16
|
+
this.employeeId = 0;
|
|
17
|
+
this.fromDate = "";
|
|
18
|
+
this.toDate = "";
|
|
19
|
+
this.reason = "";
|
|
20
|
+
this.durationType = duration_type_enum_1.DurationTypeEnum.FULL;
|
|
21
|
+
this.status = leave_status_enum_1.LeaveStatusEnum.DELETED;
|
|
22
|
+
this.type = leave_type_enum_1.LeaveTypeEnum.SICK;
|
|
14
23
|
this.createdOn = "";
|
|
15
24
|
this.updatedOn = "";
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.fromDate = data.fromDate;
|
|
19
|
-
this.toDate = data.toDate;
|
|
20
|
-
this.reason = data.reason;
|
|
21
|
-
this.durationType = data.durationType;
|
|
22
|
-
this.status = data.status;
|
|
23
|
-
this.remark = data.remark;
|
|
24
|
-
this.type = data.type;
|
|
25
|
-
this.createdOn = data.createdOn;
|
|
26
|
-
this.updatedOn = data.updatedOn;
|
|
27
|
-
this.createdBy = data.createdBy;
|
|
28
|
-
this.updatedBy = data.updatedBy;
|
|
25
|
+
this.createdBy = 0;
|
|
26
|
+
this.updatedBy = 0;
|
|
29
27
|
}
|
|
30
28
|
static fromEntity(data) {
|
|
31
|
-
|
|
29
|
+
const entity = new LeaveEntityModel(entity_utils_interface_1.EntityEnum.LEAVE);
|
|
30
|
+
Object.assign(entity, data);
|
|
31
|
+
return entity;
|
|
32
32
|
}
|
|
33
33
|
getLeaveDuration(excludeWeekdays = [], excludeDates = []) {
|
|
34
34
|
if (!this.isMoreThanOneDayLeave()) {
|
|
@@ -111,7 +111,7 @@ class LeaveEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
111
111
|
return this.constructor.prototype.constructor.relationConfigs;
|
|
112
112
|
}
|
|
113
113
|
static fromApiEntity(apiEntity) {
|
|
114
|
-
return
|
|
114
|
+
return LeaveEntityModel.fromEntity(apiEntity);
|
|
115
115
|
}
|
|
116
116
|
static getPendingApprovalStatuses() {
|
|
117
117
|
return [
|