scheduler-node-models 1.2.59 → 1.2.61
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
|
@@ -58,8 +58,11 @@ class ExcelRowIngest {
|
|
|
58
58
|
&& name.toLowerCase() !== 'N/A') {
|
|
59
59
|
console.log(name);
|
|
60
60
|
if (this.site.employees) {
|
|
61
|
+
console.log(this.site.employees.length);
|
|
62
|
+
let found = false;
|
|
61
63
|
this.site.employees.forEach(emp => {
|
|
62
64
|
if (emp.name.getLastFirst().toLowerCase() === name.toLowerCase()) {
|
|
65
|
+
found = true;
|
|
63
66
|
for (let c = 3; c < 34; c++) {
|
|
64
67
|
async () => {
|
|
65
68
|
const colDate = new Date(this.docDate.getTime() + (24 * 3600000 * (c - 3)));
|
|
@@ -117,6 +120,9 @@ class ExcelRowIngest {
|
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
});
|
|
123
|
+
if (!found) {
|
|
124
|
+
throw new Error('Employee not found');
|
|
125
|
+
}
|
|
120
126
|
}
|
|
121
127
|
else {
|
|
122
128
|
throw new Error('No employees in site');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Employee } from "../employees";
|
|
1
|
+
import { Employee, IEmployee } from "../employees";
|
|
2
2
|
import { ILaborCode, LaborCode } from "../labor";
|
|
3
3
|
import { CofSReport, ICofSReport } from "./reports/cofsReport";
|
|
4
4
|
import { Forecast, IForecast } from "./reports/forecast";
|
|
@@ -15,6 +15,7 @@ export interface ISite {
|
|
|
15
15
|
laborCodes?: ILaborCode[];
|
|
16
16
|
forecasts?: IForecast[];
|
|
17
17
|
cofs?: ICofSReport[];
|
|
18
|
+
employees?: IEmployee[];
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* This class implements the Site interface data members and actions.
|
package/scheduler/sites/site.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Site = void 0;
|
|
4
|
+
const employees_1 = require("../employees");
|
|
4
5
|
const labor_1 = require("../labor");
|
|
5
6
|
const cofsReport_1 = require("./reports/cofsReport");
|
|
6
7
|
const forecast_1 = require("./reports/forecast");
|
|
@@ -52,6 +53,14 @@ class Site {
|
|
|
52
53
|
this.cofs.sort((a, b) => a.compareTo(b));
|
|
53
54
|
}
|
|
54
55
|
this.employees = [];
|
|
56
|
+
if (site && site.employees) {
|
|
57
|
+
site.employees.forEach(emp => {
|
|
58
|
+
if (this.employees) {
|
|
59
|
+
this.employees.push(new employees_1.Employee(emp));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
this.employees.sort((a, b) => a.compareTo(b));
|
|
63
|
+
}
|
|
55
64
|
}
|
|
56
65
|
/**
|
|
57
66
|
* This function is used for sorting sites
|