scheduler-node-models 1.2.26 → 1.2.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scheduler-node-models",
3
- "version": "1.2.26",
3
+ "version": "1.2.28",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "files": [
@@ -342,7 +342,7 @@ export declare class Employee implements IEmployee {
342
342
  * @param comment The string vlue for any comment to use
343
343
  * @returns The new leave request object or undefined if not created.
344
344
  */
345
- createLeaveRequest(start: Date, end: Date, code: string, comment: string): LeaveRequest | undefined;
345
+ createLeaveRequest(start: Date, end: Date, code: string, comment?: string): LeaveRequest | undefined;
346
346
  /**
347
347
  * This function is used to update a leave request of the employee, by identifier,
348
348
  * field to update and the value to update to.
@@ -1166,7 +1166,7 @@ class Employee {
1166
1166
  this.requests.forEach((req, r) => {
1167
1167
  if (req.startdate.getTime() === start.getTime()
1168
1168
  && req.enddate.getTime() === end.getTime()) {
1169
- if (comment !== '') {
1169
+ if (comment) {
1170
1170
  const cmt = new leaverequest_1.LeaveRequestComment({
1171
1171
  commentdate: new Date(),
1172
1172
  comment: comment
@@ -1197,7 +1197,7 @@ class Employee {
1197
1197
  commentdate: new Date(),
1198
1198
  comment: 'Request Created'
1199
1199
  }));
1200
- if (comment !== '') {
1200
+ if (comment) {
1201
1201
  answer.comments.push(new leaverequest_1.LeaveRequestComment({
1202
1202
  commentdate: new Date(),
1203
1203
  comment: comment
@@ -44,3 +44,10 @@ export interface UpdateLeaveBalance {
44
44
  field: string;
45
45
  value: number;
46
46
  }
47
+ export interface NewEmployeeLeaveRequest {
48
+ employee: string;
49
+ code: string;
50
+ startdate: Date;
51
+ enddate: Date;
52
+ comment?: string;
53
+ }