scheduler-node-models 1.0.79 → 1.0.83

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.
Files changed (144) hide show
  1. package/general/emailer.d.ts +1 -0
  2. package/general/emailer.js +31 -0
  3. package/general/general.d.ts +12 -0
  4. package/general/general.js +2 -0
  5. package/general/index.d.ts +4 -0
  6. package/general/index.js +20 -0
  7. package/general/report.d.ts +12 -0
  8. package/general/report.js +70 -0
  9. package/general/reportStyle.d.ts +0 -0
  10. package/general/reportStyle.js +1 -0
  11. package/general/viewstate.d.ts +5 -0
  12. package/general/viewstate.js +9 -0
  13. package/index.d.ts +0 -0
  14. package/metrics/images.d.ts +22 -0
  15. package/metrics/images.js +33 -0
  16. package/metrics/index.d.ts +5 -0
  17. package/metrics/index.js +21 -0
  18. package/metrics/mission.d.ts +47 -0
  19. package/metrics/mission.js +81 -0
  20. package/metrics/missionSensorOutage.d.ts +11 -0
  21. package/metrics/missionSensorOutage.js +14 -0
  22. package/metrics/missionsensor.d.ts +67 -0
  23. package/metrics/missionsensor.js +128 -0
  24. package/metrics/outage.d.ts +43 -0
  25. package/metrics/outage.js +55 -0
  26. package/metrics/reports/drawSummary.d.ts +24 -0
  27. package/metrics/reports/drawSummary.js +311 -0
  28. package/metrics/reports/index.d.ts +5 -0
  29. package/metrics/reports/index.js +21 -0
  30. package/metrics/reports/missionDay.d.ts +8 -0
  31. package/metrics/reports/missionDay.js +23 -0
  32. package/metrics/reports/missionSummary.d.ts +25 -0
  33. package/metrics/reports/missionSummary.js +421 -0
  34. package/metrics/reports/missionType.d.ts +20 -0
  35. package/metrics/reports/missionType.js +314 -0
  36. package/metrics/reports/outageDay.d.ts +8 -0
  37. package/metrics/reports/outageDay.js +23 -0
  38. package/metrics/systemdata/classifications.d.ts +18 -0
  39. package/metrics/systemdata/classifications.js +23 -0
  40. package/metrics/systemdata/communications.d.ts +21 -0
  41. package/metrics/systemdata/communications.js +40 -0
  42. package/metrics/systemdata/dcgs.d.ts +19 -0
  43. package/metrics/systemdata/dcgs.js +29 -0
  44. package/metrics/systemdata/exploitations.d.ts +18 -0
  45. package/metrics/systemdata/exploitations.js +23 -0
  46. package/metrics/systemdata/groundSystems.d.ts +86 -0
  47. package/metrics/systemdata/groundSystems.js +143 -0
  48. package/metrics/systemdata/index.d.ts +7 -0
  49. package/metrics/systemdata/index.js +23 -0
  50. package/metrics/systemdata/platform.d.ts +124 -0
  51. package/metrics/systemdata/platform.js +176 -0
  52. package/metrics/systemdata/systeminfo.d.ts +28 -0
  53. package/metrics/systemdata/systeminfo.js +64 -0
  54. package/package.json +2 -2
  55. package/scheduler/employees/assignment.d.ts +139 -0
  56. package/scheduler/employees/assignment.js +304 -0
  57. package/scheduler/employees/balance.d.ts +35 -0
  58. package/scheduler/employees/balance.js +39 -0
  59. package/scheduler/employees/companyinfo.d.ts +16 -0
  60. package/scheduler/employees/companyinfo.js +6 -0
  61. package/scheduler/employees/contact.d.ts +36 -0
  62. package/scheduler/employees/contact.js +40 -0
  63. package/scheduler/employees/employee.d.ts +420 -0
  64. package/scheduler/employees/employee.js +1862 -0
  65. package/scheduler/employees/employeename.d.ts +48 -0
  66. package/scheduler/employees/employeename.js +97 -0
  67. package/scheduler/employees/index.d.ts +14 -0
  68. package/scheduler/employees/index.js +30 -0
  69. package/scheduler/employees/labor.d.ts +31 -0
  70. package/scheduler/employees/labor.js +39 -0
  71. package/scheduler/employees/leave.d.ts +58 -0
  72. package/scheduler/employees/leave.js +73 -0
  73. package/scheduler/employees/leaverequest.d.ts +105 -0
  74. package/scheduler/employees/leaverequest.js +226 -0
  75. package/scheduler/employees/specialty.d.ts +35 -0
  76. package/scheduler/employees/specialty.js +40 -0
  77. package/scheduler/employees/variation.d.ts +80 -0
  78. package/scheduler/employees/variation.js +132 -0
  79. package/scheduler/employees/web.d.ts +6 -0
  80. package/scheduler/employees/web.js +2 -0
  81. package/scheduler/employees/work.d.ts +96 -0
  82. package/scheduler/employees/work.js +133 -0
  83. package/scheduler/employees/workday.d.ts +91 -0
  84. package/scheduler/employees/workday.js +170 -0
  85. package/scheduler/labor/index.d.ts +2 -0
  86. package/scheduler/labor/index.js +18 -0
  87. package/scheduler/labor/laborcode.d.ts +33 -0
  88. package/scheduler/labor/laborcode.js +55 -0
  89. package/scheduler/labor/workcode.d.ts +28 -0
  90. package/scheduler/labor/workcode.js +35 -0
  91. package/scheduler/reports/chargeStatus.d.ts +66 -0
  92. package/scheduler/reports/chargeStatus.js +702 -0
  93. package/scheduler/reports/cofsReports.d.ts +11 -0
  94. package/scheduler/reports/cofsReports.js +36 -0
  95. package/scheduler/reports/enterpriseSchedule.d.ts +18 -0
  96. package/scheduler/reports/enterpriseSchedule.js +159 -0
  97. package/scheduler/reports/index.d.ts +4 -0
  98. package/scheduler/reports/index.js +20 -0
  99. package/scheduler/reports/scheduleReport.d.ts +17 -0
  100. package/scheduler/reports/scheduleReport.js +311 -0
  101. package/scheduler/sites/index.d.ts +1 -0
  102. package/scheduler/sites/index.js +17 -0
  103. package/scheduler/sites/reports/cofsReport.d.ts +41 -0
  104. package/scheduler/sites/reports/cofsReport.js +104 -0
  105. package/scheduler/sites/reports/forecast.d.ts +57 -0
  106. package/scheduler/sites/reports/forecast.js +205 -0
  107. package/scheduler/sites/reports/index.d.ts +4 -0
  108. package/scheduler/sites/reports/index.js +20 -0
  109. package/scheduler/sites/reports/period.d.ts +11 -0
  110. package/scheduler/sites/reports/period.js +27 -0
  111. package/scheduler/sites/reports/section.d.ts +63 -0
  112. package/scheduler/sites/reports/section.js +174 -0
  113. package/scheduler/sites/site.d.ts +39 -0
  114. package/scheduler/sites/site.js +61 -0
  115. package/scheduler/sites/workcenters/index.d.ts +3 -0
  116. package/scheduler/sites/workcenters/index.js +19 -0
  117. package/scheduler/sites/workcenters/position.d.ts +27 -0
  118. package/scheduler/sites/workcenters/position.js +36 -0
  119. package/scheduler/sites/workcenters/shift.d.ts +32 -0
  120. package/scheduler/sites/workcenters/shift.js +47 -0
  121. package/scheduler/sites/workcenters/workcenter.d.ts +43 -0
  122. package/scheduler/sites/workcenters/workcenter.js +123 -0
  123. package/scheduler/teams/company/company.d.ts +99 -0
  124. package/scheduler/teams/company/company.js +256 -0
  125. package/scheduler/teams/company/holiday.d.ts +55 -0
  126. package/scheduler/teams/company/holiday.js +108 -0
  127. package/scheduler/teams/company/index.d.ts +3 -0
  128. package/scheduler/teams/company/index.js +19 -0
  129. package/scheduler/teams/company/modperiod.d.ts +21 -0
  130. package/scheduler/teams/company/modperiod.js +24 -0
  131. package/scheduler/teams/contact.d.ts +18 -0
  132. package/scheduler/teams/contact.js +23 -0
  133. package/scheduler/teams/index.d.ts +3 -0
  134. package/scheduler/teams/index.js +19 -0
  135. package/scheduler/teams/specialty.d.ts +18 -0
  136. package/scheduler/teams/specialty.js +23 -0
  137. package/scheduler/teams/team.d.ts +95 -0
  138. package/scheduler/teams/team.js +351 -0
  139. package/users/index.d.ts +2 -0
  140. package/users/index.js +18 -0
  141. package/users/user.d.ts +130 -0
  142. package/users/user.js +254 -0
  143. package/users/web.d.ts +22 -0
  144. package/users/web.js +2 -0
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Employee Name interface and class will be used to store and manipulate an employee's
3
+ * name.
4
+ */
5
+ /**
6
+ * This interface is used to describe an employee's name.
7
+ */
8
+ export interface IEmployeeName {
9
+ firstname: string;
10
+ middlename?: string;
11
+ lastname: string;
12
+ suffix?: string;
13
+ }
14
+ /**
15
+ * This class defined an employee name. The data members are:
16
+ * first, middlename and lastname names, plus an optional name suffix (ie. Jr, II, ...)
17
+ */
18
+ export declare class EmployeeName implements IEmployeeName {
19
+ firstname: string;
20
+ middlename?: string;
21
+ lastname: string;
22
+ suffix?: string;
23
+ constructor(name?: IEmployeeName);
24
+ /**
25
+ * This function will provide a complete full name consisting of first and lastname or
26
+ * first middlename and lastname names. the optional suffix is included.
27
+ * @returns The string value for the employee's full name (first middlename lastname suffix)
28
+ */
29
+ getFullName(): string;
30
+ /**
31
+ * This function will provide a shortened full name, minus the middlename and suffix.
32
+ * @returns A string value with the employee's shortened name (first lastname).
33
+ */
34
+ getFirstLast(): string;
35
+ /**
36
+ * This function will provide a shortened full name in the form of lastname, first
37
+ * @returns A string value for the employee's name (lastname, first)
38
+ */
39
+ getLastFirst(): string;
40
+ /**
41
+ * This function is used in sorting between this name and another. It is based on
42
+ * the lastname, first, middlename and suffix (in order).
43
+ * @param other The name object to be used in comparison
44
+ * @returns A numeric value to indicate whether this object is before or after the other
45
+ * object. -1 is before, 1 for after or 0 for equal.
46
+ */
47
+ compareTo(other?: EmployeeName): number;
48
+ }
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ /**
3
+ * Employee Name interface and class will be used to store and manipulate an employee's
4
+ * name.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.EmployeeName = void 0;
8
+ /**
9
+ * This class defined an employee name. The data members are:
10
+ * first, middlename and lastname names, plus an optional name suffix (ie. Jr, II, ...)
11
+ */
12
+ class EmployeeName {
13
+ firstname;
14
+ middlename;
15
+ lastname;
16
+ suffix;
17
+ constructor(name) {
18
+ this.firstname = (name) ? name.firstname : '';
19
+ this.middlename = (name && name.middlename) ? name.middlename : undefined;
20
+ this.lastname = (name) ? name.lastname : '';
21
+ this.suffix = (name) ? name.suffix : undefined;
22
+ }
23
+ /**
24
+ * This function will provide a complete full name consisting of first and lastname or
25
+ * first middlename and lastname names. the optional suffix is included.
26
+ * @returns The string value for the employee's full name (first middlename lastname suffix)
27
+ */
28
+ getFullName() {
29
+ let result = '';
30
+ if (!this.middlename) {
31
+ result = this.firstname + ' ' + this.lastname;
32
+ }
33
+ else {
34
+ result = this.firstname + ' ' + this.middlename.substring(0, 1) + '. '
35
+ + this.lastname;
36
+ }
37
+ if (this.suffix) {
38
+ result += ` ${this.suffix}`;
39
+ }
40
+ return result;
41
+ }
42
+ /**
43
+ * This function will provide a shortened full name, minus the middlename and suffix.
44
+ * @returns A string value with the employee's shortened name (first lastname).
45
+ */
46
+ getFirstLast() {
47
+ return this.firstname + ' ' + this.lastname;
48
+ }
49
+ /**
50
+ * This function will provide a shortened full name in the form of lastname, first
51
+ * @returns A string value for the employee's name (lastname, first)
52
+ */
53
+ getLastFirst() {
54
+ return this.lastname + ', ' + this.firstname;
55
+ }
56
+ /**
57
+ * This function is used in sorting between this name and another. It is based on
58
+ * the lastname, first, middlename and suffix (in order).
59
+ * @param other The name object to be used in comparison
60
+ * @returns A numeric value to indicate whether this object is before or after the other
61
+ * object. -1 is before, 1 for after or 0 for equal.
62
+ */
63
+ compareTo(other) {
64
+ if (other) {
65
+ if (this.lastname.toLowerCase() === other.lastname.toLowerCase()) {
66
+ if (this.firstname.toLowerCase() === other.firstname.toLowerCase()) {
67
+ if (this.middlename && other.middlename) {
68
+ if (this.middlename.toLowerCase() === other.middlename.toLowerCase()) {
69
+ if (this.suffix && other.suffix) {
70
+ return (this.suffix.toLowerCase() < other.suffix.toLowerCase()) ? -1 : 1;
71
+ }
72
+ else if (this.suffix) {
73
+ return 1;
74
+ }
75
+ else if (other.suffix) {
76
+ return -1;
77
+ }
78
+ return 0;
79
+ }
80
+ return (this.middlename.toLowerCase() < other.middlename.toLowerCase()) ? -1 : 1;
81
+ }
82
+ else if (this.middlename) {
83
+ return 1;
84
+ }
85
+ else if (other.middlename) {
86
+ return -1;
87
+ }
88
+ return 0;
89
+ }
90
+ return (this.firstname.toLowerCase() < other.firstname.toLowerCase()) ? -1 : 1;
91
+ }
92
+ return (this.lastname.toLowerCase() < other.lastname.toLowerCase()) ? -1 : 1;
93
+ }
94
+ return -1;
95
+ }
96
+ }
97
+ exports.EmployeeName = EmployeeName;
@@ -0,0 +1,14 @@
1
+ export * from './companyinfo';
2
+ export * from './employee';
3
+ export * from './employeename';
4
+ export * from './workday';
5
+ export * from './labor';
6
+ export * from './assignment';
7
+ export * from './variation';
8
+ export * from './leave';
9
+ export * from './leaverequest';
10
+ export * from './balance';
11
+ export * from './work';
12
+ export * from './contact';
13
+ export * from './specialty';
14
+ export * from './web';
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./companyinfo"), exports);
18
+ __exportStar(require("./employee"), exports);
19
+ __exportStar(require("./employeename"), exports);
20
+ __exportStar(require("./workday"), exports);
21
+ __exportStar(require("./labor"), exports);
22
+ __exportStar(require("./assignment"), exports);
23
+ __exportStar(require("./variation"), exports);
24
+ __exportStar(require("./leave"), exports);
25
+ __exportStar(require("./leaverequest"), exports);
26
+ __exportStar(require("./balance"), exports);
27
+ __exportStar(require("./work"), exports);
28
+ __exportStar(require("./contact"), exports);
29
+ __exportStar(require("./specialty"), exports);
30
+ __exportStar(require("./web"), exports);
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Employee Labor Code is specifically designed to hold the codes used by companies'
3
+ * payroll system to record time spent on a particular function. This will normally
4
+ * consist of a base charge number and an extension code.
5
+ */
6
+ /**
7
+ * This interface will be used to assign an employee a labor code.
8
+ */
9
+ export interface IEmployeeLaborCode {
10
+ chargeNumber: string;
11
+ extension: string;
12
+ }
13
+ /**
14
+ * This class defined an employee's labor code. The data members are:
15
+ * chargeNumber (string value for a general work area).
16
+ * extension (string value to entend the charge number to specific work assignments)
17
+ */
18
+ export declare class EmployeeLaborCode implements IEmployeeLaborCode {
19
+ chargeNumber: string;
20
+ extension: string;
21
+ constructor(elc?: IEmployeeLaborCode);
22
+ /**
23
+ * This function will provide a numeric value for whether or not this employee labor
24
+ * code is before or after another object. The charge number and extension are used
25
+ * for comparison
26
+ * @param other The employee labor code object used for comparision
27
+ * @returns A numeric value to indicate whether this object is before or after another
28
+ * employee labor code. -1 is before and 1 is after.
29
+ */
30
+ compareTo(other?: EmployeeLaborCode): number;
31
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /**
3
+ * Employee Labor Code is specifically designed to hold the codes used by companies'
4
+ * payroll system to record time spent on a particular function. This will normally
5
+ * consist of a base charge number and an extension code.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.EmployeeLaborCode = void 0;
9
+ /**
10
+ * This class defined an employee's labor code. The data members are:
11
+ * chargeNumber (string value for a general work area).
12
+ * extension (string value to entend the charge number to specific work assignments)
13
+ */
14
+ class EmployeeLaborCode {
15
+ chargeNumber;
16
+ extension;
17
+ constructor(elc) {
18
+ this.chargeNumber = (elc) ? elc.chargeNumber : '';
19
+ this.extension = (elc) ? elc.extension : '';
20
+ }
21
+ /**
22
+ * This function will provide a numeric value for whether or not this employee labor
23
+ * code is before or after another object. The charge number and extension are used
24
+ * for comparison
25
+ * @param other The employee labor code object used for comparision
26
+ * @returns A numeric value to indicate whether this object is before or after another
27
+ * employee labor code. -1 is before and 1 is after.
28
+ */
29
+ compareTo(other) {
30
+ if (other) {
31
+ if (this.chargeNumber === other.chargeNumber) {
32
+ return (this.extension < other.extension) ? -1 : 1;
33
+ }
34
+ return (this.chargeNumber < other.chargeNumber) ? -1 : 1;
35
+ }
36
+ return -1;
37
+ }
38
+ }
39
+ exports.EmployeeLaborCode = EmployeeLaborCode;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The leave record is used for approved and actual leave (non-work) time.
3
+ */
4
+ /**
5
+ * This interface is used to describe a leave day, either approved or actual leave.
6
+ */
7
+ export interface ILeave {
8
+ id: number;
9
+ leavedate: Date;
10
+ code: string;
11
+ hours: number;
12
+ status: string;
13
+ requestid: string;
14
+ used: boolean;
15
+ tagday?: string;
16
+ }
17
+ /**
18
+ * This class describes a leave day. Its data member are:
19
+ * id (numeric value for the key to the leaves listed)
20
+ * leavedate (the date object for the date the leave is on)
21
+ * code (the string value for the leave code to be used)
22
+ * hours (the numeric value (float) for the number of hours used or projected to be used)
23
+ * status (the string value for the status of the leave, either approved or actual)
24
+ * requestid (the string value representing the id of the request used to get this leave
25
+ * approved)
26
+ * used (a boolean value used by the application as whether or not the leave was used
27
+ * already)
28
+ * tagday (a string value for a tag to a holiday type leave to ensure it fills a
29
+ * particular holiday in the company's holiday list)
30
+ */
31
+ export declare class Leave implements ILeave {
32
+ id: number;
33
+ leavedate: Date;
34
+ code: string;
35
+ hours: number;
36
+ status: string;
37
+ requestid: string;
38
+ used: boolean;
39
+ tagday?: string;
40
+ constructor(other?: ILeave);
41
+ /**
42
+ * This function is used in sorting between this leave and another. It is based on
43
+ * the leave date, hours used/proposed, and code used.
44
+ * @param other The leave object to be used in comparison
45
+ * @returns A numeric value to indicate whether this object is before or after the other
46
+ * object. -1 is before or 1 for after.
47
+ */
48
+ compareTo(other?: Leave): number;
49
+ /**
50
+ * This function will provide a boolean value for whether or not this leave is on the
51
+ * requested date. The leave date and provided date are compared using UTC value of
52
+ * year, month, and day
53
+ * @param date The date object used for comparision
54
+ * @returns The boolean value stating whether the UTC value for year, month and day are
55
+ * equal.
56
+ */
57
+ useLeave(date: Date): boolean;
58
+ }
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ /**
3
+ * The leave record is used for approved and actual leave (non-work) time.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Leave = void 0;
7
+ /**
8
+ * This class describes a leave day. Its data member are:
9
+ * id (numeric value for the key to the leaves listed)
10
+ * leavedate (the date object for the date the leave is on)
11
+ * code (the string value for the leave code to be used)
12
+ * hours (the numeric value (float) for the number of hours used or projected to be used)
13
+ * status (the string value for the status of the leave, either approved or actual)
14
+ * requestid (the string value representing the id of the request used to get this leave
15
+ * approved)
16
+ * used (a boolean value used by the application as whether or not the leave was used
17
+ * already)
18
+ * tagday (a string value for a tag to a holiday type leave to ensure it fills a
19
+ * particular holiday in the company's holiday list)
20
+ */
21
+ class Leave {
22
+ id;
23
+ leavedate;
24
+ code;
25
+ hours;
26
+ status;
27
+ requestid;
28
+ used;
29
+ tagday;
30
+ constructor(other) {
31
+ this.id = (other) ? other.id : 0;
32
+ this.leavedate = (other) ? new Date(other.leavedate) : new Date(0);
33
+ this.code = (other) ? other.code : 'V';
34
+ this.hours = (other) ? other.hours : 0.0;
35
+ this.status = (other) ? other.status : 'REQUESTED';
36
+ this.requestid = (other) ? other.requestid : '';
37
+ this.used = (other) ? other.used : false;
38
+ this.tagday = (other && other.tagday) ? other.tagday : undefined;
39
+ }
40
+ /**
41
+ * This function is used in sorting between this leave and another. It is based on
42
+ * the leave date, hours used/proposed, and code used.
43
+ * @param other The leave object to be used in comparison
44
+ * @returns A numeric value to indicate whether this object is before or after the other
45
+ * object. -1 is before or 1 for after.
46
+ */
47
+ compareTo(other) {
48
+ if (other) {
49
+ if (this.leavedate.getTime() === other.leavedate.getTime()) {
50
+ if (this.hours === other.hours) {
51
+ return (this.code < other.code) ? -1 : 1;
52
+ }
53
+ return (this.hours > other.hours) ? -1 : 1;
54
+ }
55
+ return (this.leavedate.getTime() < other.leavedate.getTime()) ? -1 : 1;
56
+ }
57
+ return -1;
58
+ }
59
+ /**
60
+ * This function will provide a boolean value for whether or not this leave is on the
61
+ * requested date. The leave date and provided date are compared using UTC value of
62
+ * year, month, and day
63
+ * @param date The date object used for comparision
64
+ * @returns The boolean value stating whether the UTC value for year, month and day are
65
+ * equal.
66
+ */
67
+ useLeave(date) {
68
+ return (this.leavedate.getUTCFullYear() === date.getUTCFullYear()
69
+ && this.leavedate.getUTCMonth() === date.getUTCMonth()
70
+ && this.leavedate.getUTCDate() === date.getUTCDate());
71
+ }
72
+ }
73
+ exports.Leave = Leave;
@@ -0,0 +1,105 @@
1
+ import { ILeave, Leave } from "./leave";
2
+ import { Employee } from "./employee";
3
+ /**
4
+ * The leave request is the record an employee uses to request a leave period with their
5
+ * supervisor. It includes comments and proposed leave days.
6
+ */
7
+ /**
8
+ * The interface describes a comment to a leave request.
9
+ */
10
+ export interface ILeaveRequestComment {
11
+ commentdate: Date;
12
+ comment: string;
13
+ }
14
+ /**
15
+ * The class description for a comment to a leave request. The data members are:
16
+ * comment date (date object for the date the comment was written on.)
17
+ * comment (the string value for the actual comment to the request)
18
+ */
19
+ export declare class LeaveRequestComment implements ILeaveRequestComment {
20
+ commentdate: Date;
21
+ comment: string;
22
+ constructor(cmt?: ILeaveRequestComment);
23
+ /**
24
+ * This function is used to sort the comments by date.
25
+ * @param other The comment object used in comparison.
26
+ * @returns
27
+
28
+ /**
29
+ * This function is used to sort this object from another variation object
30
+ * @param other The other variation object for comparison
31
+ * @returns A numeric value to indicate whether this object is before or after the other
32
+ * object. -1 is before or 1 for after.
33
+ */
34
+ compareTo(other?: LeaveRequestComment): number;
35
+ }
36
+ /**
37
+ * This interface describes a leave request.
38
+ */
39
+ export interface ILeaveRequest {
40
+ id: string;
41
+ employeeid: string;
42
+ requestdate: Date;
43
+ primarycode: string;
44
+ startdate: Date;
45
+ enddate: Date;
46
+ status: string;
47
+ approvedby: string;
48
+ approvalDate: Date;
49
+ requesteddays: ILeave[];
50
+ comments?: ILeaveRequestComment[];
51
+ }
52
+ /**
53
+ * This class describes a leave request object. The data members are:
54
+ * id (string value representing a mongo db object identifier)
55
+ * employeeid (string value representing a mongo db object identifier for the employee)
56
+ * requestdate (the date object for the date the request was created)
57
+ * primarycode (string value for the leave code used the most in the request)
58
+ * startdate (the date object used to define the begining of the leave period)
59
+ * enddate (the date object used to define the end of the leave period)
60
+ * status (the string value for the step the request is in the approval process. The
61
+ * available statuses are DRAFT, REQUESTED, APPROVED)
62
+ * approvedby (the string value representing the object id of the supervisor approving
63
+ * the request)
64
+ * approvaldate (the date object for the date the request was approved)
65
+ * requesteddays (the list of proposed leave days within the period)
66
+ * comments (the list of comments to this request)
67
+ */
68
+ export declare class LeaveRequest implements ILeaveRequest {
69
+ id: string;
70
+ employeeid: string;
71
+ requestdate: Date;
72
+ primarycode: string;
73
+ startdate: Date;
74
+ enddate: Date;
75
+ status: string;
76
+ approvedby: string;
77
+ approvalDate: Date;
78
+ requesteddays: Leave[];
79
+ comments: LeaveRequestComment[];
80
+ constructor(req?: ILeaveRequest);
81
+ /**
82
+ * this function is used to sort this request from another. They are sorted based on
83
+ * start, end and request dates.
84
+ * @param other The request object used for comparison.
85
+ * @returns A numeric value to indicate whether this object is before or after the other
86
+ * object. -1 is before or 1 for after.
87
+ */
88
+ compareTo(other?: LeaveRequest): number;
89
+ useRequest(id: string): boolean;
90
+ /**
91
+ * This function is used to replace a value on a single proposed leave day.
92
+ * @param date The date object used to find which leave day to update
93
+ * @param field The string value for which field in the leave day to update.
94
+ * @param value The string value for the change. If can me a string value of a number
95
+ * or boolean value.
96
+ */
97
+ updateLeaveDay(date: Date, field: string, value: string): void;
98
+ /**
99
+ * This function is used to set up leave days in the request object based on the
100
+ * period and whether or not the employee normally works the day.
101
+ * @param emp This a reference to the employee object where this request resides and
102
+ * is used to determine if the employee normally works on that day.
103
+ */
104
+ setLeaveDays(emp: Employee, reset?: boolean): void;
105
+ }