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.
- package/general/emailer.d.ts +1 -0
- package/general/emailer.js +31 -0
- package/general/general.d.ts +12 -0
- package/general/general.js +2 -0
- package/general/index.d.ts +4 -0
- package/general/index.js +20 -0
- package/general/report.d.ts +12 -0
- package/general/report.js +70 -0
- package/general/reportStyle.d.ts +0 -0
- package/general/reportStyle.js +1 -0
- package/general/viewstate.d.ts +5 -0
- package/general/viewstate.js +9 -0
- package/index.d.ts +0 -0
- package/metrics/images.d.ts +22 -0
- package/metrics/images.js +33 -0
- package/metrics/index.d.ts +5 -0
- package/metrics/index.js +21 -0
- package/metrics/mission.d.ts +47 -0
- package/metrics/mission.js +81 -0
- package/metrics/missionSensorOutage.d.ts +11 -0
- package/metrics/missionSensorOutage.js +14 -0
- package/metrics/missionsensor.d.ts +67 -0
- package/metrics/missionsensor.js +128 -0
- package/metrics/outage.d.ts +43 -0
- package/metrics/outage.js +55 -0
- package/metrics/reports/drawSummary.d.ts +24 -0
- package/metrics/reports/drawSummary.js +311 -0
- package/metrics/reports/index.d.ts +5 -0
- package/metrics/reports/index.js +21 -0
- package/metrics/reports/missionDay.d.ts +8 -0
- package/metrics/reports/missionDay.js +23 -0
- package/metrics/reports/missionSummary.d.ts +25 -0
- package/metrics/reports/missionSummary.js +421 -0
- package/metrics/reports/missionType.d.ts +20 -0
- package/metrics/reports/missionType.js +314 -0
- package/metrics/reports/outageDay.d.ts +8 -0
- package/metrics/reports/outageDay.js +23 -0
- package/metrics/systemdata/classifications.d.ts +18 -0
- package/metrics/systemdata/classifications.js +23 -0
- package/metrics/systemdata/communications.d.ts +21 -0
- package/metrics/systemdata/communications.js +40 -0
- package/metrics/systemdata/dcgs.d.ts +19 -0
- package/metrics/systemdata/dcgs.js +29 -0
- package/metrics/systemdata/exploitations.d.ts +18 -0
- package/metrics/systemdata/exploitations.js +23 -0
- package/metrics/systemdata/groundSystems.d.ts +86 -0
- package/metrics/systemdata/groundSystems.js +143 -0
- package/metrics/systemdata/index.d.ts +7 -0
- package/metrics/systemdata/index.js +23 -0
- package/metrics/systemdata/platform.d.ts +124 -0
- package/metrics/systemdata/platform.js +176 -0
- package/metrics/systemdata/systeminfo.d.ts +28 -0
- package/metrics/systemdata/systeminfo.js +64 -0
- package/package.json +2 -2
- package/scheduler/employees/assignment.d.ts +139 -0
- package/scheduler/employees/assignment.js +304 -0
- package/scheduler/employees/balance.d.ts +35 -0
- package/scheduler/employees/balance.js +39 -0
- package/scheduler/employees/companyinfo.d.ts +16 -0
- package/scheduler/employees/companyinfo.js +6 -0
- package/scheduler/employees/contact.d.ts +36 -0
- package/scheduler/employees/contact.js +40 -0
- package/scheduler/employees/employee.d.ts +420 -0
- package/scheduler/employees/employee.js +1862 -0
- package/scheduler/employees/employeename.d.ts +48 -0
- package/scheduler/employees/employeename.js +97 -0
- package/scheduler/employees/index.d.ts +14 -0
- package/scheduler/employees/index.js +30 -0
- package/scheduler/employees/labor.d.ts +31 -0
- package/scheduler/employees/labor.js +39 -0
- package/scheduler/employees/leave.d.ts +58 -0
- package/scheduler/employees/leave.js +73 -0
- package/scheduler/employees/leaverequest.d.ts +105 -0
- package/scheduler/employees/leaverequest.js +226 -0
- package/scheduler/employees/specialty.d.ts +35 -0
- package/scheduler/employees/specialty.js +40 -0
- package/scheduler/employees/variation.d.ts +80 -0
- package/scheduler/employees/variation.js +132 -0
- package/scheduler/employees/web.d.ts +6 -0
- package/scheduler/employees/web.js +2 -0
- package/scheduler/employees/work.d.ts +96 -0
- package/scheduler/employees/work.js +133 -0
- package/scheduler/employees/workday.d.ts +91 -0
- package/scheduler/employees/workday.js +170 -0
- package/scheduler/labor/index.d.ts +2 -0
- package/scheduler/labor/index.js +18 -0
- package/scheduler/labor/laborcode.d.ts +33 -0
- package/scheduler/labor/laborcode.js +55 -0
- package/scheduler/labor/workcode.d.ts +28 -0
- package/scheduler/labor/workcode.js +35 -0
- package/scheduler/reports/chargeStatus.d.ts +66 -0
- package/scheduler/reports/chargeStatus.js +702 -0
- package/scheduler/reports/cofsReports.d.ts +11 -0
- package/scheduler/reports/cofsReports.js +36 -0
- package/scheduler/reports/enterpriseSchedule.d.ts +18 -0
- package/scheduler/reports/enterpriseSchedule.js +159 -0
- package/scheduler/reports/index.d.ts +4 -0
- package/scheduler/reports/index.js +20 -0
- package/scheduler/reports/scheduleReport.d.ts +17 -0
- package/scheduler/reports/scheduleReport.js +311 -0
- package/scheduler/sites/index.d.ts +1 -0
- package/scheduler/sites/index.js +17 -0
- package/scheduler/sites/reports/cofsReport.d.ts +41 -0
- package/scheduler/sites/reports/cofsReport.js +104 -0
- package/scheduler/sites/reports/forecast.d.ts +57 -0
- package/scheduler/sites/reports/forecast.js +205 -0
- package/scheduler/sites/reports/index.d.ts +4 -0
- package/scheduler/sites/reports/index.js +20 -0
- package/scheduler/sites/reports/period.d.ts +11 -0
- package/scheduler/sites/reports/period.js +27 -0
- package/scheduler/sites/reports/section.d.ts +63 -0
- package/scheduler/sites/reports/section.js +174 -0
- package/scheduler/sites/site.d.ts +39 -0
- package/scheduler/sites/site.js +61 -0
- package/scheduler/sites/workcenters/index.d.ts +3 -0
- package/scheduler/sites/workcenters/index.js +19 -0
- package/scheduler/sites/workcenters/position.d.ts +27 -0
- package/scheduler/sites/workcenters/position.js +36 -0
- package/scheduler/sites/workcenters/shift.d.ts +32 -0
- package/scheduler/sites/workcenters/shift.js +47 -0
- package/scheduler/sites/workcenters/workcenter.d.ts +43 -0
- package/scheduler/sites/workcenters/workcenter.js +123 -0
- package/scheduler/teams/company/company.d.ts +99 -0
- package/scheduler/teams/company/company.js +256 -0
- package/scheduler/teams/company/holiday.d.ts +55 -0
- package/scheduler/teams/company/holiday.js +108 -0
- package/scheduler/teams/company/index.d.ts +3 -0
- package/scheduler/teams/company/index.js +19 -0
- package/scheduler/teams/company/modperiod.d.ts +21 -0
- package/scheduler/teams/company/modperiod.js +24 -0
- package/scheduler/teams/contact.d.ts +18 -0
- package/scheduler/teams/contact.js +23 -0
- package/scheduler/teams/index.d.ts +3 -0
- package/scheduler/teams/index.js +19 -0
- package/scheduler/teams/specialty.d.ts +18 -0
- package/scheduler/teams/specialty.js +23 -0
- package/scheduler/teams/team.d.ts +95 -0
- package/scheduler/teams/team.js +351 -0
- package/users/index.d.ts +2 -0
- package/users/index.js +18 -0
- package/users/user.d.ts +130 -0
- package/users/user.js +254 -0
- package/users/web.d.ts +22 -0
- package/users/web.js +2 -0
@@ -0,0 +1,256 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Company = void 0;
|
4
|
+
const holiday_1 = require("./holiday");
|
5
|
+
const modperiod_1 = require("./modperiod");
|
6
|
+
/**
|
7
|
+
* This class definition implements the company interface, plus necessary actions to
|
8
|
+
* manipulate the object.
|
9
|
+
*/
|
10
|
+
class Company {
|
11
|
+
id;
|
12
|
+
name;
|
13
|
+
ingest;
|
14
|
+
ingestPeriod;
|
15
|
+
startDay;
|
16
|
+
ingestPwd;
|
17
|
+
holidays;
|
18
|
+
modperiods;
|
19
|
+
constructor(co) {
|
20
|
+
this.id = (co) ? co.id : '';
|
21
|
+
this.name = (co) ? co.name : '';
|
22
|
+
this.ingest = (co) ? co.ingest : 'mexcel';
|
23
|
+
this.ingestPeriod = (co && co.ingestPeriod) ? co.ingestPeriod : 0;
|
24
|
+
this.startDay = (co && co.startDay) ? co.startDay : 0;
|
25
|
+
this.ingestPwd = (co) ? co.ingestPwd : '';
|
26
|
+
this.holidays = [];
|
27
|
+
if (co && co.holidays && co.holidays.length > 0) {
|
28
|
+
co.holidays.forEach(hol => {
|
29
|
+
this.holidays.push(new holiday_1.Holiday(hol));
|
30
|
+
});
|
31
|
+
this.holidays.sort((a, b) => a.compareTo(b));
|
32
|
+
}
|
33
|
+
this.modperiods = [];
|
34
|
+
if (co && co.modperiods && co.modperiods.length > 0) {
|
35
|
+
co.modperiods.forEach(mod => {
|
36
|
+
this.modperiods.push(new modperiod_1.ModPeriod(mod));
|
37
|
+
});
|
38
|
+
this.modperiods.sort((a, b) => a.compareTo(b));
|
39
|
+
}
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* This function is used in sorting this company with another.
|
43
|
+
* @param other The company object used in the comparison.
|
44
|
+
* @returns a numeric value to show relative position between the objects
|
45
|
+
*/
|
46
|
+
compareTo(other) {
|
47
|
+
if (other) {
|
48
|
+
return (this.name.toLowerCase() < other.name.toLowerCase()) ? -1 : 1;
|
49
|
+
}
|
50
|
+
return -1;
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* This function is used to purge any old data from the company record, mainly holiday
|
54
|
+
* actual dates.
|
55
|
+
* @param date A date object used as the cutoff date.
|
56
|
+
*/
|
57
|
+
purge(date) {
|
58
|
+
this.holidays.forEach((hol, h) => {
|
59
|
+
hol.purge(date);
|
60
|
+
this.holidays[h] = hol;
|
61
|
+
});
|
62
|
+
for (let m = this.modperiods.length - 1; m >= 0; m--) {
|
63
|
+
if (this.modperiods[m].year < date.getFullYear()) {
|
64
|
+
this.modperiods.splice(m, 1);
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
/**
|
69
|
+
* The function checks the company's list of mod periods to see if one of them fits
|
70
|
+
* within its start and end dates.
|
71
|
+
* @param date The date object for checking mod periods.
|
72
|
+
* @returns A boolean value to indicate if the list contains a mod period for the date.
|
73
|
+
*/
|
74
|
+
hasModPeriod(date) {
|
75
|
+
let answer = false;
|
76
|
+
this.modperiods.forEach(mod => {
|
77
|
+
if (date.getTime() >= mod.start.getTime() || date.getTime() <= mod.end.getTime()) {
|
78
|
+
answer = true;
|
79
|
+
}
|
80
|
+
});
|
81
|
+
return answer;
|
82
|
+
}
|
83
|
+
/**
|
84
|
+
* This function will add a new mod period to the company's mod period list.
|
85
|
+
* @param year numeric value for the full year.
|
86
|
+
* @param start The date object to specify the first day of the company's mod period.
|
87
|
+
* @param end The date object to specify the last day of the company's mod period.
|
88
|
+
*/
|
89
|
+
addModPeriod(year, start, end) {
|
90
|
+
let found = false;
|
91
|
+
this.modperiods.forEach((mod, m) => {
|
92
|
+
if (mod.year === year) {
|
93
|
+
mod.start = new Date(start);
|
94
|
+
mod.end = new Date(end);
|
95
|
+
this.modperiods[m] = mod;
|
96
|
+
found = true;
|
97
|
+
}
|
98
|
+
});
|
99
|
+
if (!found) {
|
100
|
+
this.modperiods.push(new modperiod_1.ModPeriod({
|
101
|
+
year: year,
|
102
|
+
start: new Date(start),
|
103
|
+
end: new Date(end)
|
104
|
+
}));
|
105
|
+
this.modperiods.sort((a, b) => a.compareTo(b));
|
106
|
+
}
|
107
|
+
}
|
108
|
+
/**
|
109
|
+
* This function is used update either the start or end dates.
|
110
|
+
* @param year A numeric value for the mod period's year value
|
111
|
+
* @param field A string value to designate which date field to update
|
112
|
+
* @param value A date object used in the update.
|
113
|
+
*/
|
114
|
+
updateModPeriod(year, field, value) {
|
115
|
+
this.modperiods.forEach((mod, m) => {
|
116
|
+
if (mod.year === year) {
|
117
|
+
switch (field.toLowerCase()) {
|
118
|
+
case "start":
|
119
|
+
mod.start = new Date(value);
|
120
|
+
break;
|
121
|
+
case "end":
|
122
|
+
mod.end = new Date(value);
|
123
|
+
break;
|
124
|
+
}
|
125
|
+
this.modperiods[m] = mod;
|
126
|
+
}
|
127
|
+
});
|
128
|
+
}
|
129
|
+
/**
|
130
|
+
* This function will remove a mod period from the company's list.
|
131
|
+
* @param year a numeric value for the year to delete.
|
132
|
+
*/
|
133
|
+
deleteModPeriod(year) {
|
134
|
+
let found = -1;
|
135
|
+
this.modperiods.forEach((mod, m) => {
|
136
|
+
if (mod.year === year) {
|
137
|
+
found = m;
|
138
|
+
}
|
139
|
+
});
|
140
|
+
if (found >= 0) {
|
141
|
+
this.modperiods.splice(found, 1);
|
142
|
+
}
|
143
|
+
}
|
144
|
+
/**
|
145
|
+
* This function checks whether a particular holiday based on a combined identifier of
|
146
|
+
* holiday type and a sort value is present in the company's list.
|
147
|
+
* @param type The holiday type value for comparison to the list
|
148
|
+
* @param sort A numeric value for the second part of the identifier.
|
149
|
+
* @returns A boolean value to signify if the holiday is present in the company's list.
|
150
|
+
*/
|
151
|
+
hasHoliday(type, sort) {
|
152
|
+
let answer = false;
|
153
|
+
this.holidays.forEach(hol => {
|
154
|
+
if (hol.id === type && hol.sort === sort) {
|
155
|
+
answer = true;
|
156
|
+
}
|
157
|
+
});
|
158
|
+
return answer;
|
159
|
+
}
|
160
|
+
/**
|
161
|
+
* This function will add a new holiday, after checking for the name given.
|
162
|
+
* @param type The holiday type value for the new holiday
|
163
|
+
* @param name A string value for the name of the new holiday
|
164
|
+
* @returns A holiday object with the type and name.
|
165
|
+
*/
|
166
|
+
addHoliday(type, name) {
|
167
|
+
let max = 0;
|
168
|
+
let holiday = new holiday_1.Holiday();
|
169
|
+
this.holidays.forEach(hol => {
|
170
|
+
if (hol.id === type && max < hol.sort) {
|
171
|
+
max = hol.sort;
|
172
|
+
}
|
173
|
+
if (hol.name.toLowerCase() === name.toLowerCase()) {
|
174
|
+
holiday = new holiday_1.Holiday(hol);
|
175
|
+
}
|
176
|
+
});
|
177
|
+
if (holiday.sort === 0) {
|
178
|
+
holiday = new holiday_1.Holiday({
|
179
|
+
id: type,
|
180
|
+
name: name,
|
181
|
+
sort: max + 1
|
182
|
+
});
|
183
|
+
this.holidays.push(holiday);
|
184
|
+
}
|
185
|
+
return holiday;
|
186
|
+
}
|
187
|
+
/**
|
188
|
+
* This function is used to update a company holiday.
|
189
|
+
* @param type The holiday type value for the holiday to update
|
190
|
+
* @param sort The sort value for the holiday to update
|
191
|
+
* @param field The string value to point to which field to update within the holiday.
|
192
|
+
* @param value The string value for the new value to update to.
|
193
|
+
*/
|
194
|
+
updateHoliday(type, sort, field, value) {
|
195
|
+
this.holidays.sort((a, b) => a.compareTo(b));
|
196
|
+
this.holidays.forEach((hol, h) => {
|
197
|
+
if (hol.id === type && hol.sort === sort) {
|
198
|
+
switch (field.toLowerCase()) {
|
199
|
+
case "name":
|
200
|
+
hol.name = value;
|
201
|
+
break;
|
202
|
+
case "move":
|
203
|
+
if (value.toLowerCase().substring(0, 2) === 'up') {
|
204
|
+
if (h > 0) {
|
205
|
+
const otherHol = this.holidays[h - 1];
|
206
|
+
if (otherHol.id === hol.id) {
|
207
|
+
const temp = otherHol.sort;
|
208
|
+
otherHol.sort = hol.sort;
|
209
|
+
hol.sort = temp;
|
210
|
+
this.holidays[h - 1] = otherHol;
|
211
|
+
}
|
212
|
+
}
|
213
|
+
}
|
214
|
+
else {
|
215
|
+
if (h < this.holidays.length - 1) {
|
216
|
+
const otherHol = this.holidays[h + 1];
|
217
|
+
if (otherHol.id === hol.id) {
|
218
|
+
const temp = otherHol.sort;
|
219
|
+
otherHol.sort = hol.sort;
|
220
|
+
hol.sort = temp;
|
221
|
+
this.holidays[h - 1] = otherHol;
|
222
|
+
}
|
223
|
+
}
|
224
|
+
}
|
225
|
+
break;
|
226
|
+
case "addactual":
|
227
|
+
const newActual = new Date(Date.parse(value));
|
228
|
+
hol.addActual(newActual);
|
229
|
+
break;
|
230
|
+
case "deleteactual":
|
231
|
+
const oldActual = new Date(Date.parse(value));
|
232
|
+
hol.deleteActual(oldActual);
|
233
|
+
break;
|
234
|
+
}
|
235
|
+
this.holidays[h] = hol;
|
236
|
+
}
|
237
|
+
});
|
238
|
+
}
|
239
|
+
/**
|
240
|
+
* This function will remove the company holiday based on the type and identifier.
|
241
|
+
* @param type The holiday type to look for
|
242
|
+
* @param sort The numeric identifier for the holiday type.
|
243
|
+
*/
|
244
|
+
deleteHoliday(type, sort) {
|
245
|
+
let found = -1;
|
246
|
+
this.holidays.forEach((hol, h) => {
|
247
|
+
if (hol.id === type && hol.sort === sort) {
|
248
|
+
found = h;
|
249
|
+
}
|
250
|
+
});
|
251
|
+
if (found >= 0) {
|
252
|
+
this.holidays.splice(found, 1);
|
253
|
+
}
|
254
|
+
}
|
255
|
+
}
|
256
|
+
exports.Company = Company;
|
@@ -0,0 +1,55 @@
|
|
1
|
+
export declare enum HolidayType {
|
2
|
+
holiday = "H",
|
3
|
+
floating = "F"
|
4
|
+
}
|
5
|
+
/**
|
6
|
+
* This interface holds a listed company holiday and the data members involved. The
|
7
|
+
* id is either H for regular, date determined holiday and F for floating or date-less
|
8
|
+
* holiday. The sort value is the sort order within the company's H and F types holidays.
|
9
|
+
*/
|
10
|
+
export interface IHoliday {
|
11
|
+
id: HolidayType;
|
12
|
+
name: string;
|
13
|
+
sort: number;
|
14
|
+
actualdates?: Date[];
|
15
|
+
}
|
16
|
+
/**
|
17
|
+
* This class definition implements the holiday interface and add needed actions to
|
18
|
+
* manipulate the holiday object.
|
19
|
+
*/
|
20
|
+
export declare class Holiday implements IHoliday {
|
21
|
+
id: HolidayType;
|
22
|
+
name: string;
|
23
|
+
sort: number;
|
24
|
+
actualdates: Date[];
|
25
|
+
constructor(hol?: IHoliday);
|
26
|
+
/**
|
27
|
+
* This function is used in sorting holidays by comparing their ids and sort values
|
28
|
+
* @param other The holiday object used in comparison
|
29
|
+
* @returns A numeric value for relative location compared to other (-1 before, 1 after).
|
30
|
+
*/
|
31
|
+
compareTo(other?: Holiday): 1 | -1;
|
32
|
+
/**
|
33
|
+
* This function will retrieve any set date for the actual holiday, based on the year
|
34
|
+
* provided.
|
35
|
+
* @param year The numeric (integer) value for the 4-digit year
|
36
|
+
* @returns A date object or undefined for the set day of the year.
|
37
|
+
*/
|
38
|
+
getActual(year: number): Date | undefined;
|
39
|
+
/**
|
40
|
+
* The function will add a new date to the actuals list, if not already present.
|
41
|
+
* @param date The date object to add.
|
42
|
+
*/
|
43
|
+
addActual(date: Date): void;
|
44
|
+
/**
|
45
|
+
* The function will remove a date from the actuals list.
|
46
|
+
* @param date The date object to remove.
|
47
|
+
*/
|
48
|
+
deleteActual(date: Date): void;
|
49
|
+
/**
|
50
|
+
* This function will check the holiday's actual dates for dates before a cutoff date
|
51
|
+
* and remove them from the object.
|
52
|
+
* @param date The date object used as a cutoff for the purged dates.
|
53
|
+
*/
|
54
|
+
purge(date: Date): void;
|
55
|
+
}
|
@@ -0,0 +1,108 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Holiday = exports.HolidayType = void 0;
|
4
|
+
var HolidayType;
|
5
|
+
(function (HolidayType) {
|
6
|
+
HolidayType["holiday"] = "H";
|
7
|
+
HolidayType["floating"] = "F";
|
8
|
+
})(HolidayType || (exports.HolidayType = HolidayType = {}));
|
9
|
+
/**
|
10
|
+
* This class definition implements the holiday interface and add needed actions to
|
11
|
+
* manipulate the holiday object.
|
12
|
+
*/
|
13
|
+
class Holiday {
|
14
|
+
id;
|
15
|
+
name;
|
16
|
+
sort;
|
17
|
+
actualdates;
|
18
|
+
constructor(hol) {
|
19
|
+
this.id = (hol) ? hol.id : HolidayType.holiday;
|
20
|
+
this.name = (hol) ? hol.name : '';
|
21
|
+
this.sort = (hol) ? hol.sort : 0;
|
22
|
+
this.actualdates = [];
|
23
|
+
if (hol && hol.actualdates && hol.actualdates.length > 0) {
|
24
|
+
hol.actualdates.forEach(dt => {
|
25
|
+
this.actualdates.push(new Date(dt));
|
26
|
+
});
|
27
|
+
this.actualdates.sort((a, b) => (a.getTime() < b.getTime()) ? -1 : 1);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* This function is used in sorting holidays by comparing their ids and sort values
|
32
|
+
* @param other The holiday object used in comparison
|
33
|
+
* @returns A numeric value for relative location compared to other (-1 before, 1 after).
|
34
|
+
*/
|
35
|
+
compareTo(other) {
|
36
|
+
if (other) {
|
37
|
+
if (this.id.toLowerCase() === other.id.toLowerCase()) {
|
38
|
+
return (this.sort < other.sort) ? -1 : 1;
|
39
|
+
}
|
40
|
+
return (this.id.toLowerCase() === 'h') ? -1 : 1;
|
41
|
+
}
|
42
|
+
return -1;
|
43
|
+
}
|
44
|
+
/**
|
45
|
+
* This function will retrieve any set date for the actual holiday, based on the year
|
46
|
+
* provided.
|
47
|
+
* @param year The numeric (integer) value for the 4-digit year
|
48
|
+
* @returns A date object or undefined for the set day of the year.
|
49
|
+
*/
|
50
|
+
getActual(year) {
|
51
|
+
let answer = undefined;
|
52
|
+
const start = new Date(Date.UTC(year, 0, 1));
|
53
|
+
const end = new Date(Date.UTC(year + 1, 0, 1));
|
54
|
+
this.actualdates.forEach(dt => {
|
55
|
+
if (dt.getTime() >= start.getTime() && dt.getTime() < end.getTime()) {
|
56
|
+
answer = new Date(dt);
|
57
|
+
}
|
58
|
+
});
|
59
|
+
return answer;
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* The function will add a new date to the actuals list, if not already present.
|
63
|
+
* @param date The date object to add.
|
64
|
+
*/
|
65
|
+
addActual(date) {
|
66
|
+
let found = false;
|
67
|
+
this.actualdates.forEach(ad => {
|
68
|
+
if (ad.getUTCFullYear() === date.getUTCFullYear()
|
69
|
+
&& ad.getUTCMonth() === date.getUTCMonth()
|
70
|
+
&& ad.getUTCDate() === date.getUTCDate()) {
|
71
|
+
found = true;
|
72
|
+
}
|
73
|
+
});
|
74
|
+
this.actualdates.push(new Date(date));
|
75
|
+
}
|
76
|
+
/**
|
77
|
+
* The function will remove a date from the actuals list.
|
78
|
+
* @param date The date object to remove.
|
79
|
+
*/
|
80
|
+
deleteActual(date) {
|
81
|
+
let found = -1;
|
82
|
+
this.actualdates.forEach((ad, a) => {
|
83
|
+
if (ad.getUTCFullYear() === date.getUTCFullYear()
|
84
|
+
&& ad.getUTCMonth() === date.getUTCMonth()
|
85
|
+
&& ad.getUTCDate() === date.getUTCDate()) {
|
86
|
+
found = a;
|
87
|
+
}
|
88
|
+
});
|
89
|
+
if (found >= 0) {
|
90
|
+
this.actualdates.splice(found, 1);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
/**
|
94
|
+
* This function will check the holiday's actual dates for dates before a cutoff date
|
95
|
+
* and remove them from the object.
|
96
|
+
* @param date The date object used as a cutoff for the purged dates.
|
97
|
+
*/
|
98
|
+
purge(date) {
|
99
|
+
for (let i = this.actualdates.length - 1; i >= 0; i--) {
|
100
|
+
if (this.actualdates[i].getTime() < date.getTime()) {
|
101
|
+
// checking to see if the actual date is before the cutoff date given.
|
102
|
+
// if so, remove it from the list.
|
103
|
+
this.actualdates.splice(i, 1);
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|
108
|
+
exports.Holiday = Holiday;
|
@@ -0,0 +1,19 @@
|
|
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("./holiday"), exports);
|
18
|
+
__exportStar(require("./modperiod"), exports);
|
19
|
+
__exportStar(require("./company"), exports);
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/**
|
2
|
+
* This interface defines a company's modified work period for pay recording. The
|
3
|
+
* modified work period is to ensure employee's can't carry over modified time from one
|
4
|
+
* fiscal period to another, so it has definitive start and ending dates.
|
5
|
+
*/
|
6
|
+
export interface IModPeriod {
|
7
|
+
year: number;
|
8
|
+
start: Date;
|
9
|
+
end: Date;
|
10
|
+
}
|
11
|
+
/**
|
12
|
+
* This class defines the implementation of the company's modified work period, plus an
|
13
|
+
* action to sort the periods with.
|
14
|
+
*/
|
15
|
+
export declare class ModPeriod implements IModPeriod {
|
16
|
+
year: number;
|
17
|
+
start: Date;
|
18
|
+
end: Date;
|
19
|
+
constructor(mod?: IModPeriod);
|
20
|
+
compareTo(other?: ModPeriod): number;
|
21
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ModPeriod = void 0;
|
4
|
+
/**
|
5
|
+
* This class defines the implementation of the company's modified work period, plus an
|
6
|
+
* action to sort the periods with.
|
7
|
+
*/
|
8
|
+
class ModPeriod {
|
9
|
+
year;
|
10
|
+
start;
|
11
|
+
end;
|
12
|
+
constructor(mod) {
|
13
|
+
this.year = (mod) ? mod.year : 0;
|
14
|
+
this.start = (mod) ? new Date(mod.start) : new Date(0);
|
15
|
+
this.end = (mod) ? new Date(mod.end) : new Date(0);
|
16
|
+
}
|
17
|
+
compareTo(other) {
|
18
|
+
if (other) {
|
19
|
+
return (this.year < other.year) ? -1 : 1;
|
20
|
+
}
|
21
|
+
return -1;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
exports.ModPeriod = ModPeriod;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* This interface defines the data members for a contact type.
|
3
|
+
*/
|
4
|
+
export interface IContact {
|
5
|
+
id: number;
|
6
|
+
name: string;
|
7
|
+
sort: number;
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* this class defines the implementation of the contact type plus actions
|
11
|
+
*/
|
12
|
+
export declare class Contact implements IContact {
|
13
|
+
id: number;
|
14
|
+
name: string;
|
15
|
+
sort: number;
|
16
|
+
constructor(co?: IContact);
|
17
|
+
compareTo(other?: Contact): number;
|
18
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Contact = void 0;
|
4
|
+
/**
|
5
|
+
* this class defines the implementation of the contact type plus actions
|
6
|
+
*/
|
7
|
+
class Contact {
|
8
|
+
id;
|
9
|
+
name;
|
10
|
+
sort;
|
11
|
+
constructor(co) {
|
12
|
+
this.id = (co) ? co.id : 0;
|
13
|
+
this.name = (co) ? co.name : '';
|
14
|
+
this.sort = (co) ? co.sort : 0;
|
15
|
+
}
|
16
|
+
compareTo(other) {
|
17
|
+
if (other) {
|
18
|
+
return (this.sort < other.sort) ? -1 : 1;
|
19
|
+
}
|
20
|
+
return -1;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
exports.Contact = Contact;
|
@@ -0,0 +1,19 @@
|
|
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("./contact"), exports);
|
18
|
+
__exportStar(require("./specialty"), exports);
|
19
|
+
__exportStar(require("./team"), exports);
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* This interface defines the data members for a specialty
|
3
|
+
*/
|
4
|
+
export interface ISpecialty {
|
5
|
+
id: number;
|
6
|
+
name: string;
|
7
|
+
sort: number;
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* This class defines the implementation of the specialty infterface plus action.
|
11
|
+
*/
|
12
|
+
export declare class Specialty implements ISpecialty {
|
13
|
+
id: number;
|
14
|
+
name: string;
|
15
|
+
sort: number;
|
16
|
+
constructor(sp?: ISpecialty);
|
17
|
+
compareTo(other?: Specialty): number;
|
18
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Specialty = void 0;
|
4
|
+
/**
|
5
|
+
* This class defines the implementation of the specialty infterface plus action.
|
6
|
+
*/
|
7
|
+
class Specialty {
|
8
|
+
id;
|
9
|
+
name;
|
10
|
+
sort;
|
11
|
+
constructor(sp) {
|
12
|
+
this.id = (sp) ? sp.id : 0;
|
13
|
+
this.sort = (sp) ? sp.sort : 0;
|
14
|
+
this.name = (sp) ? sp.name : '';
|
15
|
+
}
|
16
|
+
compareTo(other) {
|
17
|
+
if (other) {
|
18
|
+
return (this.sort < other.sort) ? -1 : 1;
|
19
|
+
}
|
20
|
+
return -1;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
exports.Specialty = Specialty;
|