scheduler-node-models 1.1.37 → 1.1.44

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 (151) hide show
  1. package/package.json +6 -6
  2. package/general/emailer.d.ts +0 -1
  3. package/general/emailer.js +0 -31
  4. package/general/general.d.ts +0 -12
  5. package/general/general.js +0 -2
  6. package/general/index.d.ts +0 -5
  7. package/general/index.js +0 -21
  8. package/general/logger.d.ts +0 -10
  9. package/general/logger.js +0 -90
  10. package/general/report.d.ts +0 -25
  11. package/general/report.js +0 -76
  12. package/general/reportStyle.d.ts +0 -0
  13. package/general/reportStyle.js +0 -1
  14. package/general/viewstate.d.ts +0 -5
  15. package/general/viewstate.js +0 -9
  16. package/index.d.ts +0 -0
  17. package/index.js +0 -1
  18. package/metrics/images.d.ts +0 -22
  19. package/metrics/images.js +0 -33
  20. package/metrics/index.d.ts +0 -5
  21. package/metrics/index.js +0 -21
  22. package/metrics/mission.d.ts +0 -47
  23. package/metrics/mission.js +0 -81
  24. package/metrics/missionSensorOutage.d.ts +0 -11
  25. package/metrics/missionSensorOutage.js +0 -14
  26. package/metrics/missionsensor.d.ts +0 -67
  27. package/metrics/missionsensor.js +0 -128
  28. package/metrics/outage.d.ts +0 -43
  29. package/metrics/outage.js +0 -55
  30. package/metrics/reports/drawSummary.d.ts +0 -24
  31. package/metrics/reports/drawSummary.js +0 -311
  32. package/metrics/reports/index.d.ts +0 -5
  33. package/metrics/reports/index.js +0 -21
  34. package/metrics/reports/missionDay.d.ts +0 -8
  35. package/metrics/reports/missionDay.js +0 -23
  36. package/metrics/reports/missionSummary.d.ts +0 -25
  37. package/metrics/reports/missionSummary.js +0 -421
  38. package/metrics/reports/missionType.d.ts +0 -20
  39. package/metrics/reports/missionType.js +0 -314
  40. package/metrics/reports/outageDay.d.ts +0 -8
  41. package/metrics/reports/outageDay.js +0 -23
  42. package/metrics/systemdata/classifications.d.ts +0 -18
  43. package/metrics/systemdata/classifications.js +0 -23
  44. package/metrics/systemdata/communications.d.ts +0 -21
  45. package/metrics/systemdata/communications.js +0 -40
  46. package/metrics/systemdata/dcgs.d.ts +0 -19
  47. package/metrics/systemdata/dcgs.js +0 -29
  48. package/metrics/systemdata/exploitations.d.ts +0 -18
  49. package/metrics/systemdata/exploitations.js +0 -23
  50. package/metrics/systemdata/groundSystems.d.ts +0 -86
  51. package/metrics/systemdata/groundSystems.js +0 -143
  52. package/metrics/systemdata/index.d.ts +0 -7
  53. package/metrics/systemdata/index.js +0 -23
  54. package/metrics/systemdata/platform.d.ts +0 -124
  55. package/metrics/systemdata/platform.js +0 -176
  56. package/metrics/systemdata/systeminfo.d.ts +0 -28
  57. package/metrics/systemdata/systeminfo.js +0 -64
  58. package/scheduler/employees/assignment.d.ts +0 -139
  59. package/scheduler/employees/assignment.js +0 -304
  60. package/scheduler/employees/balance.d.ts +0 -35
  61. package/scheduler/employees/balance.js +0 -39
  62. package/scheduler/employees/companyinfo.d.ts +0 -16
  63. package/scheduler/employees/companyinfo.js +0 -6
  64. package/scheduler/employees/contact.d.ts +0 -36
  65. package/scheduler/employees/contact.js +0 -40
  66. package/scheduler/employees/employee.d.ts +0 -427
  67. package/scheduler/employees/employee.js +0 -1887
  68. package/scheduler/employees/employeename.d.ts +0 -48
  69. package/scheduler/employees/employeename.js +0 -97
  70. package/scheduler/employees/index.d.ts +0 -14
  71. package/scheduler/employees/index.js +0 -30
  72. package/scheduler/employees/labor.d.ts +0 -31
  73. package/scheduler/employees/labor.js +0 -39
  74. package/scheduler/employees/leave.d.ts +0 -58
  75. package/scheduler/employees/leave.js +0 -73
  76. package/scheduler/employees/leaverequest.d.ts +0 -105
  77. package/scheduler/employees/leaverequest.js +0 -226
  78. package/scheduler/employees/specialty.d.ts +0 -35
  79. package/scheduler/employees/specialty.js +0 -40
  80. package/scheduler/employees/variation.d.ts +0 -80
  81. package/scheduler/employees/variation.js +0 -132
  82. package/scheduler/employees/web.d.ts +0 -6
  83. package/scheduler/employees/web.js +0 -2
  84. package/scheduler/employees/work.d.ts +0 -96
  85. package/scheduler/employees/work.js +0 -133
  86. package/scheduler/employees/workday.d.ts +0 -91
  87. package/scheduler/employees/workday.js +0 -170
  88. package/scheduler/labor/index.d.ts +0 -2
  89. package/scheduler/labor/index.js +0 -18
  90. package/scheduler/labor/laborcode.d.ts +0 -33
  91. package/scheduler/labor/laborcode.js +0 -55
  92. package/scheduler/labor/workcode.d.ts +0 -28
  93. package/scheduler/labor/workcode.js +0 -35
  94. package/scheduler/reports/chargeStatus.d.ts +0 -66
  95. package/scheduler/reports/chargeStatus.js +0 -752
  96. package/scheduler/reports/cofsReports.d.ts +0 -11
  97. package/scheduler/reports/cofsReports.js +0 -36
  98. package/scheduler/reports/enterpriseSchedule.d.ts +0 -18
  99. package/scheduler/reports/enterpriseSchedule.js +0 -159
  100. package/scheduler/reports/index.d.ts +0 -6
  101. package/scheduler/reports/index.js +0 -22
  102. package/scheduler/reports/leaveReport.d.ts +0 -52
  103. package/scheduler/reports/leaveReport.js +0 -755
  104. package/scheduler/reports/leaves.d.ts +0 -24
  105. package/scheduler/reports/leaves.js +0 -110
  106. package/scheduler/reports/scheduleReport.d.ts +0 -17
  107. package/scheduler/reports/scheduleReport.js +0 -311
  108. package/scheduler/sites/index.d.ts +0 -1
  109. package/scheduler/sites/index.js +0 -17
  110. package/scheduler/sites/reports/cofsReport.d.ts +0 -41
  111. package/scheduler/sites/reports/cofsReport.js +0 -104
  112. package/scheduler/sites/reports/forecast.d.ts +0 -57
  113. package/scheduler/sites/reports/forecast.js +0 -205
  114. package/scheduler/sites/reports/index.d.ts +0 -4
  115. package/scheduler/sites/reports/index.js +0 -20
  116. package/scheduler/sites/reports/period.d.ts +0 -11
  117. package/scheduler/sites/reports/period.js +0 -27
  118. package/scheduler/sites/reports/section.d.ts +0 -63
  119. package/scheduler/sites/reports/section.js +0 -186
  120. package/scheduler/sites/site.d.ts +0 -39
  121. package/scheduler/sites/site.js +0 -68
  122. package/scheduler/sites/workcenters/index.d.ts +0 -3
  123. package/scheduler/sites/workcenters/index.js +0 -19
  124. package/scheduler/sites/workcenters/position.d.ts +0 -27
  125. package/scheduler/sites/workcenters/position.js +0 -36
  126. package/scheduler/sites/workcenters/shift.d.ts +0 -32
  127. package/scheduler/sites/workcenters/shift.js +0 -47
  128. package/scheduler/sites/workcenters/workcenter.d.ts +0 -43
  129. package/scheduler/sites/workcenters/workcenter.js +0 -123
  130. package/scheduler/teams/company/company.d.ts +0 -99
  131. package/scheduler/teams/company/company.js +0 -256
  132. package/scheduler/teams/company/holiday.d.ts +0 -61
  133. package/scheduler/teams/company/holiday.js +0 -116
  134. package/scheduler/teams/company/index.d.ts +0 -3
  135. package/scheduler/teams/company/index.js +0 -19
  136. package/scheduler/teams/company/modperiod.d.ts +0 -21
  137. package/scheduler/teams/company/modperiod.js +0 -24
  138. package/scheduler/teams/contact.d.ts +0 -18
  139. package/scheduler/teams/contact.js +0 -23
  140. package/scheduler/teams/index.d.ts +0 -3
  141. package/scheduler/teams/index.js +0 -19
  142. package/scheduler/teams/specialty.d.ts +0 -18
  143. package/scheduler/teams/specialty.js +0 -23
  144. package/scheduler/teams/team.d.ts +0 -95
  145. package/scheduler/teams/team.js +0 -351
  146. package/users/index.d.ts +0 -2
  147. package/users/index.js +0 -18
  148. package/users/user.d.ts +0 -130
  149. package/users/user.js +0 -256
  150. package/users/web.d.ts +0 -48
  151. package/users/web.js +0 -2
@@ -1,57 +0,0 @@
1
- import { ILaborCode, LaborCode } from "../../labor";
2
- import { IPeriod, Period } from "./period";
3
- export interface IForecast {
4
- id: number;
5
- name: string;
6
- startDate: Date;
7
- endDate: Date;
8
- periods?: IPeriod[];
9
- laborCodes?: ILaborCode[];
10
- companyid?: string;
11
- sortfirst?: boolean;
12
- }
13
- export declare class Forecast implements IForecast {
14
- id: number;
15
- name: string;
16
- startDate: Date;
17
- endDate: Date;
18
- periods: Period[];
19
- laborCodes: LaborCode[];
20
- companyid: string;
21
- sortfirst: boolean;
22
- constructor(fore?: IForecast);
23
- compareTo(other?: Forecast): number;
24
- /**
25
- * This function is used to change the standard work period dates based on the day of
26
- * the week the period ends. This function will ensure that the reports period all end
27
- * on the day of the week provided.
28
- * @param weekday The numeric value for the weekday the periods are to end at.
29
- */
30
- changePeriodsStart(weekday: number): void;
31
- /**
32
- * This function is used to remove forecast periods that have no subperiods.
33
- */
34
- removeUnusedPeriods(): void;
35
- /**
36
- * This function will move a single sub-period from one month to another adjacent
37
- * month.
38
- * @param from The date object representing the month period for the giving subperiod.
39
- * @param to The date object representing the month period for the receiving subperiod.
40
- */
41
- movePeriodBetweenMonths(from: Date, to: Date): void;
42
- /**
43
- * This function adds a sub period to the list of periods where it fits best or add a
44
- * new period for the subperiod.
45
- * @param dt The date object for the sub period to add
46
- */
47
- addOutofCycleSubPeriod(dt: Date): void;
48
- /**
49
- * This function is used to determine if a forecast report is to be used for a report
50
- * date requested.
51
- * @param date The date object used for the testing.
52
- * @param company The string value for company identifier for the testing.
53
- * @returns A boolean value to indicate if the date is between the start and end dates
54
- * of this forecast report and is for the company indicated.
55
- */
56
- use(date: Date, company: string): boolean;
57
- }
@@ -1,205 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Forecast = void 0;
4
- const labor_1 = require("../../labor");
5
- const period_1 = require("./period");
6
- class Forecast {
7
- id;
8
- name;
9
- startDate;
10
- endDate;
11
- periods;
12
- laborCodes;
13
- companyid;
14
- sortfirst;
15
- constructor(fore) {
16
- this.id = (fore) ? fore.id : 0;
17
- this.name = (fore) ? fore.name : '';
18
- this.startDate = (fore) ? new Date(fore.startDate) : new Date(0);
19
- this.endDate = (fore) ? new Date(fore.endDate) : new Date(0);
20
- this.periods = [];
21
- if (fore && fore.periods && fore.periods.length > 0) {
22
- fore.periods.forEach(per => {
23
- this.periods.push(new period_1.Period(per));
24
- });
25
- this.periods.sort((a, b) => a.compareTo(b));
26
- }
27
- this.laborCodes = [];
28
- if (fore && fore.laborCodes && fore.laborCodes.length > 0) {
29
- fore.laborCodes.forEach(lc => {
30
- this.laborCodes.push(new labor_1.LaborCode(lc));
31
- });
32
- this.laborCodes.sort((a, b) => a.compareTo(b));
33
- }
34
- this.companyid = (fore && fore.companyid) ? fore.companyid : '';
35
- this.sortfirst = (fore && fore.sortfirst) ? fore.sortfirst : false;
36
- }
37
- compareTo(other) {
38
- if (other) {
39
- if (this.startDate.getTime() === other.startDate.getTime()) {
40
- if (this.endDate.getTime() === other.endDate.getTime()) {
41
- return (this.name < other.name) ? -1 : 1;
42
- }
43
- return (this.endDate.getTime() < other.endDate.getTime()) ? -1 : 1;
44
- }
45
- return (this.startDate.getTime() < other.startDate.getTime()) ? -1 : 1;
46
- }
47
- return -1;
48
- }
49
- /**
50
- * This function is used to change the standard work period dates based on the day of
51
- * the week the period ends. This function will ensure that the reports period all end
52
- * on the day of the week provided.
53
- * @param weekday The numeric value for the weekday the periods are to end at.
54
- */
55
- changePeriodsStart(weekday) {
56
- let end = new Date(Date.UTC(this.endDate.getFullYear(), this.endDate.getMonth(), this.endDate.getDate()));
57
- while (end.getDay() !== weekday) {
58
- end = new Date(end.getTime() + (24 * 3600000));
59
- }
60
- let start = new Date(Date.UTC(this.startDate.getFullYear(), this.startDate.getMonth(), this.startDate.getDate()));
61
- while (start.getDay() !== weekday) {
62
- start = new Date(start.getTime() + (24 * 3600000));
63
- }
64
- // clear the old periods' subperiods.
65
- this.periods.forEach(per => {
66
- per.periods = [];
67
- });
68
- while (start.getTime() < end.getTime()) {
69
- let found = false;
70
- this.periods.forEach((per, p) => {
71
- if (per.month.getFullYear() === start.getFullYear()
72
- && per.month.getMonth() === start.getMonth()) {
73
- per.periods.push(new Date(start));
74
- per.sortSubperiods();
75
- found = true;
76
- this.periods[p] = per;
77
- }
78
- });
79
- if (!found) {
80
- const month = new period_1.Period({
81
- month: new Date(Date.UTC(start.getFullYear(), start.getMonth(), 1)),
82
- periods: [start]
83
- });
84
- this.periods.push(month);
85
- this.periods.sort((a, b) => a.compareTo(b));
86
- }
87
- start = new Date(start.getTime() + (7 * 24 * 3600000));
88
- }
89
- this.removeUnusedPeriods();
90
- }
91
- /**
92
- * This function is used to remove forecast periods that have no subperiods.
93
- */
94
- removeUnusedPeriods() {
95
- for (let p = this.periods.length - 1; p >= 0; p--) {
96
- if (this.periods[p].periods.length === 0) {
97
- this.periods.splice(p, 1);
98
- }
99
- }
100
- this.periods.sort((a, b) => a.compareTo(b));
101
- }
102
- /**
103
- * This function will move a single sub-period from one month to another adjacent
104
- * month.
105
- * @param from The date object representing the month period for the giving subperiod.
106
- * @param to The date object representing the month period for the receiving subperiod.
107
- */
108
- movePeriodBetweenMonths(from, to) {
109
- let fromPrd;
110
- let toPrd;
111
- let fromPos = -1;
112
- let toPos = -1;
113
- // determine the two periods the sub period will be move from and to.
114
- this.periods.sort((a, b) => a.compareTo(b));
115
- this.periods.forEach((prd, p) => {
116
- if (prd.month.getTime() === from.getTime()) {
117
- fromPrd = new period_1.Period(prd);
118
- fromPos = p;
119
- }
120
- else if (prd.month.getTime() === to.getTime()) {
121
- toPrd = new period_1.Period(prd);
122
- toPos = p;
123
- }
124
- });
125
- // if the to period isn't selected, create a new one for the month prior to 0
126
- if (toPos < 0) {
127
- toPrd = new period_1.Period({
128
- month: to,
129
- periods: []
130
- });
131
- this.periods.push(toPrd);
132
- toPos = this.periods.length - 1;
133
- }
134
- // now sort the subperiod of the from period
135
- if (fromPrd && toPrd) {
136
- fromPrd.sortSubperiods();
137
- if (from.getTime() < to.getTime()) {
138
- // when the from period is before the to period
139
- // we will pop a period from the end of the list and push it onto the end of
140
- // the to period then sort it
141
- const sprd = fromPrd.periods.pop();
142
- if (sprd) {
143
- toPrd.periods.push(new Date(sprd));
144
- }
145
- }
146
- else {
147
- // else pull the first sub period and push it to the to period
148
- const sprd = fromPrd.periods.shift();
149
- if (sprd) {
150
- toPrd.periods.push(new Date(sprd));
151
- }
152
- }
153
- toPrd.sortSubperiods();
154
- // re-set the from and to periods, then re-sort the periods and remove unused periods.
155
- this.periods[fromPos] = fromPrd;
156
- this.periods[toPos] = toPrd;
157
- this.periods.sort((a, b) => a.compareTo(b));
158
- this.removeUnusedPeriods();
159
- }
160
- }
161
- /**
162
- * This function adds a sub period to the list of periods where it fits best or add a
163
- * new period for the subperiod.
164
- * @param dt The date object for the sub period to add
165
- */
166
- addOutofCycleSubPeriod(dt) {
167
- const periodID = new Date(Date.UTC(dt.getFullYear(), dt.getMonth(), 1));
168
- let found = false;
169
- this.periods.forEach((prd, p) => {
170
- if (prd.month.getTime() === periodID.getTime()) {
171
- prd.periods.forEach((sprd, sp) => {
172
- if (sprd.getTime() === dt.getTime()) {
173
- found = true;
174
- }
175
- });
176
- if (!found) {
177
- prd.periods.push(new Date(dt));
178
- prd.sortSubperiods();
179
- this.periods[p] = prd;
180
- }
181
- found = true;
182
- }
183
- });
184
- if (!found) {
185
- const prd = new period_1.Period({
186
- month: periodID
187
- });
188
- prd.periods.push(new Date(dt));
189
- }
190
- }
191
- /**
192
- * This function is used to determine if a forecast report is to be used for a report
193
- * date requested.
194
- * @param date The date object used for the testing.
195
- * @param company The string value for company identifier for the testing.
196
- * @returns A boolean value to indicate if the date is between the start and end dates
197
- * of this forecast report and is for the company indicated.
198
- */
199
- use(date, company) {
200
- return (date.getTime() >= this.startDate.getTime()
201
- && date.getTime() <= this.endDate.getTime()
202
- && company.toLowerCase() === this.companyid.toLowerCase());
203
- }
204
- }
205
- exports.Forecast = Forecast;
@@ -1,4 +0,0 @@
1
- export * from './cofsReport';
2
- export * from './forecast';
3
- export * from './period';
4
- export * from './section';
@@ -1,20 +0,0 @@
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("./cofsReport"), exports);
18
- __exportStar(require("./forecast"), exports);
19
- __exportStar(require("./period"), exports);
20
- __exportStar(require("./section"), exports);
@@ -1,11 +0,0 @@
1
- export interface IPeriod {
2
- month: Date;
3
- periods?: Date[];
4
- }
5
- export declare class Period implements IPeriod {
6
- month: Date;
7
- periods: Date[];
8
- constructor(per?: IPeriod);
9
- compareTo(other?: Period): number;
10
- sortSubperiods(): void;
11
- }
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Period = void 0;
4
- class Period {
5
- month;
6
- periods;
7
- constructor(per) {
8
- this.month = (per) ? new Date(per.month) : new Date(0);
9
- this.periods = [];
10
- if (per && per.periods && per.periods.length > 0) {
11
- per.periods.forEach(p => {
12
- this.periods.push(new Date(p));
13
- });
14
- per.periods.sort((a, b) => (a.getTime() < b.getTime()) ? -1 : 1);
15
- }
16
- }
17
- compareTo(other) {
18
- if (other) {
19
- return (this.month.getTime() < other.month.getTime()) ? -1 : 1;
20
- }
21
- return -1;
22
- }
23
- sortSubperiods() {
24
- this.periods.sort((a, b) => (a.getTime() < b.getTime()) ? -1 : 1);
25
- }
26
- }
27
- exports.Period = Period;
@@ -1,63 +0,0 @@
1
- import { Employee } from "../../employees";
2
- import { ILaborCode, LaborCode, Workcode } from "../../labor";
3
- /**
4
- * This interface will define the data members for a report section of a CofS report
5
- * definition.
6
- */
7
- export interface ISection {
8
- id: number;
9
- company: string;
10
- label: string;
11
- signature: string;
12
- laborcodes?: ILaborCode[];
13
- showunit: boolean;
14
- }
15
- /**
16
- * This class implements the data members and actions for CofS report sections.
17
- */
18
- export declare class Section implements ISection {
19
- id: number;
20
- company: string;
21
- label: string;
22
- signature: string;
23
- laborcodes: LaborCode[];
24
- showunit: boolean;
25
- constructor(sec?: ISection);
26
- compareTo(other?: Section): number;
27
- /**
28
- * This function will produce a Certificate of Service report section, which usually
29
- * holds the employees and their work hours in respect to the period provided as an
30
- * XML output string.
31
- * @param start The date object used for the start of the report period.
32
- * @param end The date object to mark the end of the period, but not included in the
33
- * period.
34
- * @param workcodes A mapped list of workcodes to be used in this report.
35
- * @param employees A list of employees that may or may not have worked on labor codes
36
- * associated with this section.
37
- * @param sectionID The numeric value (integer) for the position this section holds
38
- * within the overall report file.
39
- * @param unit The string value for the unit the report is associated with.
40
- * @returns An interface consisting of the xml output for section's data, plus
41
- * an array of strings for remarks created during the section creation.
42
- */
43
- createReportSection(start: Date, end: Date, workcodes: Map<string, Workcode>, employees: Employee[], sectionID: number, unit: string): {
44
- output: string;
45
- remarks: string[];
46
- };
47
- /**
48
- * This function will create a CofS Section's employee row data based on the information
49
- * provided
50
- * @param count The numeric value for the position the employee is in the section list
51
- * @param coCount The section identifier, numeric value Section count.
52
- * @param emp The employee object for the row of data
53
- * @param start The date object representing the start of the report period.
54
- * @param end The date object for the end of the report period (not included in report)
55
- * @param workcodes A mapped list of the workcodes to be used within the report.
56
- * @returns An interface consisting of the xml output for the employee row data, plus
57
- * an array of strings for remarks created during the row creation.
58
- */
59
- createEmployeeSectionData(count: number, coCount: number, emp: Employee, start: Date, end: Date, workcodes: Map<string, Workcode>): {
60
- output: string;
61
- remarks: string[];
62
- };
63
- }
@@ -1,186 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Section = void 0;
4
- const employees_1 = require("../../employees");
5
- const labor_1 = require("../../labor");
6
- /**
7
- * This class implements the data members and actions for CofS report sections.
8
- */
9
- class Section {
10
- id;
11
- company;
12
- label;
13
- signature;
14
- laborcodes;
15
- showunit;
16
- constructor(sec) {
17
- this.id = (sec) ? sec.id : 0;
18
- this.company = (sec) ? sec.company : '';
19
- this.label = (sec) ? sec.label : '';
20
- this.signature = (sec) ? sec.signature : '';
21
- this.showunit = (sec) ? sec.showunit : false;
22
- this.laborcodes = [];
23
- if (sec && sec.laborcodes && sec.laborcodes.length) {
24
- sec.laborcodes.forEach(lc => {
25
- this.laborcodes.push(new labor_1.LaborCode(lc));
26
- });
27
- this.laborcodes.sort((a, b) => a.compareTo(b));
28
- }
29
- }
30
- compareTo(other) {
31
- if (other) {
32
- return (this.id < other.id) ? -1 : 1;
33
- }
34
- return -1;
35
- }
36
- /**
37
- * This function will produce a Certificate of Service report section, which usually
38
- * holds the employees and their work hours in respect to the period provided as an
39
- * XML output string.
40
- * @param start The date object used for the start of the report period.
41
- * @param end The date object to mark the end of the period, but not included in the
42
- * period.
43
- * @param workcodes A mapped list of workcodes to be used in this report.
44
- * @param employees A list of employees that may or may not have worked on labor codes
45
- * associated with this section.
46
- * @param sectionID The numeric value (integer) for the position this section holds
47
- * within the overall report file.
48
- * @param unit The string value for the unit the report is associated with.
49
- * @returns An interface consisting of the xml output for section's data, plus
50
- * an array of strings for remarks created during the section creation.
51
- */
52
- createReportSection(start, end, workcodes, employees, sectionID, unit) {
53
- const remarks = [];
54
- let output = '';
55
- output += `<Company${sectionID}>${this.label}</Company${sectionID}>\n`
56
- + `<Section${sectionID}_Lead>${this.signature}</Section${sectionID}_Lead>\n`;
57
- if (this.showunit) {
58
- output += `<Unit${sectionID}>${unit}</Unit${sectionID}>\n`;
59
- }
60
- let count = 0;
61
- employees.forEach(emp => {
62
- if (emp.isActive(start) || emp.isActive(end)) {
63
- let hours = 0.0;
64
- let bPrimary = false;
65
- this.laborcodes.forEach(lc => {
66
- hours += emp.getWorkedHours(start, end, lc.chargeNumber, lc.extension);
67
- if (emp.isPrimaryCode(start, new employees_1.EmployeeLaborCode({
68
- chargenumber: lc.chargeNumber, extension: lc.extension
69
- }))) {
70
- bPrimary = true;
71
- }
72
- });
73
- if (hours > 0.0 || bPrimary) {
74
- count++;
75
- const result = this.createEmployeeSectionData(count, sectionID, emp, start, end, workcodes);
76
- if (result.output !== '') {
77
- const lines = result.output.split('\n');
78
- lines.forEach(line => {
79
- output += `\t${line}\n`;
80
- });
81
- }
82
- if (result.remarks.length > 0) {
83
- result.remarks.forEach(rmk => {
84
- remarks.push(rmk);
85
- });
86
- }
87
- }
88
- }
89
- });
90
- return { output: output, remarks: remarks };
91
- }
92
- /**
93
- * This function will create a CofS Section's employee row data based on the information
94
- * provided
95
- * @param count The numeric value for the position the employee is in the section list
96
- * @param coCount The section identifier, numeric value Section count.
97
- * @param emp The employee object for the row of data
98
- * @param start The date object representing the start of the report period.
99
- * @param end The date object for the end of the report period (not included in report)
100
- * @param workcodes A mapped list of the workcodes to be used within the report.
101
- * @returns An interface consisting of the xml output for the employee row data, plus
102
- * an array of strings for remarks created during the row creation.
103
- */
104
- createEmployeeSectionData(count, coCount, emp, start, end, workcodes) {
105
- const empLaborCodes = [];
106
- this.laborcodes.forEach(lc => {
107
- empLaborCodes.push(new employees_1.EmployeeLaborCode({ chargenumber: lc.chargeNumber,
108
- extension: lc.extension
109
- }));
110
- });
111
- const remarks = [];
112
- let output = '';
113
- let total = 0.0;
114
- const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
115
- 'Nov', 'Dec'];
116
- // every employee row starts with name and job title.
117
- let label = `NameRow${count}`;
118
- if (coCount > 1) {
119
- label += `_${coCount}`;
120
- }
121
- output += `<${label}>${emp.name.getLastFirst()}</${label}>\n`;
122
- label = `PositionRow${count}`;
123
- if (coCount > 1) {
124
- label += `_${coCount}`;
125
- }
126
- output += `<${label}>${emp.companyinfo.jobtitle}</${label}>\n`;
127
- // next add the daily information
128
- let current = new Date(Date.UTC(start.getFullYear(), start.getMonth(), 1));
129
- while (current.getTime() < end.getTime()) {
130
- let hours = 0.0;
131
- label = `Section${coCount}Row${count}_${current.getDate().toString().padStart(2, '0')}`;
132
- this.laborcodes.forEach(lc => {
133
- const thours = emp.getWorkedHours(current, current, lc.chargeNumber, lc.extension);
134
- if (thours > 0) {
135
- hours += thours;
136
- }
137
- });
138
- if (hours > 0.0) {
139
- total += hours;
140
- const iHours = Math.floor(hours * 10);
141
- const icHours = Math.floor(hours) * 10;
142
- if (icHours === iHours) {
143
- output += `<${label}>${hours.toFixed(0)}</${label}>\n`;
144
- }
145
- else {
146
- output += `<${label}>${hours.toFixed(1)}</${label}>\n`;
147
- }
148
- if (hours > 12.0) {
149
- const remark = `${this.company.toUpperCase()}: ${emp.name.getFirstLast()} `
150
- + `received a safety briefing for working over 12 hours on `
151
- + `${current.getDate().toString().padStart(2, '0')} ${months[current.getMonth()]}`;
152
- remarks.push(remark);
153
- }
154
- }
155
- else {
156
- const wd = emp.getWorkday(current, 'actuals', empLaborCodes);
157
- if (wd && wd.code !== '') {
158
- let wc = workcodes.get(wd.code);
159
- if (wc && wc.altcode && wc.altcode !== '') {
160
- output += `<${label}>${wc.altcode}</${label}>\n`;
161
- }
162
- else {
163
- output += `<${label}/>\n`;
164
- }
165
- }
166
- else {
167
- output += `<${label}/>\n`;
168
- }
169
- }
170
- current = new Date(current.getTime() + (24 * 3600000));
171
- }
172
- // add total hours information
173
- label = `TotalHoursRow${count}`;
174
- if (coCount > 1) {
175
- label += `_${coCount}`;
176
- }
177
- output += `<${label}>${total.toFixed(1)}</${label}>\n`;
178
- if (total > 200.0) {
179
- const remark = `${this.company.toUpperCase()}: ${emp.name.getFirstLast()} exceeded `
180
- + '200 hours to support ops tempo.';
181
- remarks.push(remark);
182
- }
183
- return { output: output, remarks: remarks };
184
- }
185
- }
186
- exports.Section = Section;
@@ -1,39 +0,0 @@
1
- import { Employee } from "../employees";
2
- import { ILaborCode, LaborCode } from "../labor";
3
- import { CofSReport, ICofSReport } from "./reports/cofsReport";
4
- import { Forecast, IForecast } from "./reports/forecast";
5
- import { IWorkcenter, Workcenter } from "./workcenters/workcenter";
6
- /**
7
- * This interface defined the data members for a team site.
8
- */
9
- export interface ISite {
10
- id: string;
11
- name: string;
12
- utcOffset: number;
13
- showMids: boolean;
14
- workcenters?: IWorkcenter[];
15
- laborCodes?: ILaborCode[];
16
- forecasts?: IForecast[];
17
- cofs?: ICofSReport[];
18
- }
19
- /**
20
- * This class implements the Site interface data members and actions.
21
- */
22
- export declare class Site implements ISite {
23
- id: string;
24
- name: string;
25
- utcOffset: number;
26
- showMids: boolean;
27
- workcenters: Workcenter[];
28
- laborCodes: LaborCode[];
29
- forecasts: Forecast[];
30
- cofs: CofSReport[];
31
- employees?: Employee[];
32
- constructor(site?: ISite);
33
- /**
34
- * This function is used for sorting sites
35
- * @param other another site object to use in comparison
36
- * @returns A numeric value for the relative position of this site to another.
37
- */
38
- compareTo(other?: Site): number;
39
- }
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Site = void 0;
4
- const labor_1 = require("../labor");
5
- const cofsReport_1 = require("./reports/cofsReport");
6
- const forecast_1 = require("./reports/forecast");
7
- const workcenter_1 = require("./workcenters/workcenter");
8
- /**
9
- * This class implements the Site interface data members and actions.
10
- */
11
- class Site {
12
- id;
13
- name;
14
- utcOffset;
15
- showMids;
16
- workcenters;
17
- laborCodes;
18
- forecasts;
19
- cofs;
20
- employees;
21
- constructor(site) {
22
- this.id = (site) ? site.id : '';
23
- this.name = (site) ? site.name : '';
24
- this.utcOffset = (site) ? site.utcOffset : 0;
25
- this.showMids = (site) ? site.showMids : false;
26
- this.workcenters = [];
27
- if (site && site.workcenters) {
28
- site.workcenters.forEach(wc => {
29
- this.workcenters.push(new workcenter_1.Workcenter(wc));
30
- });
31
- this.workcenters.sort((a, b) => a.compareTo(b));
32
- }
33
- this.laborCodes = [];
34
- if (site && site.laborCodes) {
35
- site.laborCodes.forEach(lc => {
36
- this.laborCodes.push(new labor_1.LaborCode(lc));
37
- });
38
- this.laborCodes.sort((a, b) => a.compareTo(b));
39
- }
40
- this.forecasts = [];
41
- if (site && site.forecasts) {
42
- site.forecasts.forEach(fcst => {
43
- this.forecasts.push(new forecast_1.Forecast(fcst));
44
- });
45
- this.forecasts.sort((a, b) => a.compareTo(b));
46
- }
47
- this.cofs = [];
48
- if (site && site.cofs) {
49
- site.cofs.forEach(cofs => {
50
- this.cofs.push(new cofsReport_1.CofSReport(cofs));
51
- });
52
- this.cofs.sort((a, b) => a.compareTo(b));
53
- }
54
- this.employees = [];
55
- }
56
- /**
57
- * This function is used for sorting sites
58
- * @param other another site object to use in comparison
59
- * @returns A numeric value for the relative position of this site to another.
60
- */
61
- compareTo(other) {
62
- if (other) {
63
- return (this.name < other.name) ? -1 : 1;
64
- }
65
- return -1;
66
- }
67
- }
68
- exports.Site = Site;